Sfoglia il codice sorgente

world: DebugLine can send data to any drawing layer

Daniele Bartolini 6 anni fa
parent
commit
e531052574
2 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 2 2
      src/world/debug_line.cpp
  2. 2 1
      src/world/debug_line.h

+ 2 - 2
src/world/debug_line.cpp

@@ -258,7 +258,7 @@ void DebugLine::reset()
 	_num = 0;
 }
 
-void DebugLine::submit()
+void DebugLine::submit(u8 view_id)
 {
 	if (!_num)
 		return;
@@ -271,7 +271,7 @@ void DebugLine::submit()
 	memcpy(tvb.data, _lines, sizeof(Line) * _num);
 
 	bgfx::setVertexBuffer(0, &tvb, 0, _num * 2);
-	_shader_manager->submit(_shader, VIEW_DEBUG);
+	_shader_manager->submit(_shader, view_id);
 }
 
 } // namespace crown

+ 2 - 1
src/world/debug_line.h

@@ -8,6 +8,7 @@
 #include "core/math/types.h"
 #include "core/strings/string_id.h"
 #include "core/types.h"
+#include "device/pipeline.h"
 #include "resource/types.h"
 #include "world/types.h"
 #include <bgfx/bgfx.h>
@@ -80,7 +81,7 @@ struct DebugLine
 	void reset();
 
 	/// Submits the lines to renderer for drawing.
-	void submit();
+	void submit(u8 view_id = VIEW_DEBUG);
 };
 
 } // namespace crown