From 8df96b1a6e051a47bd70b727369b6ef207e51144 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 6 Dec 2013 17:59:34 -0800 Subject: [PATCH] Layercolor uses the new API --- cocos/2d/CCLayer.cpp | 9 --------- cocos/2d/CCLayer.h | 1 - cocos/2d/renderer/CCNewDrawNode.h | 4 +--- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index bcb5eaa03b..8dc43ab651 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -690,7 +690,6 @@ void LayerColor::updateColor() void LayerColor::draw() { - kmGLGetMatrix(KM_GL_MODELVIEW, &_transformMatrix); CustomCommand* cmd = CustomCommand::getCommandPool().generateCommand(); cmd->init(0, _vertexZ); cmd->func = CC_CALLBACK_0(LayerColor::onDraw, this); @@ -699,12 +698,6 @@ void LayerColor::draw() void LayerColor::onDraw() { - //TODO we can just reuse the base MV matrix instead of save and reset everytime - //TODO need to find out where do we set the base MV matrix - kmMat4 prevMatrix; - kmGLGetMatrix(KM_GL_MODELVIEW, &prevMatrix); - kmGLLoadMatrix(&_transformMatrix); - CC_NODE_DRAW_SETUP(); GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR ); @@ -728,8 +721,6 @@ void LayerColor::onDraw() glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); CC_INCREMENT_GL_DRAWS(1); - - kmGLLoadMatrix(&prevMatrix); } void LayerColor::setColor(const Color3B &color) diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index 106de3887e..360b46758a 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -299,7 +299,6 @@ protected: Vertex2F _squareVertices[4]; Color4F _squareColors[4]; - kmMat4 _transformMatrix; private: CC_DISALLOW_COPY_AND_ASSIGN(LayerColor); diff --git a/cocos/2d/renderer/CCNewDrawNode.h b/cocos/2d/renderer/CCNewDrawNode.h index 6b470d083a..8183efadf3 100644 --- a/cocos/2d/renderer/CCNewDrawNode.h +++ b/cocos/2d/renderer/CCNewDrawNode.h @@ -17,8 +17,6 @@ class NewDrawNode : public DrawNode public: static NewDrawNode* create(); - virtual ~NewDrawNode(); - virtual bool init(); void draw(); @@ -27,8 +25,8 @@ public: protected: NewDrawNode(); + virtual ~NewDrawNode(); - kmMat4 _transformMatrix; }; NS_CC_END