fix light check

This commit is contained in:
yangxiao 2014-09-25 22:24:47 +08:00
parent 02489ecad6
commit 90523fc3d5
1 changed files with 3 additions and 4 deletions

View File

@ -528,10 +528,9 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
bool usingLight = false; bool usingLight = false;
Color4F ambient(0.f, 0.f, 0.f, 1.f); Color4F ambient(0.f, 0.f, 0.f, 1.f);
for (const auto light : lights) { for (const auto light : lights) {
if (((unsigned short)light->getLightFlag() & _lightMask) > 0) usingLight = ((unsigned short)light->getLightFlag() & _lightMask) > 0;
{ if (usingLight)
usingLight = true; break;
}
} }
if (usingLight != _shaderUsingLight) if (usingLight != _shaderUsingLight)
genGLProgramState(); genGLProgramState();