Fix issue #214
This commit is contained in:
@@ -629,7 +629,11 @@ void DebugDraw::DrawLine(const Vector3& start, const Vector3& end, const Color&
|
|||||||
|
|
||||||
void DebugDraw::DrawLines(const Span<Vector3>& lines, const Matrix& transform, const Color& color, float duration, bool depthTest)
|
void DebugDraw::DrawLines(const Span<Vector3>& lines, const Matrix& transform, const Color& color, float duration, bool depthTest)
|
||||||
{
|
{
|
||||||
ASSERT(lines.Length() % 2 == 0);
|
if (lines.Length() % 2 == 0)
|
||||||
|
{
|
||||||
|
LOG(Error, "Cannot draw debug lines with uneven amount of items in array");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Create draw call entry
|
// Create draw call entry
|
||||||
DebugLine l = { Vector3::Zero, Vector3::Zero, Color32(color), duration };
|
DebugLine l = { Vector3::Zero, Vector3::Zero, Color32(color), duration };
|
||||||
@@ -637,10 +641,12 @@ void DebugDraw::DrawLines(const Span<Vector3>& lines, const Matrix& transform, c
|
|||||||
// Add lines
|
// Add lines
|
||||||
const Vector3* p = lines.Get();
|
const Vector3* p = lines.Get();
|
||||||
Array<DebugLine>* list;
|
Array<DebugLine>* list;
|
||||||
|
|
||||||
if (depthTest)
|
if (depthTest)
|
||||||
list = duration > 0 ? &DebugDrawDepthTest.DefaultLines : &DebugDrawDepthTest.OneFrameLines;
|
list = duration > 0 ? &DebugDrawDepthTest.DefaultLines : &DebugDrawDepthTest.OneFrameLines;
|
||||||
else
|
else
|
||||||
list = duration > 0 ? &DebugDrawDefault.DefaultLines : &DebugDrawDefault.OneFrameLines;
|
list = duration > 0 ? &DebugDrawDefault.DefaultLines : &DebugDrawDefault.OneFrameLines;
|
||||||
|
|
||||||
list->EnsureCapacity(list->Count() + lines.Length());
|
list->EnsureCapacity(list->Count() + lines.Length());
|
||||||
for (int32 i = 0; i < lines.Length(); i += 2)
|
for (int32 i = 0; i < lines.Length(); i += 2)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user