mirror of https://github.com/axmolengine/axmol.git
fixes some compiler warnings
don't call deprecated functions
This commit is contained in:
parent
4911ae448d
commit
3d448e86ef
|
@ -439,7 +439,7 @@ GLProgram* GLProgramCache::getGLProgram(const std::string &key)
|
||||||
void GLProgramCache::addGLProgram(GLProgram* program, const std::string &key)
|
void GLProgramCache::addGLProgram(GLProgram* program, const std::string &key)
|
||||||
{
|
{
|
||||||
// release old one
|
// release old one
|
||||||
auto prev = getProgram(key);
|
auto prev = getGLProgram(key);
|
||||||
if( prev == program )
|
if( prev == program )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -454,10 +454,14 @@ void GLProgramCache::addGLProgram(GLProgram* program, const std::string &key)
|
||||||
std::string GLProgramCache::getShaderMacrosForLight() const
|
std::string GLProgramCache::getShaderMacrosForLight() const
|
||||||
{
|
{
|
||||||
GLchar def[256];
|
GLchar def[256];
|
||||||
sprintf(def, "\n#define MAX_DIRECTIONAL_LIGHT_NUM %d \n"
|
auto conf = Configuration::getInstance();
|
||||||
|
|
||||||
|
snprintf(def, sizeof(def)-1, "\n#define MAX_DIRECTIONAL_LIGHT_NUM %d \n"
|
||||||
"\n#define MAX_POINT_LIGHT_NUM %d \n"
|
"\n#define MAX_POINT_LIGHT_NUM %d \n"
|
||||||
"\n#define MAX_SPOT_LIGHT_NUM %d \n"
|
"\n#define MAX_SPOT_LIGHT_NUM %d \n",
|
||||||
, Configuration::getInstance()->getMaxSupportDirLightInShader(), Configuration::getInstance()->getMaxSupportPointLightInShader(), Configuration::getInstance()->getMaxSupportSpotLightInShader());
|
conf->getMaxSupportDirLightInShader(),
|
||||||
|
conf->getMaxSupportPointLightInShader(),
|
||||||
|
conf->getMaxSupportSpotLightInShader());
|
||||||
return std::string(def);
|
return std::string(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue