From a1629a09e8bfce94399b36b9cfa2b61caf4d94f7 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 10 Jan 2014 10:03:47 +0800 Subject: [PATCH] fix layerColor bug for shader change --- cocos/2d/CCLayer.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index b8b69f0976..1bae6e040c 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -569,16 +569,11 @@ void LayerColor::draw() _customCommand.func = CC_CALLBACK_0(LayerColor::onDraw, this); Director::getInstance()->getRenderer()->addCommand(&_customCommand); - kmMat4 p, mvp; - kmGLGetMatrix(KM_GL_PROJECTION, &p); - kmGLGetMatrix(KM_GL_MODELVIEW, &mvp); - kmMat4Multiply(&mvp, &p, &mvp); - for(int i = 0; i < 4; ++i) { kmVec3 pos; pos.x = _squareVertices[i].x; pos.y = _squareVertices[i].y; pos.z = _vertexZ; - kmVec3TransformCoord(&pos, &pos, &mvp); + kmVec3TransformCoord(&pos, &pos, &_modelViewTransform); _noMVPVertices[i] = Vertex3F(pos.x,pos.y,pos.z); }