Graphics/Material: Add errors when failed to query texture

Former-commit-id: 6fe358b14a97c06c7567b0d7183bbc0950bd260b [formerly 45ddf7a31a0ad369717547aac624bdca493d2554]
Former-commit-id: 5aa41ca25d104d90a9f60acec5daa9958b9c0ca7
This commit is contained in:
Lynix 2016-06-09 08:49:01 +02:00
parent 2007edd398
commit e9d540ada5
1 changed files with 18 additions and 0 deletions

View File

@ -289,8 +289,11 @@ namespace Nz
{ {
texture = TextureManager::Get(textureName); texture = TextureManager::Get(textureName);
if (!texture) if (!texture)
{
NazaraError("Failed to get alpha map \"" + textureName + "\"");
return false; return false;
} }
}
SetAlphaMap(std::move(texture)); SetAlphaMap(std::move(texture));
return true; return true;
@ -335,8 +338,11 @@ namespace Nz
{ {
texture = TextureManager::Get(textureName); texture = TextureManager::Get(textureName);
if (!texture) if (!texture)
{
NazaraError("Failed to get diffuse map \"" + textureName + "\"");
return false; return false;
} }
}
SetDiffuseMap(std::move(texture)); SetDiffuseMap(std::move(texture));
return true; return true;
@ -366,8 +372,11 @@ namespace Nz
{ {
texture = TextureManager::Get(textureName); texture = TextureManager::Get(textureName);
if (!texture) if (!texture)
{
NazaraError("Failed to get emissive map \"" + textureName + "\"");
return false; return false;
} }
}
SetEmissiveMap(std::move(texture)); SetEmissiveMap(std::move(texture));
return true; return true;
@ -397,8 +406,11 @@ namespace Nz
{ {
texture = TextureManager::Get(textureName); texture = TextureManager::Get(textureName);
if (!texture) if (!texture)
{
NazaraError("Failed to get height map \"" + textureName + "\"");
return false; return false;
} }
}
SetHeightMap(std::move(texture)); SetHeightMap(std::move(texture));
return true; return true;
@ -418,8 +430,11 @@ namespace Nz
{ {
texture = TextureManager::Get(textureName); texture = TextureManager::Get(textureName);
if (!texture) if (!texture)
{
NazaraError("Failed to get normal map \"" + textureName + "\"");
return false; return false;
} }
}
SetNormalMap(std::move(texture)); SetNormalMap(std::move(texture));
return true; return true;
@ -471,8 +486,11 @@ namespace Nz
{ {
texture = TextureManager::Get(textureName); texture = TextureManager::Get(textureName);
if (!texture) if (!texture)
{
NazaraError("Failed to get specular map \"" + textureName + "\"");
return false; return false;
} }
}
SetSpecularMap(std::move(texture)); SetSpecularMap(std::move(texture));
return true; return true;