History

hack in mappings to interface

Ryan Huffman committed 11 years ago

Commit 9a9bdbb1 parent f860ca94 files · +33 −2Browse files

Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

interface/src/scripting/ControllerScriptingInterface.cpp+12−0
@@ -14,6 +14,8 @@ · 13 unmodified lines
1414 #include <HandData.h>
1515 #include <HFBackEvent.h>
1616
17+#include <controllers/NewControllerScriptingInterface.h>
18+
1719 #include "Application.h"
1820 #include "devices/MotionTracker.h"
1921 #include "ControllerScriptingInterface.h"
@@ -31,6 +33,11 @@ ControllerScriptingInterface::ControllerScriptingInterface() : · 11 unmodified lines
3133
3234 }
3335
36+ControllerScriptingInterface::~ControllerScriptingInterface() {
37+ delete _newControllerScriptingInterface;
38+}
39+
40+
3441 static int actionMetaTypeId = qRegisterMetaType<UserInputMapper::Action>();
3542 static int inputChannelMetaTypeId = qRegisterMetaType<UserInputMapper::InputChannel>();
3643 static int inputMetaTypeId = qRegisterMetaType<UserInputMapper::Input>();
@@ -121,6 +128,11 @@ void ControllerScriptingInterface::registerControllerTypes(ScriptEngine* engine) · 84 unmodified lines
121128 qScriptRegisterMetaType(engine, inputPairToScriptValue, inputPairFromScriptValue);
122129
123130 wireUpControllers(engine);
131+
132+ // hack in the new controller scripting interface...
133+ _newControllerScriptingInterface = new controller::NewControllerScriptingInterface();
134+ engine->registerGlobalObject("NewControllers", _newControllerScriptingInterface);
135+
124136 }
125137
126138 void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) {