aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/graphicengine_script.cpp
diff options
context:
space:
mode:
authorMax Horn2010-10-23 15:44:04 +0000
committerMax Horn2010-10-23 15:44:04 +0000
commitc483a22f2a8c02c2b1ecaf5f9626999fd3ed3c7e (patch)
tree157405c31e1e03dd43def80ec8445d6fb0f4a7e5 /engines/sword25/gfx/graphicengine_script.cpp
parent3e657c1bf961390bf645a27c6616b527e457d372 (diff)
downloadscummvm-rg350-c483a22f2a8c02c2b1ecaf5f9626999fd3ed3c7e.tar.gz
scummvm-rg350-c483a22f2a8c02c2b1ecaf5f9626999fd3ed3c7e.tar.bz2
scummvm-rg350-c483a22f2a8c02c2b1ecaf5f9626999fd3ed3c7e.zip
SWORD25: Get rid of global SharedPtr instances
svn-id: r53734
Diffstat (limited to 'engines/sword25/gfx/graphicengine_script.cpp')
-rw-r--r--engines/sword25/gfx/graphicengine_script.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp
index 956c0352f0..fa97b80c82 100644
--- a/engines/sword25/gfx/graphicengine_script.cpp
+++ b/engines/sword25/gfx/graphicengine_script.cpp
@@ -71,8 +71,8 @@ protected:
}
};
-Common::ScopedPtr<LuaCallback> loopPointCallbackPtr;
-Common::ScopedPtr<ActionCallback> actionCallbackPtr;
+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() {
@@ -1289,10 +1289,21 @@ bool GraphicEngine::registerScriptBindings() {
if (!LuaBindhelper::addFunctionsToLib(L, GFX_LIBRARY_NAME, GFX_FUNCTIONS)) return false;
- loopPointCallbackPtr.reset(new LuaCallback(L));
- actionCallbackPtr.reset(new ActionCallback(L));
+ assert(loopPointCallbackPtr == 0);
+ loopPointCallbackPtr = new LuaCallback(L);
+
+ assert(actionCallbackPtr == 0);
+ actionCallbackPtr = new ActionCallback(L);
return true;
}
+void GraphicEngine::unregisterScriptBindings() {
+ delete loopPointCallbackPtr;
+ loopPointCallbackPtr = 0;
+
+ delete actionCallbackPtr;
+ actionCallbackPtr = 0;
+}
+
} // End of namespace Sword25