Daniele Bartolini 10 năm trước cách đây
mục cha
commit
c1c0275092
3 tập tin đã thay đổi với 8 bổ sung12 xóa
  1. 0 4
      src/config.h
  2. 1 1
      src/world/debug_line.cpp
  3. 7 7
      src/world/debug_line.h

+ 0 - 4
src/config.h

@@ -115,10 +115,6 @@
 	#define CE_MAX_SOUND_INSTANCES 64 // Per world
 #endif // CE_MAX
 
-#ifndef CROWN_MAX_DEBUG_LINES
-	#define CROWN_MAX_DEBUG_LINES 32768 // Per DebugLine
-#endif // CROWN_MAX_DEBUG_LINES
-
 #ifndef CROWN_MAX_LUA_VECTOR3
 	#define CROWN_MAX_LUA_VECTOR3 8192
 #endif // CE_MAX

+ 1 - 1
src/world/debug_line.cpp

@@ -32,7 +32,7 @@ DebugLine::~DebugLine()
 
 void DebugLine::add_line(const Vector3& start, const Vector3& end, const Color4& color)
 {
-	if (_num >= CROWN_MAX_DEBUG_LINES)
+	if (_num >= MAX_LINES)
 		 return;
 
 	_lines[_num].p0 = start;

+ 7 - 7
src/world/debug_line.h

@@ -5,10 +5,9 @@
 
 #pragma once
 
-#include "types.h"
-#include "config.h"
 #include "math_types.h"
 #include "string_id.h"
+#include "types.h"
 #include <bgfx/bgfx.h>
 
 namespace crown
@@ -18,6 +17,11 @@ namespace crown
 /// @ingroup World
 struct DebugLine
 {
+	/// Default number of segments.
+	static const u32 NUM_SEGMENTS = 36;
+	static const u32 MARKER = 0xd7c17715;
+	static const u32 MAX_LINES = 32768;
+
 	struct Line
 	{
 		Vector3 p0;
@@ -32,7 +36,7 @@ struct DebugLine
 	bgfx::VertexDecl _vertex_decl;
 
 	u32 _num;
-	Line _lines[CROWN_MAX_DEBUG_LINES];
+	Line _lines[MAX_LINES];
 
 	/// Whether to enable @a depth_test
 	DebugLine(bool depth_test);
@@ -65,10 +69,6 @@ struct DebugLine
 
 	/// Submits the lines to renderer for drawing.
 	void submit();
-
-	/// Default number of segments.
-	static const u32 NUM_SEGMENTS = 36;
-	static const u32 MARKER = 0xd7c17715;
 };
 
 } // namespace crown