- Timestamp:
- Oct 20, 2008, 5:53:54 PM (17 years ago)
- Location:
- code/branches/buildsystem/src/ceguilua-0.5.0
- Files:
-
- 2 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem/src/ceguilua-0.5.0/ceguilua/CEGUILua.cpp
r1979 r1980 35 35 36 36 // include Lua libs and tolua++ 37 #include "lua.hpp" 37 extern "C" { 38 #include "lua.h" 39 #include "lualib.h" 40 #include "lauxlib.h" 41 } 42 38 43 #include "tolua++.h" 39 44 … … 51 56 LuaScriptModule::LuaScriptModule() 52 57 { 53 static const luaL_Reg lualibs[] = { 54 {"", luaopen_base}, 55 {LUA_LOADLIBNAME, luaopen_package}, 56 {LUA_TABLIBNAME, luaopen_table}, 57 {LUA_IOLIBNAME, luaopen_io}, 58 {LUA_OSLIBNAME, luaopen_os}, 59 {LUA_STRLIBNAME, luaopen_string}, 60 {LUA_MATHLIBNAME, luaopen_math}, 61 #if defined(DEBUG) || defined (_DEBUG) 62 {LUA_DBLIBNAME, luaopen_debug}, 63 #endif 64 {0, 0} 65 }; 66 67 // create a lua state 68 d_ownsState = true; 69 d_state = lua_open(); 70 71 // init all standard libraries 72 const luaL_Reg *lib = lualibs; 73 for (; lib->func; lib++) 74 { 75 lua_pushcfunction(d_state, lib->func); 76 lua_pushstring(d_state, lib->name); 77 lua_call(d_state, 1, 0); 78 } 79 80 setModuleIdentifierString(); 58 // create a lua state 59 d_ownsState = true; 60 d_state = lua_open(); 61 62 // init all standard libraries 63 luaopen_base(d_state); 64 luaopen_io(d_state); 65 luaopen_string(d_state); 66 luaopen_table(d_state); 67 luaopen_math(d_state); 68 #if defined(DEBUG) || defined (_DEBUG) 69 luaopen_debug(d_state); 70 #endif 71 72 setModuleIdentifierString(); 81 73 } 82 74
Note: See TracChangeset
for help on using the changeset viewer.