From ee867fb9dc6aa96636b414dfdf869b663de4825e Mon Sep 17 00:00:00 2001 From: Lwmte <3331699+Lwmte@users.noreply.github.com> Date: Tue, 24 Dec 2024 20:15:12 +0100 Subject: [PATCH] Don't try to draw debug box in non-debug mode --- TombEngine/Game/collision/collide_item.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TombEngine/Game/collision/collide_item.cpp b/TombEngine/Game/collision/collide_item.cpp index 1d6348ce8..58170d86d 100644 --- a/TombEngine/Game/collision/collide_item.cpp +++ b/TombEngine/Game/collision/collide_item.cpp @@ -20,6 +20,7 @@ #include "Math/Math.h" #include "Scripting/Include/ScriptInterfaceGame.h" #include "Sound/sound.h" +#include "Specific/winmain.h" using namespace TEN::Collision::Floordata; using namespace TEN::Collision::Point; @@ -330,7 +331,10 @@ void TestForObjectOnLedge(ItemInfo* item, CollisionInfo* coll) bool TestLaraPosition(const ObjectCollisionBounds& bounds, ItemInfo* item, ItemInfo* laraItem) { - DrawDebugBox(bounds.BoundingBox.ToBoundingOrientedBox(item->Pose), Color(1.0f, 0.0f, 0.0f), RendererDebugPage::CollisionStats); + if (DebugMode) + { + DrawDebugBox(bounds.BoundingBox.ToBoundingOrientedBox(item->Pose), Color(1.0f, 0.0f, 0.0f), RendererDebugPage::CollisionStats); + } auto deltaOrient = laraItem->Pose.Orientation - item->Pose.Orientation; if (deltaOrient.x < bounds.OrientConstraint.first.x || deltaOrient.x > bounds.OrientConstraint.second.x ||