diff --git a/cocos/2d/renderer/CCQuadCommand.cpp b/cocos/2d/renderer/CCQuadCommand.cpp index 29576bc7fb..f0b753b291 100644 --- a/cocos/2d/renderer/CCQuadCommand.cpp +++ b/cocos/2d/renderer/CCQuadCommand.cpp @@ -49,21 +49,18 @@ void QuadCommand::init(float globalOrder, GLuint textureID, GLProgram* shader, B { _globalOrder = globalOrder; - _textureID = textureID; - _blendType = blendType; - _shader = shader; - _quadsCount = quadCount; _quads = quad; _mv = mv; - if( _textureID != _lastTextureID || _blendType.src != _lastBlendType.src || _blendType.dst != _lastBlendType.dst || _shader != _lastShader) { + if( _textureID != textureID || _blendType.src != blendType.src || _blendType.dst != blendType.dst || _shader != shader) { + + _textureID = textureID; + _blendType = blendType; + _shader = shader; + generateMaterialID(); - - _lastShader = _shader; - _lastBlendType = _blendType; - _lastTextureID = _textureID; } } diff --git a/cocos/2d/renderer/CCQuadCommand.h b/cocos/2d/renderer/CCQuadCommand.h index d8f2ded978..1963cae544 100644 --- a/cocos/2d/renderer/CCQuadCommand.h +++ b/cocos/2d/renderer/CCQuadCommand.h @@ -71,13 +71,10 @@ protected: uint32_t _materialID; GLuint _textureID; - GLuint _lastTextureID; GLProgram* _shader; - GLProgram* _lastShader; BlendFunc _blendType; - BlendFunc _lastBlendType; V3F_C4B_T2F_Quad* _quads; ssize_t _quadsCount;