Merge pull request #14194 from super626/v3

check light enable or not when switching shader
This commit is contained in:
pandamicro 2015-10-20 17:09:37 +08:00
commit 7466c4c71e
1 changed files with 1 additions and 1 deletions

View File

@ -730,7 +730,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
const auto lights = scene->getLights(); const auto lights = scene->getLights();
bool usingLight = false; bool usingLight = false;
for (const auto light : lights) { for (const auto light : lights) {
usingLight = ((unsigned int)light->getLightFlag() & _lightMask) > 0; usingLight = (light->isEnabled() && (unsigned int)light->getLightFlag() & _lightMask) > 0;
if (usingLight) if (usingLight)
break; break;
} }