Made Submodules initialized when used

Former-commit-id: 203a4a3b07e18301ce003129bb6af22e0478d07a
This commit is contained in:
Lynix
2014-04-12 14:19:29 +02:00
parent 8c6c58c677
commit b30d325ca5
3 changed files with 34 additions and 15 deletions

View File

@@ -33,6 +33,12 @@ namespace
void NzDebugDrawer::Draw(const NzBoundingVolumef& volume)
{
if (!Initialize())
{
NazaraError("Failed to initialize Debug Drawer");
return;
}
if (!volume.IsFinite())
return;
@@ -53,7 +59,7 @@ void NzDebugDrawer::Draw(const NzBoxi& box)
void NzDebugDrawer::Draw(const NzBoxf& box)
{
if (!s_initialized && !Initialize())
if (!Initialize())
{
NazaraError("Failed to initialize Debug Drawer");
return;
@@ -144,7 +150,7 @@ void NzDebugDrawer::Draw(const NzBoxui& box)
void NzDebugDrawer::Draw(const NzFrustumf& frustum)
{
if (!s_initialized && !Initialize())
if (!Initialize())
{
NazaraError("Failed to initialize Debug Drawer");
return;
@@ -226,7 +232,7 @@ void NzDebugDrawer::Draw(const NzFrustumf& frustum)
void NzDebugDrawer::Draw(const NzOrientedBoxf& orientedBox)
{
if (!s_initialized && !Initialize())
if (!Initialize())
{
NazaraError("Failed to initialize Debug Drawer");
return;
@@ -308,7 +314,7 @@ void NzDebugDrawer::Draw(const NzOrientedBoxf& orientedBox)
void NzDebugDrawer::Draw(const NzSkeleton* skeleton)
{
if (!s_initialized && !Initialize())
if (!Initialize())
{
NazaraError("Failed to initialize Debug Drawer");
return;
@@ -359,7 +365,7 @@ void NzDebugDrawer::Draw(const NzSkeleton* skeleton)
void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh)
{
if (!s_initialized && !Initialize())
if (!Initialize())
{
NazaraError("Failed to initialize Debug Drawer");
return;
@@ -406,7 +412,7 @@ void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh)
void NzDebugDrawer::DrawCone(const NzVector3f& origin, const NzQuaternionf& rotation, float angle, float length)
{
if (!s_initialized && !Initialize())
if (!Initialize())
{
NazaraError("Failed to initialize Debug Drawer");
return;