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 | #include <HandData.h> | 14 | #include <HandData.h> |
| 15 | #include <HFBackEvent.h> | 15 | #include <HFBackEvent.h> |
| 16 | 16 | ||
| 17 | #include <controllers/NewControllerScriptingInterface.h> | ||
| 18 | |||
| 17 | #include "Application.h" | 19 | #include "Application.h" |
| 18 | #include "devices/MotionTracker.h" | 20 | #include "devices/MotionTracker.h" |
| 19 | #include "ControllerScriptingInterface.h" | 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 | static int actionMetaTypeId = qRegisterMetaType<UserInputMapper::Action>(); | 41 | static int actionMetaTypeId = qRegisterMetaType<UserInputMapper::Action>(); |
| 35 | static int inputChannelMetaTypeId = qRegisterMetaType<UserInputMapper::InputChannel>(); | 42 | static int inputChannelMetaTypeId = qRegisterMetaType<UserInputMapper::InputChannel>(); |
| 36 | static int inputMetaTypeId = qRegisterMetaType<UserInputMapper::Input>(); | 43 | static int inputMetaTypeId = qRegisterMetaType<UserInputMapper::Input>(); |
| @@ -121,6 +128,11 @@ void ControllerScriptingInterface::registerControllerTypes(ScriptEngine* engine) · 84 unmodified lines | |||
| 121 | qScriptRegisterMetaType(engine, inputPairToScriptValue, inputPairFromScriptValue); | 128 | qScriptRegisterMetaType(engine, inputPairToScriptValue, inputPairFromScriptValue); |
| 122 | 129 | ||
| 123 | wireUpControllers(engine); | 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 | void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) { | 138 | void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) { |