Layercolor uses the new API

This commit is contained in:
Ricardo Quesada 2013-12-06 17:59:34 -08:00
parent ba2f65c6b2
commit 8df96b1a6e
3 changed files with 1 additions and 13 deletions

View File

@ -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)

View File

@ -299,7 +299,6 @@ protected:
Vertex2F _squareVertices[4];
Color4F _squareColors[4];
kmMat4 _transformMatrix;
private:
CC_DISALLOW_COPY_AND_ASSIGN(LayerColor);

View File

@ -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