From 8f6277c5403e46ccde803c3f5e7fae79dbd0050f Mon Sep 17 00:00:00 2001 From: WenhaiLin Date: Tue, 5 May 2015 18:30:33 +0800 Subject: [PATCH] Label:Fixed shadow effect cause OpenGL error on IOS. --- cocos/2d/CCLabel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 9af6f28f23..1988c7e0ea 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -900,8 +900,11 @@ void Label::onDraw(const Mat4& transform, bool transformUpdated) { glprogram->setUniformLocationWith4f(_uniformTextColor, _shadowColor4F.r, _shadowColor4F.g, _shadowColor4F.b, _shadowColor4F.a); - glprogram->setUniformLocationWith4f(_uniformEffectColor, - _shadowColor4F.r, _shadowColor4F.g, _shadowColor4F.b, _shadowColor4F.a); + if (_currLabelEffect == LabelEffect::OUTLINE || _currLabelEffect == LabelEffect::GLOW) + { + glprogram->setUniformLocationWith4f(_uniformEffectColor, + _shadowColor4F.r, _shadowColor4F.g, _shadowColor4F.b, _shadowColor4F.a); + } getGLProgram()->setUniformsForBuiltins(_shadowTransform); for (const auto &child : _children)