diff options
author | Paul Gilbert | 2010-08-01 09:31:36 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 22:18:35 +0000 |
commit | 2006e564a1287ff31c2c6acedecf90034e784fd2 (patch) | |
tree | 4e1ebb10fedbd39f053691c3cd59b6157c545d37 /engines/sword25/script/luacallback.cpp | |
parent | 53a9d2d0a1dab1119dc1cc12886321fa72743061 (diff) | |
download | scummvm-rg350-2006e564a1287ff31c2c6acedecf90034e784fd2.tar.gz scummvm-rg350-2006e564a1287ff31c2c6acedecf90034e784fd2.tar.bz2 scummvm-rg350-2006e564a1287ff31c2c6acedecf90034e784fd2.zip |
SWORD25: Moved the Lua library into it's own namespace
Previously with some of the files I was leaving the #include references to the library inside the global namespace. However, since the engine itself is now inside a namespace, I had to do a lot of changes, such as lua_State to ::lua_State. This way is cleaner, and I just need to add a 'using namespace Lua' where needed.
svn-id: r53198
Diffstat (limited to 'engines/sword25/script/luacallback.cpp')
-rw-r--r-- | engines/sword25/script/luacallback.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/sword25/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp index 7fbbc1457a..37c6d04596 100644 --- a/engines/sword25/script/luacallback.cpp +++ b/engines/sword25/script/luacallback.cpp @@ -39,7 +39,7 @@ #include "sword25/script/luacallback.h" #include "sword25/script/luabindhelper.h" -namespace { +namespace Lua { extern "C" { @@ -59,7 +59,7 @@ namespace Sword25 { // ----------------------------------------------------------------------------- -BS_LuaCallback::BS_LuaCallback(::lua_State *L) { +BS_LuaCallback::BS_LuaCallback(lua_State *L) { // Create callback table lua_newtable(L); lua_setglobal(L, CALLBACKTABLE_NAME); @@ -72,7 +72,7 @@ BS_LuaCallback::~BS_LuaCallback() { // ----------------------------------------------------------------------------- -void BS_LuaCallback::RegisterCallbackFunction(::lua_State *L, unsigned int ObjectHandle) { +void BS_LuaCallback::RegisterCallbackFunction(lua_State *L, unsigned int ObjectHandle) { BS_ASSERT(lua_isfunction(L, -1)); EnsureObjectCallbackTableExists(L, ObjectHandle); @@ -86,7 +86,7 @@ void BS_LuaCallback::RegisterCallbackFunction(::lua_State *L, unsigned int Objec // ----------------------------------------------------------------------------- -void BS_LuaCallback::UnregisterCallbackFunction(::lua_State *L, unsigned int ObjectHandle) { +void BS_LuaCallback::UnregisterCallbackFunction(lua_State *L, unsigned int ObjectHandle) { BS_ASSERT(lua_isfunction(L, -1)); EnsureObjectCallbackTableExists(L,ObjectHandle); @@ -116,7 +116,7 @@ void BS_LuaCallback::UnregisterCallbackFunction(::lua_State *L, unsigned int Obj // ----------------------------------------------------------------------------- -void BS_LuaCallback::RemoveAllObjectCallbacks(::lua_State *L, unsigned int ObjectHandle) { +void BS_LuaCallback::RemoveAllObjectCallbacks(lua_State *L, unsigned int ObjectHandle) { PushCallbackTable(L); // Remove the object callback from the callback table @@ -129,7 +129,7 @@ void BS_LuaCallback::RemoveAllObjectCallbacks(::lua_State *L, unsigned int Objec // ----------------------------------------------------------------------------- -void BS_LuaCallback::InvokeCallbackFunctions(::lua_State *L, unsigned int ObjectHandle) { +void BS_LuaCallback::InvokeCallbackFunctions(lua_State *L, unsigned int ObjectHandle) { EnsureObjectCallbackTableExists(L, ObjectHandle); // Iterate through the table and perform all the callbacks @@ -164,7 +164,7 @@ void BS_LuaCallback::InvokeCallbackFunctions(::lua_State *L, unsigned int Object // ----------------------------------------------------------------------------- -void BS_LuaCallback::EnsureObjectCallbackTableExists(::lua_State *L, unsigned int ObjectHandle) { +void BS_LuaCallback::EnsureObjectCallbackTableExists(lua_State *L, unsigned int ObjectHandle) { PushObjectCallbackTable(L, ObjectHandle); // If the table is nil, it must first be created @@ -187,13 +187,13 @@ void BS_LuaCallback::EnsureObjectCallbackTableExists(::lua_State *L, unsigned in // ----------------------------------------------------------------------------- -void BS_LuaCallback::PushCallbackTable(::lua_State *L) { +void BS_LuaCallback::PushCallbackTable(lua_State *L) { lua_getglobal(L, CALLBACKTABLE_NAME); } // ----------------------------------------------------------------------------- -void BS_LuaCallback::PushObjectCallbackTable(::lua_State *L, unsigned int ObjectHandle) { +void BS_LuaCallback::PushObjectCallbackTable(lua_State *L, unsigned int ObjectHandle) { PushCallbackTable(L); // Push Object Callback table onto the stack |