Show error message everytime a shader uniform's location can't be found.

Adjusted code style (TankOs).

Original commit message by the author:
  Show only 1 once the message "Parameter not found"

Conflicts:
  src/SFML/Graphics/Shader.cpp
This commit is contained in:
rafoudiablol 2014-04-06 22:04:42 +02:00 committed by Stefan Schindler
parent 228038fa8a
commit 0124ad0a85

View File

@ -601,17 +601,11 @@ int Shader::getParamLocation(const std::string& name)
else
{
// Not in cache, request the location from OpenGL
int location = glCheck(glGetUniformLocationARB(m_shaderProgram, name.c_str()));
if (location != -1)
{
// Location found: add it to the cache
int location = glGetUniformLocationARB(m_shaderProgram, name.c_str());
m_params.insert(std::make_pair(name, location));
}
else
{
// Error: location not found
if (location == -1)
err() << "Parameter \"" << name << "\" not found in shader" << std::endl;
}
return location;
}