Daniele Bartolini 9 lat temu
rodzic
commit
6cd5ce28fd
3 zmienionych plików z 11 dodań i 11 usunięć
  1. 8 8
      src/lua/lua_api.cpp
  2. 2 2
      src/world/render_world.cpp
  3. 1 1
      src/world/render_world.h

+ 8 - 8
src/lua/lua_api.cpp

@@ -1913,6 +1913,13 @@ static int render_world_light_spot_angle(lua_State* L)
 	return 1;
 }
 
+static int render_world_light_debug_draw(lua_State* L)
+{
+	LuaStack stack(L);
+	stack.get_render_world(1)->light_debug_draw(stack.get_light_instance(2), *stack.get_debug_line(3));
+	return 0;
+}
+
 static int render_world_set_light_type(lua_State* L)
 {
 	LuaStack stack(L);
@@ -1953,13 +1960,6 @@ static int render_world_set_light_spot_angle(lua_State* L)
 	return 0;
 }
 
-static int render_world_debug_draw_light(lua_State* L)
-{
-	LuaStack stack(L);
-	stack.get_render_world(1)->debug_draw_light(stack.get_light_instance(2), *stack.get_debug_line(3));
-	return 0;
-}
-
 static int render_world_enable_debug_drawing(lua_State* L)
 {
 	LuaStack stack(L);
@@ -3270,12 +3270,12 @@ void load_api(LuaEnvironment& env)
 	env.add_module_function("RenderWorld", "light_range",          render_world_light_range);
 	env.add_module_function("RenderWorld", "light_intensity",      render_world_light_intensity);
 	env.add_module_function("RenderWorld", "light_spot_angle",     render_world_light_spot_angle);
+	env.add_module_function("RenderWorld", "light_debug_draw",     render_world_light_debug_draw);
 	env.add_module_function("RenderWorld", "set_light_type",       render_world_set_light_type);
 	env.add_module_function("RenderWorld", "set_light_color",      render_world_set_light_color);
 	env.add_module_function("RenderWorld", "set_light_range",      render_world_set_light_range);
 	env.add_module_function("RenderWorld", "set_light_intensity",  render_world_set_light_intensity);
 	env.add_module_function("RenderWorld", "set_light_spot_angle", render_world_set_light_spot_angle);
-	env.add_module_function("RenderWorld", "debug_draw_light",     render_world_debug_draw_light);
 	env.add_module_function("RenderWorld", "enable_debug_drawing", render_world_enable_debug_drawing);
 
 	env.add_module_function("PhysicsWorld", "actor_instances",               physics_world_actor_instances);

+ 2 - 2
src/world/render_world.cpp

@@ -293,7 +293,7 @@ void RenderWorld::render(const Matrix4x4& view, const Matrix4x4& projection)
 	}
 }
 
-void RenderWorld::debug_draw_light(LightInstance i, DebugLine& dl)
+void RenderWorld::light_debug_draw(LightInstance i, DebugLine& dl)
 {
 	LightManager::LightInstanceData& lid = _light_manager._data;
 
@@ -347,7 +347,7 @@ void RenderWorld::debug_draw(DebugLine& dl)
 	}
 
 	for (u32 i = 0; i < lid.size; ++i)
-		debug_draw_light({ i }, dl);
+		light_debug_draw({ i }, dl);
 }
 
 void RenderWorld::enable_debug_drawing(bool enable)

+ 1 - 1
src/world/render_world.h

@@ -110,7 +110,7 @@ public:
 	void enable_debug_drawing(bool enable);
 
 	/// Fills @a dl with debug lines from light @a i.
-	void debug_draw_light(LightInstance i, DebugLine& dl);
+	void light_debug_draw(LightInstance i, DebugLine& dl);
 
 	/// Fills @a dl with debug lines
 	void debug_draw(DebugLine& dl);