diff options
author | Max Horn | 2010-10-23 15:44:33 +0000 |
---|---|---|
committer | Max Horn | 2010-10-23 15:44:33 +0000 |
commit | 360f67636bdb67eeac80e60b8e27fb88b80fa0fd (patch) | |
tree | 3c086e21d79c3c10185ca5cd56bdf30b65f70297 /engines/sword25/input/inputengine_script.cpp | |
parent | c483a22f2a8c02c2b1ecaf5f9626999fd3ed3c7e (diff) | |
download | scummvm-rg350-360f67636bdb67eeac80e60b8e27fb88b80fa0fd.tar.gz scummvm-rg350-360f67636bdb67eeac80e60b8e27fb88b80fa0fd.tar.bz2 scummvm-rg350-360f67636bdb67eeac80e60b8e27fb88b80fa0fd.zip |
SWORD25: Register LUA callbacks insider registerScriptBindings() methods
Previously, the constructor of an anonymous global object was used to do
this, for no apparent reason.
However, maybe there was a hidden reason which I missed, so this change
might cause regressions. I.e., please test.
svn-id: r53735
Diffstat (limited to 'engines/sword25/input/inputengine_script.cpp')
-rw-r--r-- | engines/sword25/input/inputengine_script.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/engines/sword25/input/inputengine_script.cpp b/engines/sword25/input/inputengine_script.cpp index 0ada7ece5c..f68b265297 100644 --- a/engines/sword25/input/inputengine_script.cpp +++ b/engines/sword25/input/inputengine_script.cpp @@ -83,13 +83,6 @@ protected: static CommandCallbackClass *commandCallbackPtr = 0; // FIXME: should be turned into InputEngine member var -struct CallbackfunctionRegisterer { - CallbackfunctionRegisterer() { - CallbackRegistry::instance().registerCallbackFunction("LuaCommandCB", theCommandCallback); - CallbackRegistry::instance().registerCallbackFunction("LuaCharacterCB", theCharacterCallback); - } -}; -static CallbackfunctionRegisterer instance; } static InputEngine *getIE() { @@ -298,6 +291,9 @@ bool InputEngine::registerScriptBindings() { assert(commandCallbackPtr == 0); commandCallbackPtr = new CommandCallbackClass(L); + CallbackRegistry::instance().registerCallbackFunction("LuaCommandCB", theCommandCallback); + CallbackRegistry::instance().registerCallbackFunction("LuaCharacterCB", theCharacterCallback); + return true; } |