From a9972696e624a6feedb89944271ed4bd6a8f6fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Wed, 5 Mar 2014 04:53:33 +0000 Subject: [PATCH] Tweaked stuff in the AABBTree element storage. Added RemoveElement --- src/debug/lines.cpp | 5 +++++ src/lol/base/array.h | 2 +- src/lol/debug/lines.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/debug/lines.cpp b/src/debug/lines.cpp index a725e119..3322c608 100644 --- a/src/debug/lines.cpp +++ b/src/debug/lines.cpp @@ -22,6 +22,11 @@ void Debug::DrawLine(vec3 a, vec3 b, vec4 color) g_scene->AddLine(a, b, color); } +void Debug::DrawBox(box3 a, vec4 color) +{ + DrawBox(a.A, a.B, color); +} + void Debug::DrawBox(vec3 a, vec3 b, vec4 color) { vec3 v[8]; diff --git a/src/lol/base/array.h b/src/lol/base/array.h index 028a0ac6..ad39b40b 100644 --- a/src/lol/base/array.h +++ b/src/lol/base/array.h @@ -195,7 +195,7 @@ public: inline int Find(T const &x) { for (int i = 0; i < m_count; ++i) - if (x == m_data[i]) + if (m_data[i] == x) return i; return INDEX_NONE; } diff --git a/src/lol/debug/lines.h b/src/lol/debug/lines.h index 06bc8105..fb71df21 100644 --- a/src/lol/debug/lines.h +++ b/src/lol/debug/lines.h @@ -37,6 +37,7 @@ void Draw(B* x, vec4 color) } void DrawLine(vec3 a, vec3 b, vec4 color); +void DrawBox(box3 a, vec4 color); void DrawBox(vec3 a, vec3 b, vec4 color); void DrawViewProj(mat4 view_proj, vec4 color); void DrawViewProj(mat4 view, mat4 proj, vec4 color);