From 8ff32e237680cbfbaece3842aa4f719b346ae453 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 9 Apr 2013 11:32:40 +0200 Subject: [PATCH] Improved error message Former-commit-id: 8f21e6420859cac4153941cf35e34f0d4ba13c87 --- src/Nazara/Graphics/SkyboxBackground.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Nazara/Graphics/SkyboxBackground.cpp b/src/Nazara/Graphics/SkyboxBackground.cpp index d7e751791..927d34317 100644 --- a/src/Nazara/Graphics/SkyboxBackground.cpp +++ b/src/Nazara/Graphics/SkyboxBackground.cpp @@ -239,10 +239,19 @@ NzTexture* NzSkyboxBackground::GetTexture() const void NzSkyboxBackground::SetTexture(NzTexture* cubemapTexture) { #if NAZARA_GRAPHICS_SAFE - if (cubemapTexture && !cubemapTexture->IsCubemap()) + if (cubemapTexture) { - NazaraError("Texture must be a cubemap"); - return; + if (!cubemapTexture->IsValid()) + { + NazaraError("Texture must be valid"); + return; + } + + if (!cubemapTexture->IsCubemap()) + { + NazaraError("Texture must be a cubemap"); + return; + } } #endif