aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/script/luabindhelper.h
diff options
context:
space:
mode:
authorPaul Gilbert2010-08-01 09:31:36 +0000
committerEugene Sandulenko2010-10-12 22:18:35 +0000
commit2006e564a1287ff31c2c6acedecf90034e784fd2 (patch)
tree4e1ebb10fedbd39f053691c3cd59b6157c545d37 /engines/sword25/script/luabindhelper.h
parent53a9d2d0a1dab1119dc1cc12886321fa72743061 (diff)
downloadscummvm-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/luabindhelper.h')
-rw-r--r--engines/sword25/script/luabindhelper.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/sword25/script/luabindhelper.h b/engines/sword25/script/luabindhelper.h
index ecc52fd417..6bb1a254b9 100644
--- a/engines/sword25/script/luabindhelper.h
+++ b/engines/sword25/script/luabindhelper.h
@@ -37,7 +37,7 @@
#include "sword25/kernel/common.h"
-namespace {
+namespace Lua {
extern "C"
{
@@ -47,6 +47,8 @@ extern "C"
}
+using namespace Lua;
+
namespace Sword25 {
#define lua_pushbooleancpp(L, b) (lua_pushboolean(L, b ? 1 : 0))
@@ -68,7 +70,7 @@ public:
* The array must be terminated with the enry (0, 0)
* @return Returns true if successful, otherwise false.
*/
- static bool AddFunctionsToLib(::lua_State *L, const Common::String &LibName, const luaL_reg *Functions);
+ static bool AddFunctionsToLib(lua_State *L, const Common::String &LibName, const luaL_reg *Functions);
/**
* Adds a set of constants to the Lua library
@@ -79,7 +81,7 @@ public:
* The array must be terminated with the enry (0, 0)
* @return Returns true if successful, otherwise false.
*/
- static bool AddConstantsToLib(::lua_State * L, const Common::String & LibName, const lua_constant_reg * Constants);
+ static bool AddConstantsToLib(lua_State * L, const Common::String & LibName, const lua_constant_reg * Constants);
/**
* Adds a set of methods to a Lua class
@@ -90,7 +92,7 @@ public:
* The array must be terminated with the enry (0, 0)
* @return Returns true if successful, otherwise false.
*/
- static bool AddMethodsToClass(::lua_State *L, const Common::String &ClassName, const luaL_reg *Methods);
+ static bool AddMethodsToClass(lua_State *L, const Common::String &ClassName, const luaL_reg *Methods);
/**
* Sets the garbage collector callback method when items of a particular class are deleted
@@ -100,25 +102,25 @@ public:
* @param GCHandler A function pointer
* @return Returns true if successful, otherwise false.
*/
- static bool SetClassGCHandler(::lua_State *L, const Common::String &ClassName, lua_CFunction GCHandler);
+ static bool SetClassGCHandler(lua_State *L, const Common::String &ClassName, lua_CFunction GCHandler);
/**
* Returns a string containing a stack dump of the Lua stack
* @param L A pointer to the Lua VM
*/
- static Common::String StackDump(::lua_State *L);
+ static Common::String StackDump(lua_State *L);
/**
* Returns a string that describes the contents of a table
* @param L A pointer to the Lua VM
* @remark The table must be on the Lua stack to be read out.
*/
- static Common::String TableDump(::lua_State *L);
+ static Common::String TableDump(lua_State *L);
- static bool GetMetatable(::lua_State *L, const Common::String &TableName);
+ static bool GetMetatable(lua_State *L, const Common::String &TableName);
private:
- static bool _CreateTable(::lua_State *L, const Common::String &TableName);
+ static bool _CreateTable(lua_State *L, const Common::String &TableName);
};
} // End of namespace Sword25