Fix a hack in CCLabelAtlas for vertice color, add TODO for quad command

This commit is contained in:
Nite Luo 2013-12-06 11:41:24 -08:00
parent 97fb43b8d7
commit 3e0bee706e
2 changed files with 2 additions and 2 deletions

View File

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

View File

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