Changeset 8385 in orxonox.OLD for branches/script_engine/src
- Timestamp:
- Jun 14, 2006, 2:21:59 PM (18 years ago)
- Location:
- branches/script_engine/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/lunar.h
r8271 r8385 172 172 static int new_T(lua_State *L) { 173 173 lua_remove(L, 1); // use classname:new(), instead of classname.new() 174 T *obj = new T( L); // call constructor for T objects174 T *obj = new T(); // call constructor for T objects 175 175 push(L, obj, true); // gc_T will delete this object 176 176 return 1; // userdata containing pointer to T object -
branches/script_engine/src/lib/script_engine/script_manager.cc
r8289 r8385 38 38 void ScriptManager::loadParams(const TiXmlElement* root) 39 39 { 40 //BaseObject::loadParams(root);40 BaseObject::loadParams(root); 41 41 { 42 42 LoadParamXML(root, "Scripts", this, ScriptManager, createScripts); -
branches/script_engine/src/lib/util/executor/executor_lua.cc
r8271 r8385 20 20 std::string temp; 21 21 22 template<typename type> type* fromLua(lua_State* state, int index) { type *obj = Lunar<type>::check(state, 1); return obj;}; 22 23 template<> bool fromLua<bool>(lua_State* state, int index) { return lua_toboolean(state, index); }; 23 24 template<> int fromLua<int>(lua_State* state, int index) { return (int)lua_tonumber(state, index); }; … … 28 29 29 30 30 31 template<typename type> void toLua(lua_State* state, type value) { Lunar<type>::push(state, value, false); }; 31 32 template<> void toLua<bool>(lua_State* state, bool value) { lua_pushboolean(state, (int) value); }; 32 33 template<> 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 11 11 #include "debug.h" 12 12 #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 17 template<typename type> type fromLua(lua_State* state, int index); 17 18 template<> bool fromLua<bool>(lua_State* state, int index); 18 19 template<> int fromLua<int>(lua_State* state, int index); … … 23 24 24 25 25 template<typename type> void toLua(lua_State* state, type value) { PRINTF(1)("NOT IMPLEMENTED\n"); };26 template<typename type> void toLua(lua_State* state, type value); 26 27 template<> void toLua<bool>(lua_State* state, bool value); 27 28 template<> void toLua<int>(lua_State* state, int value); -
branches/script_engine/src/story_entities/game_world.cc
r8303 r8385 186 186 this->dataXML = (TiXmlElement*)root->Clone(); 187 187 188 188 //remove this after finished testing !!!! 189 189 Object* obj= new Object(); 190 190 obj->setName("Obj"); … … 193 193 Account *b = new Account(30); 194 194 b->setName("b"); 195 printf("ScriptManager created by game world\n"); 195 196 196 197 LoadParamXML(root, "ScriptManager", &this->scriptManager, ScriptManager, loadParams); 197 198 -
branches/script_engine/src/world_entities/space_ships/helicopter.cc
r8255 r8385 35 35 36 36 CREATE_FACTORY(Helicopter, CL_HELICOPTER); 37 38 //CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER); 39 37 40 38 41 /**
Note: See TracChangeset
for help on using the changeset viewer.