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
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
36ControllerScriptingInterface::~ControllerScriptingInterface() {
37 delete _newControllerScriptingInterface;
38}
39
40
34static int actionMetaTypeId = qRegisterMetaType<UserInputMapper::Action>();41static int actionMetaTypeId = qRegisterMetaType<UserInputMapper::Action>();
35static int inputChannelMetaTypeId = qRegisterMetaType<UserInputMapper::InputChannel>();42static int inputChannelMetaTypeId = qRegisterMetaType<UserInputMapper::InputChannel>();
36static int inputMetaTypeId = qRegisterMetaType<UserInputMapper::Input>();43static 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
126void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) {138void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) {