mirror of https://github.com/axmolengine/axmol.git
Fix a hack in CCLabelAtlas for vertice color, add TODO for quad command
This commit is contained in:
parent
97fb43b8d7
commit
3e0bee706e
|
@ -169,8 +169,7 @@ void LabelAtlas::updateAtlasValues()
|
||||||
quads[i].tr.vertices.x = (float)(i * _itemWidth + _itemWidth);
|
quads[i].tr.vertices.x = (float)(i * _itemWidth + _itemWidth);
|
||||||
quads[i].tr.vertices.y = (float)(_itemHeight);
|
quads[i].tr.vertices.y = (float)(_itemHeight);
|
||||||
quads[i].tr.vertices.z = 0.0f;
|
quads[i].tr.vertices.z = 0.0f;
|
||||||
// Color4B c(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity);
|
Color4B c(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity);
|
||||||
Color4B c(255,255,255,255);
|
|
||||||
quads[i].tl.colors = c;
|
quads[i].tl.colors = c;
|
||||||
quads[i].tr.colors = c;
|
quads[i].tr.colors = c;
|
||||||
quads[i].bl.colors = c;
|
quads[i].bl.colors = c;
|
||||||
|
|
|
@ -33,6 +33,7 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram*
|
||||||
_shader = shader;
|
_shader = shader;
|
||||||
|
|
||||||
if(quadCount > _capacity ) {
|
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*)malloc(sizeof(V3F_C4B_T2F_Quad) * quadCount);
|
||||||
_quad = (V3F_C4B_T2F_Quad*) realloc(_quad, sizeof(*quad) * quadCount );
|
_quad = (V3F_C4B_T2F_Quad*) realloc(_quad, sizeof(*quad) * quadCount );
|
||||||
_capacity = quadCount;
|
_capacity = quadCount;
|
||||||
|
|
Loading…
Reference in New Issue