Cleaned code

Former-commit-id: 65b235b0c8326e060ec7032bb2a153e22518a25a
This commit is contained in:
Lynix
2012-10-04 09:32:55 +02:00
parent b219b19710
commit 7bab3d9443
9 changed files with 48 additions and 87 deletions

View File

@@ -616,8 +616,13 @@ bool NzRenderer::SetTarget(NzRenderTarget* target)
if (s_target == target)
return true;
if (s_target && !s_target->HasContext())
s_target->Desactivate();
if (s_target)
{
if (!s_target->HasContext())
s_target->Desactivate();
s_target = nullptr;
}
if (target)
{
@@ -629,18 +634,14 @@ bool NzRenderer::SetTarget(NzRenderTarget* target)
}
#endif
if (target->Activate())
s_target = target;
else
if (!target->Activate())
{
NazaraError("Failed to activate target");
s_target = nullptr;
return false;
}
s_target = target;
}
else
s_target = nullptr;
return true;
}