From da8dc13601ab16ba5d2f9fb9d256d6ea8059be1d Mon Sep 17 00:00:00 2001 From: tangziwen Date: Wed, 3 Dec 2014 16:00:52 +0800 Subject: [PATCH] avoid the case that "hasAmbient" use before assign --- cocos/renderer/CCMeshCommand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index 96d43291cc..ee483a47d0 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -460,7 +460,7 @@ void MeshCommand::setLightUniforms() else // normal does not exist { Vec3 ambient(0.0f, 0.0f, 0.0f); - bool hasAmbient; + bool hasAmbient = false; for (const auto& light : lights) { if (light->getLightType() == LightType::AMBIENT)