diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index b5cb0e760c..587986b5b3 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -774,7 +774,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) const auto lights = scene->getLights(); bool usingLight = false; for (const auto light : lights) { - usingLight = (light->isEnabled() && (unsigned int)light->getLightFlag() & _lightMask) > 0; + usingLight = light->isEnabled() && ((static_cast(light->getLightFlag()) & _lightMask) > 0); if (usingLight) break; }