Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -14,6 +14,8 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <HandData.h> |
| 15 | 15 | #include <HFBackEvent.h> |
| 16 | 16 | |
| 17 | +#include <controllers/NewControllerScriptingInterface.h> | |
| 18 | + | |
| 17 | 19 | #include "Application.h" |
| 18 | 20 | #include "devices/MotionTracker.h" |
| 19 | 21 | #include "ControllerScriptingInterface.h" |
| @@ -31,6 +33,11 @@ ControllerScriptingInterface::ControllerScriptingInterface() : · 11 unmodified lines | ||
| 31 | 33 | |
| 32 | 34 | } |
| 33 | 35 | |
| 36 | +ControllerScriptingInterface::~ControllerScriptingInterface() { | |
| 37 | + delete _newControllerScriptingInterface; | |
| 38 | +} | |
| 39 | + | |
| 40 | + | |
| 34 | 41 | static int actionMetaTypeId = qRegisterMetaType<UserInputMapper::Action>(); |
| 35 | 42 | static int inputChannelMetaTypeId = qRegisterMetaType<UserInputMapper::InputChannel>(); |
| 36 | 43 | static int inputMetaTypeId = qRegisterMetaType<UserInputMapper::Input>(); |
| @@ -121,6 +128,11 @@ void ControllerScriptingInterface::registerControllerTypes(ScriptEngine* engine) · 84 unmodified lines | ||
| 121 | 128 | qScriptRegisterMetaType(engine, inputPairToScriptValue, inputPairFromScriptValue); |
| 122 | 129 | |
| 123 | 130 | wireUpControllers(engine); |
| 131 | + | |
| 132 | + // hack in the new controller scripting interface... | |
| 133 | + _newControllerScriptingInterface = new controller::NewControllerScriptingInterface(); | |
| 134 | + engine->registerGlobalObject("NewControllers", _newControllerScriptingInterface); | |
| 135 | + | |
| 124 | 136 | } |
| 125 | 137 | |
| 126 | 138 | void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) { |