Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 29, 2009, 8:13:22 PM (15 years ago)
Author:
rgrieder
Message:

Large cleanup in CEGUILua:

  • Removed the heavy 1.7MB bind files and added the small pkg files from the CEGUI source instead
  • Those pkg files get copied version incrementally (starting with 0.5.0) to the binary dir. That saves a lot of files when having 4 different versions.
  • Added support for CEGUI 0.6.0 and 0.6.2
  • Added library info files
  • CEGUILua 0.5.0 finally supports Lua 5.1 too That means all version support both Lua 5.0 and 5.1
  • Added unified diffs with the changes to the CEGUILua source
Location:
code/branches/buildsystem2/src/ceguilua
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.5.0/ceguilua/CEGUILua.cpp

    r2509 r2608  
    4141}
    4242
    43 #include "tolua++.h"
     43#include "tolua/tolua++.h"
    4444
    4545// prototype for bindings initialisation function
     
    5656LuaScriptModule::LuaScriptModule()
    5757{
     58    #if LUA_VERSION_NUM >= 501
     59        static const luaL_Reg lualibs[] = {
     60            {"", luaopen_base},
     61            {LUA_LOADLIBNAME, luaopen_package},
     62            {LUA_TABLIBNAME, luaopen_table},
     63            {LUA_IOLIBNAME, luaopen_io},
     64            {LUA_OSLIBNAME, luaopen_os},
     65            {LUA_STRLIBNAME, luaopen_string},
     66            {LUA_MATHLIBNAME, luaopen_math},
     67        #if defined(DEBUG) || defined (_DEBUG)
     68                {LUA_DBLIBNAME, luaopen_debug},
     69        #endif
     70            {0, 0}
     71        };
     72    #endif /* LUA_VERSION_NUM >= 501 */
     73
    5874        // create a lua state
    5975        d_ownsState = true;
     
    6177
    6278        // 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
     79    #if LUA_VERSION_NUM >= 501
     80            const luaL_Reg *lib = lualibs;
     81            for (; lib->func; lib++)
     82            {
     83                lua_pushcfunction(d_state, lib->func);
     84                lua_pushstring(d_state, lib->name);
     85                lua_call(d_state, 1, 0);
     86            }
     87    #else /* LUA_VERSION_NUM >= 501 */
     88            luaopen_base(d_state);
     89            luaopen_io(d_state);
     90            luaopen_string(d_state);
     91            luaopen_table(d_state);
     92            luaopen_math(d_state);
     93        #if defined(DEBUG) || defined (_DEBUG)
     94                luaopen_debug(d_state);
     95        #endif
     96    #endif /* LUA_VERSION_NUM >= 501 */
    7197
    7298        setModuleIdentifierString();
Note: See TracChangeset for help on using the changeset viewer.