From 3e0bee706e385733e607e3107e988f48f3729517 Mon Sep 17 00:00:00 2001 From: Nite Luo Date: Fri, 6 Dec 2013 11:41:24 -0800 Subject: [PATCH] Fix a hack in CCLabelAtlas for vertice color, add TODO for quad command --- cocos/2d/CCLabelAtlas.cpp | 3 +-- cocos/2d/renderer/QuadCommand.cpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index 2a35b689aa..8ec15a3c1c 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -169,8 +169,7 @@ void LabelAtlas::updateAtlasValues() quads[i].tr.vertices.x = (float)(i * _itemWidth + _itemWidth); quads[i].tr.vertices.y = (float)(_itemHeight); quads[i].tr.vertices.z = 0.0f; -// Color4B c(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity); - Color4B c(255,255,255,255); + Color4B c(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity); quads[i].tl.colors = c; quads[i].tr.colors = c; quads[i].bl.colors = c; diff --git a/cocos/2d/renderer/QuadCommand.cpp b/cocos/2d/renderer/QuadCommand.cpp index 1f68a7774e..9b8952a617 100644 --- a/cocos/2d/renderer/QuadCommand.cpp +++ b/cocos/2d/renderer/QuadCommand.cpp @@ -33,6 +33,7 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* _shader = shader; if(quadCount > _capacity ) { + //TODO find a better way to manage quads, current way will result in memory be wasted // _quad = (V3F_C4B_T2F_Quad*)malloc(sizeof(V3F_C4B_T2F_Quad) * quadCount); _quad = (V3F_C4B_T2F_Quad*) realloc(_quad, sizeof(*quad) * quadCount ); _capacity = quadCount;