From 360f67636bdb67eeac80e60b8e27fb88b80fa0fd Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 23 Oct 2010 15:44:33 +0000 Subject: 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 --- engines/sword25/input/inputengine_script.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'engines/sword25/input/inputengine_script.cpp') 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; } -- cgit v1.2.3