Daniele Bartolini 10 лет назад
Родитель
Сommit
9267bd9297
2 измененных файлов с 14 добавлено и 1 удалено
  1. 7 1
      src/renderers/debug_line.cpp
  2. 7 0
      src/renderers/debug_line.h

+ 7 - 1
src/renderers/debug_line.cpp

@@ -125,11 +125,17 @@ namespace debug_line
 } // namespace debug_line
 
 DebugLine::DebugLine(bool depth_test)
-	: _depth_test(depth_test)
+	: _marker(MARKER)
+	, _depth_test(depth_test)
 	, _num(0)
 {
 }
 
+DebugLine::~DebugLine()
+{
+	_marker = 0;
+}
+
 void DebugLine::add_line(const Vector3& start, const Vector3& end, const Color4& color)
 {
 	if (_num >= CROWN_MAX_DEBUG_LINES)

+ 7 - 0
src/renderers/debug_line.h

@@ -24,6 +24,7 @@ struct DebugLine
 {
 	/// Whether to enable @a depth_test
 	DebugLine(bool depth_test);
+	~DebugLine();
 
 	/// Adds a line from @a start to @a end with the given @a color.
 	void add_line(const Vector3& start, const Vector3& end, const Color4& color);
@@ -41,6 +42,10 @@ struct DebugLine
 	/// Sends the lines to renderer for drawing.
 	void commit();
 
+public:
+
+	enum { MARKER = 0xd7c17715 };
+
 private:
 
 	struct Line
@@ -51,6 +56,8 @@ private:
 		uint32_t c1;
 	};
 
+	uint32_t _marker;
+
 	bool _depth_test;
 	uint32_t _num;
 	Line _lines[CROWN_MAX_DEBUG_LINES];