Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 22, 2008, 4:25:54 PM (16 years ago)
Author:
scheusso
Message:

and here come the other files

Location:
code/branches/network2/src/core
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network2/src/core/CMakeLists.txt

    r1084 r1132  
    1 #get the created files
    2 AUX_SOURCE_DIRECTORY(tolua TOLUA_BIND_FILES)
    3 
    4 SET( CORE_SRC_FILES
     1SET(CORE_SRC_FILES
    52  OrxonoxClass.cc
    63  BaseObject.cc
     
    2926  Tickable.cc
    3027  Script.cc
    31   ${TOLUA_BIND_FILES}
    3228)
    3329
    34 ADD_LIBRARY( core SHARED ${CORE_SRC_FILES})
     30ADD_LIBRARY(core SHARED ${CORE_SRC_FILES})
    3531
    36 TARGET_LINK_LIBRARIES( core
     32TARGET_LINK_LIBRARIES(core
    3733  util
     34  tolualib
    3835  ${Lua_LIBRARIES}
    39   ${Lua_LIBRARY}
    4036  ${OIS_LIBRARIES}
    4137)
  • code/branches/network2/src/core/ConfigFileManager.h

    r1064 r1132  
    6363    {
    6464        public:
     65            virtual ~ConfigFileEntry() {};
    6566            virtual void setValue(const std::string& value) = 0;
    6667            virtual std::string getValue() const = 0;
  • code/branches/network2/src/core/Loader.cc

    r1085 r1132  
    115115        Script::init(Script::getLuaState());
    116116        Script::run();*/
    117         //Script* lua = Script::getInstance();
    118         //lua->loadFile(level->getFile(), true);
    119         //lua->run();
     117        Script* lua = Script::getInstance();
     118        lua->loadFile(level->getFile(), true);
     119        lua->run();
    120120
    121121        try
     
    124124            COUT(3) << "Mask: " << Loader::currentMask_s << std::endl;
    125125
    126             ticpp::Document xmlfile(level->getFile());
    127             xmlfile.LoadFile();
     126            //ticpp::Document xmlfile(level->getFile());
     127            //xmlfile.LoadFile();
    128128            //ticpp::Element myelement(*Script::getFileString());
    129             //ticpp::Document xmlfile;
    130             xmlfile.ToDocument();
    131             //xmlfile.Parse(lua->getLuaOutput(), true);
     129            ticpp::Document xmlfile;
     130            //xmlfile.ToDocument();
     131            xmlfile.Parse(lua->getLuaOutput(), true);
    132132
    133133            ticpp::Element rootElement;
  • code/branches/network2/src/core/Script.cc

    r1076 r1132  
    3939}
    4040
    41 #include "tolua++.h"
     41#include "tolua/tolua++.h"
    4242#include "tolua/tolua_bind.h"
    4343
     
    102102  }
    103103
     104#if LUA_VERSION_NUM != 501
     105  const char * Script::lua_Chunkreader(lua_State *L, void *data, size_t *size)
     106  {
     107    LoadS* ls = ((LoadS*)data);
     108    if (ls->size == 0) return NULL;
     109    *size = ls->size;
     110    ls->size = 0;
     111    return ls->s;
     112  }
     113#endif
    104114  void Script::run()
    105115  {
     
    110120    error = luaL_loadstring(luaState_, init.c_str());
    111121#else
    112     error = lua_load(luaState_, &orxonox::Script::lua_Chunkreader, (void*)init.c_str(), "init");
     122    LoadS ls;
     123    ls.s = init.c_str();
     124    ls.size = init.size();
     125    error = lua_load(luaState_, &orxonox::Script::lua_Chunkreader, &ls, init.c_str());
    113126#endif
    114127    if (error == 0)
  • code/branches/network2/src/core/Script.h

    r1056 r1132  
    5050  class _CoreExport Script // tolua_export
    5151  { // tolua_export
     52    struct LoadS {
     53      const char *s;
     54      size_t size;
     55    };
     56
    5257    public:
    5358      inline static Script* getInstance() { if (!Script::singletonRef) Script::singletonRef = new Script(); return Script::singletonRef; } // tolua_export
     
    6166
    6267#if LUA_VERSION_NUM != 501
    63     inline static const char * lua_Chunkreader(lua_State *L, void *data, size_t *size) { return NULL;};
     68    static const char * lua_Chunkreader(lua_State *L, void *data, size_t *size);
    6469#endif
    6570
Note: See TracChangeset for help on using the changeset viewer.