fix layerColor bug for shader change

This commit is contained in:
Huabing.Xu 2014-01-10 10:03:47 +08:00
parent af733ce9b5
commit a1629a09e8
1 changed files with 1 additions and 6 deletions

View File

@ -569,16 +569,11 @@ void LayerColor::draw()
_customCommand.func = CC_CALLBACK_0(LayerColor::onDraw, this); _customCommand.func = CC_CALLBACK_0(LayerColor::onDraw, this);
Director::getInstance()->getRenderer()->addCommand(&_customCommand); 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) for(int i = 0; i < 4; ++i)
{ {
kmVec3 pos; kmVec3 pos;
pos.x = _squareVertices[i].x; pos.y = _squareVertices[i].y; pos.z = _vertexZ; 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); _noMVPVertices[i] = Vertex3F(pos.x,pos.y,pos.z);
} }