Daniele Bartolini 12 лет назад
Родитель
Сommit
de3e49632f
2 измененных файлов с 4 добавлено и 12 удалено
  1. 2 5
      engine/renderers/DebugLine.cpp
  2. 2 7
      engine/renderers/DebugLine.h

+ 2 - 5
engine/renderers/DebugLine.cpp

@@ -30,12 +30,11 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Vector3.h"
 #include "Device.h"
 #include "Renderer.h"
+#include "RenderWorld.h"
 
 namespace crown
 {
 
-typedef Id GPUProgramId;
-
 //-----------------------------------------------------------------------------
 DebugLine::DebugLine(bool depth_test)
 	: m_depth_test(depth_test)
@@ -47,9 +46,7 @@ DebugLine::DebugLine(bool depth_test)
 void DebugLine::add_line(const Color4& color, const Vector3& start, const Vector3& end)
 {
 	if (m_num_lines >= CE_MAX_DEBUG_LINES)
-	{
 		 return;
-	}
 
 	m_lines[m_num_lines].position_0[0] = start.x;
 	m_lines[m_num_lines].position_0[1] = start.y;
@@ -123,7 +120,7 @@ void DebugLine::commit()
 	r->set_state((m_depth_test ? 0 : STATE_DEPTH_TEST_ALWAYS) | STATE_COLOR_WRITE | STATE_CULL_CW | STATE_PRIMITIVE_LINES);
 	r->set_vertex_buffer(tvb);
 	r->set_index_buffer(tib);
-	//r->set_program(default_program);
+	r->set_program(render_world_globals::default_program());
 	r->set_pose(matrix4x4::IDENTITY);
 	r->commit(0);
 }

+ 2 - 7
engine/renderers/DebugLine.h

@@ -28,14 +28,12 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 #include "Types.h"
 #include "Config.h"
+#include "MathTypes.h"
+#include "Color4.h"
 
 namespace crown
 {
 
-struct Color4;
-struct Matrix4x4;
-struct Vector3;
-
 struct DebugLine
 {
 	/// Whether to enable @a depth_test
@@ -47,9 +45,6 @@ struct DebugLine
 	/// Adds a sphere at @a center with the given @a radius and @a color.
 	void add_sphere(const Color4& color, const Vector3& center, const float radius);
 
-	/// Adds a @a pose with the given @a color
-	//void add_pose(const Color4& color, const Matrix4x4& pose);
-
 	/// Clears all the lines.
 	void clear();