aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword25/gfx/graphicengine_script.cpp13
-rw-r--r--engines/sword25/input/inputengine_script.cpp10
2 files changed, 7 insertions, 16 deletions
diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp
index fa97b80c82..835e1e20b8 100644
--- a/engines/sword25/gfx/graphicengine_script.cpp
+++ b/engines/sword25/gfx/graphicengine_script.cpp
@@ -73,15 +73,6 @@ protected:
static LuaCallback *loopPointCallbackPtr = 0; // FIXME: should be turned into GraphicEngine member var
static ActionCallback *actionCallbackPtr = 0; // FIXME: should be turned into GraphicEngine member var
-
-struct CallbackfunctionRegisterer {
- CallbackfunctionRegisterer() {
- CallbackRegistry::instance().registerCallbackFunction("LuaLoopPointCB", (void ( *)(int))animationLoopPointCallback);
- CallbackRegistry::instance().registerCallbackFunction("LuaActionCB", (void ( *)(int))animationActionCallback);
- CallbackRegistry::instance().registerCallbackFunction("LuaDeleteCB", (void ( *)(int))animationDeleteCallback);
- }
-};
-static CallbackfunctionRegisterer Instance;
}
// Die Strings werden als #defines definiert um Stringkomposition zur Compilezeit zu ermöglichen.
@@ -1295,6 +1286,10 @@ bool GraphicEngine::registerScriptBindings() {
assert(actionCallbackPtr == 0);
actionCallbackPtr = new ActionCallback(L);
+ CallbackRegistry::instance().registerCallbackFunction("LuaLoopPointCB", (void ( *)(int))animationLoopPointCallback);
+ CallbackRegistry::instance().registerCallbackFunction("LuaActionCB", (void ( *)(int))animationActionCallback);
+ CallbackRegistry::instance().registerCallbackFunction("LuaDeleteCB", (void ( *)(int))animationDeleteCallback);
+
return true;
}
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;
}