Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 21, 2008, 5:10:08 PM (16 years ago)
Author:
rgrieder
Message:

Implemented lua and ceguilua as far as it works now with visual studio. Next (not so big) step is to integrate it in CMake (already did the most part).

Location:
code/branches/ceguilua/src
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ceguilua/src/CMakeLists.txt

    r1803 r1804  
    22INCLUDE_DIRECTORIES(..)
    33INCLUDE_DIRECTORIES(orxonox)
    4 INCLUDE_DIRECTORIES(tolua)
     4#INCLUDE_DIRECTORIES(tolua)
    55
    66ADD_SUBDIRECTORY(cpptcl)
    77ADD_SUBDIRECTORY(ois)
    88ADD_SUBDIRECTORY(tinyxml)
     9
     10# This section deals with Lua version problems because CEGUILua scripting
     11# module for CEGUI also uses Lua, but maybe with a different version.
     12# So first, find out what CEGUI version we have.
     13
     14
    915ADD_SUBDIRECTORY(tolua)
    1016
     
    1420ADD_SUBDIRECTORY(network)
    1521ADD_SUBDIRECTORY(orxonox)
    16 
    17 # This section deals with Lua version problems because CEGUILua scripting
    18 # module for CEGUI also uses Lua, but maybe with a different version.
    19 # So first, find out what CEGUI version we have.
  • code/branches/ceguilua/src/ceguilua-0.5.0b/ceguilua/CMakeLists.txt

    r1803 r1804  
    99
    1010ADD_LIBRARY( ceguilua_orxonox SHARED ${LUA_SRC_FILES} )
     11
     12TARGET_LINK_LIBRARIES( ceguilua_orxonox lua_orxonox )
  • code/branches/ceguilua/src/ceguilua-0.6.1/ceguilua/CEGUILua.cpp

    r1803 r1804  
    2828 *   OTHER DEALINGS IN THE SOFTWARE.
    2929 ***************************************************************************/
    30 #ifdef HAVE_CONFIG_H
    31 #   include "config.h"
    32 #endif
    3330
    3431#include "CEGUI.h"
     
    4037
    4138// include Lua libs and tolua++
    42 extern "C" {
    43 #include "lua.h"
    44 #include "lualib.h"
    45 #include "lauxlib.h"
    46 }
    47 
    48 #include "tolua++.h"
     39#include "lua/lua.hpp"
     40#include "tolua/tolua++.h"
    4941
    5042// prototype for bindings initialisation function
     
    6153LuaScriptModule::LuaScriptModule()
    6254{
    63     #if CEGUI_LUA_VER >= 51
    64         static const luaL_Reg lualibs[] = {
    65             {"", luaopen_base},
    66             {LUA_LOADLIBNAME, luaopen_package},
    67             {LUA_TABLIBNAME, luaopen_table},
    68             {LUA_IOLIBNAME, luaopen_io},
    69             {LUA_OSLIBNAME, luaopen_os},
    70             {LUA_STRLIBNAME, luaopen_string},
    71             {LUA_MATHLIBNAME, luaopen_math},
    72         #if defined(DEBUG) || defined (_DEBUG)
    73                 {LUA_DBLIBNAME, luaopen_debug},
    74         #endif
    75             {0, 0}
    76         };
    77     #endif /* CEGUI_LUA_VER >= 51 */
     55    static const luaL_Reg lualibs[] = {
     56        {"", luaopen_base},
     57        {LUA_LOADLIBNAME, luaopen_package},
     58        {LUA_TABLIBNAME, luaopen_table},
     59        {LUA_IOLIBNAME, luaopen_io},
     60        {LUA_OSLIBNAME, luaopen_os},
     61        {LUA_STRLIBNAME, luaopen_string},
     62        {LUA_MATHLIBNAME, luaopen_math},
     63    #if defined(DEBUG) || defined (_DEBUG)
     64        {LUA_DBLIBNAME, luaopen_debug},
     65    #endif
     66        {0, 0}
     67    };
    7868
    7969    // create a lua state
     
    8272
    8373    // init all standard libraries
    84     #if CEGUI_LUA_VER >= 51
    85             const luaL_Reg *lib = lualibs;
    86             for (; lib->func; lib++)
    87             {
    88                 lua_pushcfunction(d_state, lib->func);
    89                 lua_pushstring(d_state, lib->name);
    90                 lua_call(d_state, 1, 0);
    91             }
    92     #else /* CEGUI_LUA_VER >= 51 */
    93         luaopen_base(d_state);
    94         luaopen_io(d_state);
    95         luaopen_string(d_state);
    96         luaopen_table(d_state);
    97         luaopen_math(d_state);
    98         #if defined(DEBUG) || defined (_DEBUG)
    99             luaopen_debug(d_state);
    100         #endif
    101     #endif /* CEGUI_LUA_VER >= 51 */
     74    const luaL_Reg *lib = lualibs;
     75    for (; lib->func; lib++)
     76    {
     77        lua_pushcfunction(d_state, lib->func);
     78        lua_pushstring(d_state, lib->name);
     79        lua_call(d_state, 1, 0);
     80    }
    10281
    10382    setModuleIdentifierString();
  • code/branches/ceguilua/src/ceguilua-0.6.1/ceguilua/CEGUILuaFunctor.cpp

    r1803 r1804  
    3434
    3535// include Lua libs and tolua++
    36 extern "C" {
    37 #include "lua.h"
    38 #include "lualib.h"
    39 #include "lauxlib.h"
    40 }
    41 
    42 #include "tolua++.h"
     36#include "lua/lua.hpp"
     37#include "tolua/tolua++.h"
    4338
    4439// Start of CEGUI namespace section
  • code/branches/ceguilua/src/ceguilua-0.6.1/ceguilua/CMakeLists.txt

    r1803 r1804  
    99
    1010ADD_LIBRARY( ceguilua_orxonox SHARED ${LUA_SRC_FILES} )
     11
     12TARGET_LINK_LIBRARIES( ceguilua_orxonox lua_orxonox )
  • code/branches/ceguilua/src/ceguilua-0.6.1/ceguilua/lua_CEGUI.cpp

    r1803 r1804  
    99#include "string.h"
    1010
    11 #include "tolua++.h"
     11#include "tolua/tolua++.h"
    1212
    1313/* Exported function */
  • code/branches/ceguilua/src/core/CMakeLists.txt

    r1764 r1804  
    6565
    6666TARGET_LINK_LIBRARIES(core
    67   ${Lua_LIBRARIES}
    6867  ${OGRE_LIBRARIES}
    69   cpptcl
     68  lua_orxonox
     69  cpptcl_orxonox
    7070  ois_orxonox
    71   tinyxml
    72   tolualib
     71  tinyxml_orxonox
     72  tolualib_orxonox
    7373  util
    7474  ${Boost_thread_LIBRARIES}
  • code/branches/ceguilua/src/core/Script.cc

    r1755 r1804  
    3434#include "CoreIncludes.h"
    3535
    36 extern "C" {
    37 #include <lualib.h>
    38 #include <lauxlib.h>
    39 }
     36#include "lua/lua.hpp"
    4037
    4138#include "tolua/tolua++.h"
  • code/branches/ceguilua/src/core/Script.h

    r1755 r1804  
    3939
    4040extern "C" {
    41 #include <lua.h>
     41#include "lua/lua.h"
    4242}
    4343
  • code/branches/ceguilua/src/cpptcl/CMakeLists.txt

    r1505 r1804  
    1 ADD_LIBRARY(cpptcl SHARED CppTcl.cc)
     1ADD_LIBRARY(cpptcl_orxonox SHARED CppTcl.cc)
    22
    3 TARGET_LINK_LIBRARIES(cpptcl
     3TARGET_LINK_LIBRARIES(cpptcl_orxonox
    44  ${TCL_LIBRARY}
    55)
  • code/branches/ceguilua/src/orxonox/CMakeLists.txt

    r1755 r1804  
    9797TARGET_LINK_LIBRARIES( orxonox
    9898  ${OGRE_LIBRARIES}
    99   ${Lua_LIBRARIES}
    10099  ${CEGUI_LIBRARIES}
    101100  ${CEGUI_SCRIPT_LIBRARIES}
    102   tinyxml
    103   tolualib
     101  lua_orxonox
     102  tinyxml_orxonox
     103  tolualib_orxonox
    104104  ois_orxonox
    105105  util
  • code/branches/ceguilua/src/orxonox/OrxonoxStableHeaders.h

    r1781 r1804  
    3737#include "util/OrxonoxPlatform.h"
    3838
    39 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && !defined(ORXONOX_DISABLE_PCH) && 0
     39#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && !defined(ORXONOX_DISABLE_PCH)
    4040
    4141// including std headers here is useless since they're already precompiled
  • code/branches/ceguilua/src/orxonox/gui/GUIManager.cc

    r1776 r1804  
    3939#include <OgreRoot.h>
    4040#include <CEGUI.h>
    41 #include <CEGUILua.h>
     41#include "ceguilua/CEGUILua.h"
    4242#include "util/Exception.h"
    4343#include "core/input/InputManager.h"
     
    5050#include "OgreCEGUIRenderer.h"
    5151
    52 extern "C" {
    53 #include <lualib.h>
    54 #include <lauxlib.h>
    55 }
     52#include "lua/lua.hpp"
    5653
    5754namespace orxonox
  • code/branches/ceguilua/src/tinyxml/CMakeLists.txt

    r1505 r1804  
    77)
    88
    9 ADD_LIBRARY(tinyxml SHARED ${TINYXML_SRC_FILES})
     9ADD_LIBRARY(tinyxml_orxonox SHARED ${TINYXML_SRC_FILES})
  • code/branches/ceguilua/src/tolua/CMakeLists.txt

    r1755 r1804  
    77)
    88
    9 ADD_LIBRARY (tolualib SHARED ${TOLUALIB_SRC_FILES})
     9ADD_LIBRARY (tolualib_orxonox SHARED ${TOLUALIB_SRC_FILES})
    1010
    11 TARGET_LINK_LIBRARIES (tolualib
    12   ${Lua_LIBRARIES}
     11TARGET_LINK_LIBRARIES (tolualib_orxonox
     12  lua_orxonox
    1313)
    1414
     
    1919)
    2020
    21 ADD_EXECUTABLE (toluagen ${TOLUAGEN_SRC_FILES})
     21ADD_EXECUTABLE (toluagen_orxonox ${TOLUAGEN_SRC_FILES})
    2222
    23 TARGET_LINK_LIBRARIES (toluagen
    24   ${Lua_LIBRARIES}
    25   tolualib
     23TARGET_LINK_LIBRARIES (toluagen_orxonox
     24  lua_orxonox
     25  tolualib_orxonox
    2626  m
    2727)
     
    3434ENDIF (Lua_VERSION EQUAL 5.0)
    3535
    36 GET_TARGET_PROPERTY(TOLUAGEN_EXE toluagen LOCATION)
     36GET_TARGET_PROPERTY(TOLUAGEN_EXE toluagen_orxonox LOCATION)
    3737ADD_CUSTOM_COMMAND(
    3838  OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/toluabind_orxonox.c
    3939  COMMAND ${TOLUAGEN_EXE} -n tolua -o ../../src/tolua/toluabind_orxonox.c -H ../../src/tolua/toluabind_orxonox.h ${TOLUA_PACKAGE}
    40   DEPENDS toluagen
     40  DEPENDS toluagen_orxonox
    4141  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib
    4242)
     
    4747)
    4848
    49 ADD_EXECUTABLE (tolua ${TOLUAEXE_SRC_FILES})
     49ADD_EXECUTABLE (tolua_orxonox ${TOLUAEXE_SRC_FILES})
    5050
    51 TARGET_LINK_LIBRARIES (tolua
    52   ${Lua_LIBRARIES}
    53   tolualib
     51TARGET_LINK_LIBRARIES (tolua_orxonox
     52  lua_orxonox
     53  tolualib_orxonox
    5454  m
    5555)
  • code/branches/ceguilua/src/tolua/lua/package.lua

    r1755 r1804  
    116116        output('#endif\n')
    117117        output('#include "string.h"\n\n')
    118  output('#include "tolua++.h"\n\n')
     118 output('#include "tolua/tolua++.h"\n\n')
    119119
    120120 if not flags.h then
  • code/branches/ceguilua/src/tolua/tolua++.h

    r1755 r1804  
    6565typedef int lua_Object;
    6666
    67 #include "lua.h"
    68 #include "lauxlib.h"
     67#include "lua/lua.h"
     68#include "lua/lauxlib.h"
    6969
    7070struct tolua_Error
  • code/branches/ceguilua/src/tolua/tolua.c

    r1505 r1804  
    1515#include "tolua++.h"
    1616
    17 #include "lua.h"
    18 #include "lualib.h"
    19 #include "lauxlib.h"
     17#include "lua/lua.h"
     18#include "lua/lualib.h"
     19#include "lua/lauxlib.h"
    2020
    2121#include <stdio.h>
  • code/branches/ceguilua/src/tolua/tolua_is.c

    r1505 r1804  
    1414
    1515#include "tolua++.h"
    16 #include "lauxlib.h"
     16#include "lua/lauxlib.h"
    1717
    1818#include <stdlib.h>
  • code/branches/ceguilua/src/tolua/tolua_map.c

    r1505 r1804  
    1515#include "tolua++.h"
    1616#include "tolua_event.h"
    17 #include "lauxlib.h"
     17#include "lua/lauxlib.h"
    1818
    1919#include <string.h>
  • code/branches/ceguilua/src/tolua/tolua_push.c

    r1505 r1804  
    1414
    1515#include "tolua++.h"
    16 #include "lauxlib.h"
     16#include "lua/lauxlib.h"
    1717
    1818#include <stdlib.h>
Note: See TracChangeset for help on using the changeset viewer.