소스 검색

lua: cleanup

Daniele Bartolini 4 달 전
부모
커밋
be0b9782bb
4개의 변경된 파일38개의 추가작업 그리고 214개의 파일을 삭제
  1. 35 35
      src/lua/lua_api.cpp
  2. 0 66
      src/lua/lua_stack.h
  3. 1 111
      src/lua/lua_stack.inl
  4. 2 2
      src/world/script_world.cpp

+ 35 - 35
src/lua/lua_api.cpp

@@ -1531,7 +1531,7 @@ void load_api(LuaEnvironment &env)
 			cd.near_range = stack.get_float(5);
 			cd.near_range = stack.get_float(5);
 			cd.far_range  = stack.get_float(6);
 			cd.far_range  = stack.get_float(6);
 
 
-			stack.push_camera(world->camera_create(unit, cd));
+			stack.push_id(world->camera_create(unit, cd).i);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "camera_destroy", [](lua_State *L) {
 	env.add_module_function("World", "camera_destroy", [](lua_State *L) {
@@ -1543,7 +1543,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			CameraInstance inst = stack.get_world(1)->camera_instance(stack.get_unit(2));
 			CameraInstance inst = stack.get_world(1)->camera_instance(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_camera(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -1690,7 +1690,7 @@ void load_api(LuaEnvironment &env)
 		});
 		});
 	env.add_module_function("World", "create_debug_line", [](lua_State *L) {
 	env.add_module_function("World", "create_debug_line", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_debug_line(stack.get_world(1)->create_debug_line(stack.get_bool(2)));
+			stack.push_pointer(stack.get_world(1)->create_debug_line(stack.get_bool(2)));
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "destroy_debug_line", [](lua_State *L) {
 	env.add_module_function("World", "destroy_debug_line", [](lua_State *L) {
@@ -1700,12 +1700,12 @@ void load_api(LuaEnvironment &env)
 		});
 		});
 	env.add_module_function("World", "create_screen_gui", [](lua_State *L) {
 	env.add_module_function("World", "create_screen_gui", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_gui(stack.get_world(1)->create_screen_gui());
+			stack.push_pointer(stack.get_world(1)->create_screen_gui());
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "create_world_gui", [](lua_State *L) {
 	env.add_module_function("World", "create_world_gui", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_gui(stack.get_world(1)->create_world_gui());
+			stack.push_pointer(stack.get_world(1)->create_world_gui());
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "destroy_gui", [](lua_State *L) {
 	env.add_module_function("World", "destroy_gui", [](lua_State *L) {
@@ -1741,32 +1741,32 @@ void load_api(LuaEnvironment &env)
 				);
 				);
 			CE_UNUSED(name_str);
 			CE_UNUSED(name_str);
 
 
-			stack.push_level(world->load_level(name, flags, pos, rot));
+			stack.push_pointer(world->load_level(name, flags, pos, rot));
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "scene_graph", [](lua_State *L) {
 	env.add_module_function("World", "scene_graph", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_scene_graph(stack.get_world(1)->_scene_graph);
+			stack.push_pointer(stack.get_world(1)->_scene_graph);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "render_world", [](lua_State *L) {
 	env.add_module_function("World", "render_world", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_render_world(stack.get_world(1)->_render_world);
+			stack.push_pointer(stack.get_world(1)->_render_world);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "physics_world", [](lua_State *L) {
 	env.add_module_function("World", "physics_world", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_physics_world(stack.get_world(1)->_physics_world);
+			stack.push_pointer(stack.get_world(1)->_physics_world);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "sound_world", [](lua_State *L) {
 	env.add_module_function("World", "sound_world", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_sound_world(stack.get_world(1)->_sound_world);
+			stack.push_pointer(stack.get_world(1)->_sound_world);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "animation_state_machine", [](lua_State *L) {
 	env.add_module_function("World", "animation_state_machine", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_animation_state_machine(stack.get_world(1)->_animation_state_machine);
+			stack.push_pointer(stack.get_world(1)->_animation_state_machine);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("World", "disable_unit_callbacks", [](lua_State *L) {
 	env.add_module_function("World", "disable_unit_callbacks", [](lua_State *L) {
@@ -1791,7 +1791,7 @@ void load_api(LuaEnvironment &env)
 				, stack.get_quaternion(4)
 				, stack.get_quaternion(4)
 				, stack.get_vector3(5)
 				, stack.get_vector3(5)
 				);
 				);
-			stack.push_transform(ti);
+			stack.push_id(ti.i);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("SceneGraph", "destroy", [](lua_State *L) {
 	env.add_module_function("SceneGraph", "destroy", [](lua_State *L) {
@@ -1803,7 +1803,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			TransformInstance inst = stack.get_scene_graph(1)->instance(stack.get_unit(2));
 			TransformInstance inst = stack.get_scene_graph(1)->instance(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_transform(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -1891,7 +1891,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			TransformInstance inst = stack.get_scene_graph(1)->parent(stack.get_transform_instance(2));
 			TransformInstance inst = stack.get_scene_graph(1)->parent(stack.get_transform_instance(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_transform(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -1900,7 +1900,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			TransformInstance inst = stack.get_scene_graph(1)->first_child(stack.get_transform_instance(2));
 			TransformInstance inst = stack.get_scene_graph(1)->first_child(stack.get_transform_instance(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_transform(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -1909,7 +1909,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			TransformInstance inst = stack.get_scene_graph(1)->next_sibling(stack.get_transform_instance(2));
 			TransformInstance inst = stack.get_scene_graph(1)->next_sibling(stack.get_transform_instance(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_transform(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -1944,7 +1944,7 @@ void load_api(LuaEnvironment &env)
 			desc.flags |= RenderableFlags::SHADOW_CASTER;
 			desc.flags |= RenderableFlags::SHADOW_CASTER;
 			desc.flags |= stack.get_bool(6) ? RenderableFlags::VISIBLE : 0u;
 			desc.flags |= stack.get_bool(6) ? RenderableFlags::VISIBLE : 0u;
 
 
-			stack.push_mesh_instance(rw->mesh_create(unit, desc));
+			stack.push_id(rw->mesh_create(unit, desc).i);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("RenderWorld", "mesh_destroy", [](lua_State *L) {
 	env.add_module_function("RenderWorld", "mesh_destroy", [](lua_State *L) {
@@ -1956,7 +1956,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			MeshInstance inst = stack.get_render_world(1)->mesh_instance(stack.get_unit(2));
 			MeshInstance inst = stack.get_render_world(1)->mesh_instance(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_mesh_instance(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 
 
@@ -2018,7 +2018,7 @@ void load_api(LuaEnvironment &env)
 			desc.flags = 0u;
 			desc.flags = 0u;
 			desc.flags |= stack.get_bool(7) ? RenderableFlags::VISIBLE : 0u;
 			desc.flags |= stack.get_bool(7) ? RenderableFlags::VISIBLE : 0u;
 
 
-			stack.push_sprite_instance(rw->sprite_create(unit, desc));
+			stack.push_id(rw->sprite_create(unit, desc).i);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("RenderWorld", "sprite_destroy", [](lua_State *L) {
 	env.add_module_function("RenderWorld", "sprite_destroy", [](lua_State *L) {
@@ -2030,7 +2030,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			SpriteInstance inst = stack.get_render_world(1)->sprite_instance(stack.get_unit(2));
 			SpriteInstance inst = stack.get_render_world(1)->sprite_instance(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_sprite_instance(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -2118,7 +2118,7 @@ void load_api(LuaEnvironment &env)
 			ld.spot_angle = stack.get_float(6);
 			ld.spot_angle = stack.get_float(6);
 			ld.color      = stack.get_vector3(7);
 			ld.color      = stack.get_vector3(7);
 
 
-			stack.push_light_instance(stack.get_render_world(1)->light_create(stack.get_unit(2), ld));
+			stack.push_id(stack.get_render_world(1)->light_create(stack.get_unit(2), ld).i);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("RenderWorld", "light_destroy", [](lua_State *L) {
 	env.add_module_function("RenderWorld", "light_destroy", [](lua_State *L) {
@@ -2130,7 +2130,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			LightInstance inst = stack.get_render_world(1)->light_instance(stack.get_unit(2));
 			LightInstance inst = stack.get_render_world(1)->light_instance(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_light_instance(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -2214,7 +2214,7 @@ void load_api(LuaEnvironment &env)
 	env.add_module_function("RenderWorld", "fog_create", [](lua_State *L) {
 	env.add_module_function("RenderWorld", "fog_create", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
 			FogDesc fd;
 			FogDesc fd;
-			stack.push_fog_instance(stack.get_render_world(1)->fog_create(stack.get_unit(2), fd));
+			stack.push_id(stack.get_render_world(1)->fog_create(stack.get_unit(2), fd).i);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("RenderWorld", "fog_destroy", [](lua_State *L) {
 	env.add_module_function("RenderWorld", "fog_destroy", [](lua_State *L) {
@@ -2226,7 +2226,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			FogInstance inst = stack.get_render_world(1)->fog_instance(stack.get_unit(2));
 			FogInstance inst = stack.get_render_world(1)->fog_instance(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_fog_instance(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -2386,7 +2386,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			ActorInstance inst = stack.get_physics_world(1)->actor(stack.get_unit(2));
 			ActorInstance inst = stack.get_physics_world(1)->actor(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_actor(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -2560,7 +2560,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			MoverInstance inst = stack.get_physics_world(1)->mover(stack.get_unit(2));
 			MoverInstance inst = stack.get_physics_world(1)->mover(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_mover(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -2576,7 +2576,7 @@ void load_api(LuaEnvironment &env)
 			desc.max_slope_angle = stack.get_float(5);
 			desc.max_slope_angle = stack.get_float(5);
 			desc.collision_filter = stack.get_string_id_32(6);
 			desc.collision_filter = stack.get_string_id_32(6);
 
 
-			stack.push_mover(pw->mover_create(unit, &desc));
+			stack.push_id(pw->mover_create(unit, &desc).i);
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("PhysicsWorld", "mover_destroy", [](lua_State *L) {
 	env.add_module_function("PhysicsWorld", "mover_destroy", [](lua_State *L) {
@@ -2672,7 +2672,7 @@ void load_api(LuaEnvironment &env)
 				stack.push_vector3(hit.normal);
 				stack.push_vector3(hit.normal);
 				stack.push_float(hit.time);
 				stack.push_float(hit.time);
 				stack.push_unit(hit.unit);
 				stack.push_unit(hit.unit);
-				stack.push_actor(hit.actor);
+				stack.push_id(hit.actor.i);
 				return 6;
 				return 6;
 			}
 			}
 
 
@@ -2713,7 +2713,7 @@ void load_api(LuaEnvironment &env)
 						stack.push_key_end();
 						stack.push_key_end();
 
 
 						stack.push_key_begin(5);
 						stack.push_key_begin(5);
-						stack.push_actor(hits[i].actor);
+						stack.push_id(hits[i].actor.i);
 						stack.push_key_end();
 						stack.push_key_end();
 					}
 					}
 					stack.push_key_end();
 					stack.push_key_end();
@@ -2737,7 +2737,7 @@ void load_api(LuaEnvironment &env)
 				stack.push_vector3(hit.normal);
 				stack.push_vector3(hit.normal);
 				stack.push_float(hit.time);
 				stack.push_float(hit.time);
 				stack.push_unit(hit.unit);
 				stack.push_unit(hit.unit);
-				stack.push_actor(hit.actor);
+				stack.push_id(hit.actor.i);
 				return 6;
 				return 6;
 			}
 			}
 
 
@@ -2759,7 +2759,7 @@ void load_api(LuaEnvironment &env)
 				stack.push_vector3(hit.normal);
 				stack.push_vector3(hit.normal);
 				stack.push_float(hit.time);
 				stack.push_float(hit.time);
 				stack.push_unit(hit.unit);
 				stack.push_unit(hit.unit);
-				stack.push_actor(hit.actor);
+				stack.push_id(hit.actor.i);
 				return 6;
 				return 6;
 			}
 			}
 
 
@@ -2814,7 +2814,7 @@ void load_api(LuaEnvironment &env)
 			LuaStack stack(L);
 			LuaStack stack(L);
 			StateMachineInstance inst = stack.get_animation_state_machine(1)->instance(stack.get_unit(2));
 			StateMachineInstance inst = stack.get_animation_state_machine(1)->instance(stack.get_unit(2));
 			if (is_valid(inst))
 			if (is_valid(inst))
-				stack.push_state_machine_instance(inst);
+				stack.push_id(inst.i);
 			else
 			else
 				stack.push_nil();
 				stack.push_nil();
 			return 1;
 			return 1;
@@ -2897,7 +2897,7 @@ void load_api(LuaEnvironment &env)
 		});
 		});
 	env.add_module_function("Device", "create_world", [](lua_State *L) {
 	env.add_module_function("Device", "create_world", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_world(device()->create_world());
+			stack.push_pointer(device()->create_world());
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("Device", "destroy_world", [](lua_State *L) {
 	env.add_module_function("Device", "destroy_world", [](lua_State *L) {
@@ -2912,7 +2912,7 @@ void load_api(LuaEnvironment &env)
 		});
 		});
 	env.add_module_function("Device", "create_resource_package", [](lua_State *L) {
 	env.add_module_function("Device", "create_resource_package", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_resource_package(device()->create_resource_package(stack.get_resource_name(1)));
+			stack.push_pointer(device()->create_resource_package(stack.get_resource_name(1)));
 			return 1;
 			return 1;
 		});
 		});
 	env.add_module_function("Device", "destroy_resource_package", [](lua_State *L) {
 	env.add_module_function("Device", "destroy_resource_package", [](lua_State *L) {
@@ -3301,7 +3301,7 @@ void load_api(LuaEnvironment &env)
 		});
 		});
 	env.add_module_function("Gui", "material", [](lua_State *L) {
 	env.add_module_function("Gui", "material", [](lua_State *L) {
 			LuaStack stack(L);
 			LuaStack stack(L);
-			stack.push_material(stack.get_gui(1)->material(stack.get_resource_name(2)));
+			stack.push_pointer(stack.get_gui(1)->material(stack.get_resource_name(2)));
 			return 1;
 			return 1;
 		});
 		});
 
 

+ 0 - 66
src/lua/lua_stack.h

@@ -281,78 +281,12 @@ struct LuaStack
 	///
 	///
 	int next(int i);
 	int next(int i);
 
 
-	///
-	void push_gui(Gui *dg);
-
-	///
-	void push_debug_line(DebugLine *line);
-
-	///
-	void push_resource_package(ResourcePackage *package);
-
-	///
-	void push_world(World *world);
-
-	///
-	void push_scene_graph(SceneGraph *sg);
-
-	///
-	void push_level(Level *level);
-
-	///
-	void push_render_world(RenderWorld *world);
-
-	///
-	void push_physics_world(PhysicsWorld *world);
-
-	///
-	void push_sound_world(SoundWorld *world);
-
-	///
-	void push_script_world(ScriptWorld *world);
-
-	///
-	void push_animation_state_machine(AnimationStateMachine *sm);
-
 	///
 	///
 	void push_unit(UnitId unit);
 	void push_unit(UnitId unit);
 
 
-	///
-	void push_camera(CameraInstance i);
-
-	///
-	void push_transform(TransformInstance i);
-
-	///
-	void push_mesh_instance(MeshInstance i);
-
-	///
-	void push_sprite_instance(SpriteInstance i);
-
-	///
-	void push_light_instance(LightInstance i);
-
-	///
-	void push_fog_instance(FogInstance i);
-
-	///
-	void push_state_machine_instance(StateMachineInstance i);
-
-	///
-	void push_material(Material *material);
-
-	///
-	void push_actor(ActorInstance i);
-
-	///
-	void push_mover(MoverInstance i);
-
 	///
 	///
 	void push_sound_instance_id(SoundInstanceId id);
 	void push_sound_instance_id(SoundInstanceId id);
 
 
-	///
-	void push_script_instance(ScriptInstance i);
-
 	///
 	///
 	void push_vector2(const Vector2 &v);
 	void push_vector2(const Vector2 &v);
 
 

+ 1 - 111
src/lua/lua_stack.inl

@@ -499,125 +499,15 @@ inline int LuaStack::next(int i)
 	return lua_next(L, i);
 	return lua_next(L, i);
 }
 }
 
 
-inline void LuaStack::push_gui(Gui *dg)
-{
-	push_pointer(dg);
-}
-
-inline void LuaStack::push_debug_line(DebugLine *line)
-{
-	push_pointer(line);
-}
-
-inline void LuaStack::push_resource_package(ResourcePackage *package)
-{
-	push_pointer(package);
-}
-
-inline void LuaStack::push_world(World *world)
-{
-	push_pointer(world);
-}
-
-inline void LuaStack::push_scene_graph(SceneGraph *sg)
-{
-	push_pointer(sg);
-}
-
-inline void LuaStack::push_level(Level *level)
-{
-	push_pointer(level);
-}
-
-inline void LuaStack::push_render_world(RenderWorld *world)
-{
-	push_pointer(world);
-}
-
-inline void LuaStack::push_physics_world(PhysicsWorld *world)
-{
-	push_pointer(world);
-}
-
-inline void LuaStack::push_sound_world(SoundWorld *world)
-{
-	push_pointer(world);
-}
-
-inline void LuaStack::push_script_world(ScriptWorld *world)
-{
-	push_pointer(world);
-}
-
-inline void LuaStack::push_animation_state_machine(AnimationStateMachine *sm)
-{
-	push_pointer(sm);
-}
-
 inline void LuaStack::push_unit(UnitId unit)
 inline void LuaStack::push_unit(UnitId unit)
 {
 {
 	uintptr_t enc = (uintptr_t(unit._idx) << LIGHTDATA_UNIT_ID_SHIFT) | LIGHTDATA_UNIT_MARKER;
 	uintptr_t enc = (uintptr_t(unit._idx) << LIGHTDATA_UNIT_ID_SHIFT) | LIGHTDATA_UNIT_MARKER;
 	push_pointer((void *)enc);
 	push_pointer((void *)enc);
 }
 }
 
 
-inline void LuaStack::push_camera(CameraInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_transform(TransformInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_mesh_instance(MeshInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_sprite_instance(SpriteInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_light_instance(LightInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_fog_instance(FogInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_state_machine_instance(StateMachineInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_material(Material *material)
-{
-	push_pointer(material);
-}
-
-inline void LuaStack::push_actor(ActorInstance i)
-{
-	push_id(i.i);
-}
-
-inline void LuaStack::push_mover(MoverInstance i)
-{
-	push_id(i.i);
-}
-
 inline void LuaStack::push_sound_instance_id(SoundInstanceId id)
 inline void LuaStack::push_sound_instance_id(SoundInstanceId id)
 {
 {
-	push_id(id);
-}
-
-inline void LuaStack::push_script_instance(ScriptInstance i)
-{
-	push_id(i.i);
+	lua_pushnumber(L, id);
 }
 }
 
 
 inline void LuaStack::push_vector2(const Vector2 &v)
 inline void LuaStack::push_vector2(const Vector2 &v)

+ 2 - 2
src/world/script_world.cpp

@@ -147,7 +147,7 @@ namespace script_world
 					if (!lua_isnil(stack.L, -1)) {
 					if (!lua_isnil(stack.L, -1)) {
 						stack.push_unit(ev.units[1 - unit_index]);
 						stack.push_unit(ev.units[1 - unit_index]);
 						stack.push_unit(ev.units[unit_index]);
 						stack.push_unit(ev.units[unit_index]);
-						stack.push_actor(ev.actors[unit_index]);
+						stack.push_id(ev.actors[unit_index].i);
 						stack.push_vector3(ev.position);
 						stack.push_vector3(ev.position);
 						stack.push_vector3(ev.normal);
 						stack.push_vector3(ev.normal);
 						stack.push_float(ev.distance);
 						stack.push_float(ev.distance);
@@ -165,7 +165,7 @@ namespace script_world
 					if (!lua_isnil(stack.L, -1)) {
 					if (!lua_isnil(stack.L, -1)) {
 						stack.push_unit(ev.units[1 - unit_index]);
 						stack.push_unit(ev.units[1 - unit_index]);
 						stack.push_unit(ev.units[unit_index]);
 						stack.push_unit(ev.units[unit_index]);
-						stack.push_actor(ev.actors[unit_index]);
+						stack.push_id(ev.actors[unit_index].i);
 						stack.push_vector3(ev.position);
 						stack.push_vector3(ev.position);
 						stack.push_vector3(ev.normal);
 						stack.push_vector3(ev.normal);
 						stack.push_float(ev.distance);
 						stack.push_float(ev.distance);