Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8385 in orxonox.OLD


Ignore:
Timestamp:
Jun 14, 2006, 2:21:59 PM (18 years ago)
Author:
snellen
Message:

executor_lua shuould now be able to handle orxonox objects

Location:
branches/script_engine/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/script_engine/lunar.h

    r8271 r8385  
    172172      static int new_T(lua_State *L) {
    173173        lua_remove(L, 1);   // use classname:new(), instead of classname.new()
    174         T *obj = new T(L);  // call constructor for T objects
     174        T *obj = new T();  // call constructor for T objects
    175175        push(L, obj, true); // gc_T will delete this object
    176176        return 1;           // userdata containing pointer to T object
  • branches/script_engine/src/lib/script_engine/script_manager.cc

    r8289 r8385  
    3838void ScriptManager::loadParams(const TiXmlElement* root)
    3939{
    40   //BaseObject::loadParams(root);
     40  BaseObject::loadParams(root);
    4141  {
    4242    LoadParamXML(root, "Scripts", this, ScriptManager, createScripts);
  • branches/script_engine/src/lib/util/executor/executor_lua.cc

    r8271 r8385  
    2020std::string temp;
    2121
     22template<typename type> type* fromLua(lua_State* state, int index) { type *obj = Lunar<type>::check(state, 1); return obj;};
    2223template<> bool fromLua<bool>(lua_State* state, int index) { return lua_toboolean(state, index); };
    2324template<> int fromLua<int>(lua_State* state, int index) { return (int)lua_tonumber(state, index); };
     
    2829
    2930
    30 
     31template<typename type> void toLua(lua_State* state, type value) { Lunar<type>::push(state, value, false); };
    3132template<> void toLua<bool>(lua_State* state, bool value) { lua_pushboolean(state, (int) value); };
    3233template<> void toLua<int>(lua_State* state, int value)  { lua_pushnumber(state, (lua_Number) value); };
  • branches/script_engine/src/lib/util/executor/executor_lua.h

    r8271 r8385  
    1111#include "debug.h"
    1212#include "luaincl.h"
    13 
    14 
    15 
    16 template<typename type> type fromLua(lua_State* state, int index) { PRINTF(1)("NOT IMPLEMENTED\n"); };
     13#include "lunar.h"
     14
     15
     16
     17template<typename type> type fromLua(lua_State* state, int index);
    1718template<> bool fromLua<bool>(lua_State* state, int index);
    1819template<> int fromLua<int>(lua_State* state, int index);
     
    2324
    2425
    25 template<typename type> void toLua(lua_State* state, type value) { PRINTF(1)("NOT IMPLEMENTED\n"); };
     26template<typename type> void toLua(lua_State* state, type value);
    2627template<> void toLua<bool>(lua_State* state, bool value);
    2728template<> void toLua<int>(lua_State* state, int value);
  • branches/script_engine/src/story_entities/game_world.cc

    r8303 r8385  
    186186  this->dataXML = (TiXmlElement*)root->Clone();
    187187
    188 
     188  //remove this after finished testing !!!!
    189189  Object* obj= new Object();
    190190  obj->setName("Obj");
     
    193193  Account *b = new Account(30);
    194194  b->setName("b");
    195   printf("ScriptManager created by game world\n");
     195 
     196 
    196197  LoadParamXML(root, "ScriptManager", &this->scriptManager, ScriptManager, loadParams);
    197198
  • branches/script_engine/src/world_entities/space_ships/helicopter.cc

    r8255 r8385  
    3535
    3636CREATE_FACTORY(Helicopter, CL_HELICOPTER);
     37
     38//CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER);
     39
    3740
    3841/**
Note: See TracChangeset for help on using the changeset viewer.