From 8073e70090c9ecf67e15255fefe2a950216939b4 Mon Sep 17 00:00:00 2001 From: Lynix Date: Fri, 20 Sep 2013 16:21:50 +0200 Subject: [PATCH] DebugDrawer will now auto-initialize Former-commit-id: 62756d6aa2e4cc25be93cb27c4698cfb3fc0e6d8 --- src/Nazara/Renderer/DebugDrawer.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Nazara/Renderer/DebugDrawer.cpp b/src/Nazara/Renderer/DebugDrawer.cpp index be5c70abe..4ae71068d 100644 --- a/src/Nazara/Renderer/DebugDrawer.cpp +++ b/src/Nazara/Renderer/DebugDrawer.cpp @@ -50,9 +50,9 @@ void NzDebugDrawer::Draw(const NzBoxi& box) void NzDebugDrawer::Draw(const NzBoxf& box) { - if (!s_initialized) + if (!s_initialized && !Initialize()) { - NazaraError("Debug drawer is not initialized"); + NazaraError("Failed to initialize Debug Drawer"); return; } @@ -141,9 +141,9 @@ void NzDebugDrawer::Draw(const NzBoxui& box) void NzDebugDrawer::Draw(const NzFrustumf& frustum) { - if (!s_initialized) + if (!s_initialized && !Initialize()) { - NazaraError("Debug drawer is not initialized"); + NazaraError("Failed to initialize Debug Drawer"); return; } @@ -223,9 +223,9 @@ void NzDebugDrawer::Draw(const NzFrustumf& frustum) void NzDebugDrawer::Draw(const NzOrientedBoxf& orientedBox) { - if (!s_initialized) + if (!s_initialized && !Initialize()) { - NazaraError("Debug drawer is not initialized"); + NazaraError("Failed to initialize Debug Drawer"); return; } @@ -305,9 +305,9 @@ void NzDebugDrawer::Draw(const NzOrientedBoxf& orientedBox) void NzDebugDrawer::Draw(const NzSkeleton* skeleton) { - if (!s_initialized) + if (!s_initialized && !Initialize()) { - NazaraError("Debug drawer is not initialized"); + NazaraError("Failed to initialize Debug Drawer"); return; } @@ -356,9 +356,9 @@ void NzDebugDrawer::Draw(const NzSkeleton* skeleton) void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh) { - if (!s_initialized) + if (!s_initialized && !Initialize()) { - NazaraError("Debug drawer is not initialized"); + NazaraError("Failed to initialize Debug Drawer"); return; } @@ -403,9 +403,9 @@ void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh) void NzDebugDrawer::DrawNormals(const NzStaticMesh* subMesh) { - if (!s_initialized) + if (!s_initialized && !Initialize()) { - NazaraError("Debug drawer is not initialized"); + NazaraError("Failed to initialize Debug Drawer"); return; } @@ -450,9 +450,9 @@ void NzDebugDrawer::DrawNormals(const NzStaticMesh* subMesh) void NzDebugDrawer::DrawTangents(const NzStaticMesh* subMesh) { - if (!s_initialized) + if (!s_initialized && !Initialize()) { - NazaraError("Debug drawer is not initialized"); + NazaraError("Failed to initialize Debug Drawer"); return; }