Skip to content

Commit 5b519b4

Browse files
committed
Rename all XXX_C4F_T2F_XXX to XXX_T2F_C4F_XXX
1 parent 9fe71e4 commit 5b519b4

25 files changed

+82
-102
lines changed

core/2d/AnchoredSprite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ AnchoredSprite* AnchoredSprite::create()
147147
return nullptr;
148148
}
149149

150-
void AnchoredSprite::setVertexCoords(const Rect& rect, V3F_C4F_T2F_Quad* outQuad)
150+
void AnchoredSprite::setVertexCoords(const Rect& rect, V3F_T2F_C4F_Quad* outQuad)
151151
{
152152
float relativeOffsetX = _unflippedOffsetPositionFromCenter.x - getContentSize().x * _spriteVertexAnchor.x;
153153
float relativeOffsetY = _unflippedOffsetPositionFromCenter.y - getContentSize().y * _spriteVertexAnchor.y;

core/2d/AnchoredSprite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class AX_DLL AnchoredSprite : public Sprite
143143
virtual Rect getTouchRect();
144144

145145
protected:
146-
virtual void setVertexCoords(const Rect& rect, V3F_C4F_T2F_Quad* outQuad) override;
146+
virtual void setVertexCoords(const Rect& rect, V3F_T2F_C4F_Quad* outQuad) override;
147147
Vec2 _spriteVertexAnchor = Vec2::ANCHOR_MIDDLE;
148148
};
149149

core/2d/AutoPolygon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ PolygonInfo::~PolygonInfo()
9797
releaseVertsAndIndices();
9898
}
9999

100-
void PolygonInfo::setQuad(V3F_C4F_T2F_Quad* quad)
100+
void PolygonInfo::setQuad(V3F_T2F_C4F_Quad* quad)
101101
{
102102
releaseVertsAndIndices();
103103
_isVertsOwner = false;
@@ -107,7 +107,7 @@ void PolygonInfo::setQuad(V3F_C4F_T2F_Quad* quad)
107107
triangles.verts = (V3F_T2F_C4F*)quad;
108108
}
109109

110-
void PolygonInfo::setQuads(V3F_C4F_T2F_Quad* quad, int numberOfQuads)
110+
void PolygonInfo::setQuads(V3F_T2F_C4F_Quad* quad, int numberOfQuads)
111111
{
112112
AXASSERT(numberOfQuads >= 1 && numberOfQuads <= 9, "Invalid number of Quads");
113113

core/2d/AutoPolygon.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ class AX_DLL PolygonInfo
8080
* set the data to be a pointer to a quad
8181
* the member verts will not be released when this PolygonInfo destructs
8282
* as the verts memory are managed by other objects
83-
* @param quad a pointer to the V3F_C4F_T2F_Quad object
83+
* @param quad a pointer to the V3F_T2F_C4F_Quad object
8484
*/
85-
void setQuad(V3F_C4F_T2F_Quad* quad);
85+
void setQuad(V3F_T2F_C4F_Quad* quad);
8686

8787
/**
8888
* set the data to be a pointer to a number of Quads
8989
* the member verts will not be released when this PolygonInfo destructs
9090
* as the verts memory are managed by other objects
91-
* @param quad a pointer to the V3F_C4F_T2F_Quad quads
91+
* @param quad a pointer to the V3F_T2F_C4F_Quad quads
9292
*/
93-
void setQuads(V3F_C4F_T2F_Quad* quads, int numberOfQuads);
93+
void setQuads(V3F_T2F_C4F_Quad* quads, int numberOfQuads);
9494

9595
/**
9696
* set the data to be a pointer to a triangles

core/2d/DrawNode.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ void DrawNode::_drawPolygon(const Vec2* verts,
830830

831831
auto _vertices = _transform(verts, count, closedPolygon);
832832

833-
axstd::pod_vector<V2F_C4F_T2F_Triangle> triangleList;
833+
axstd::pod_vector<V2F_T2F_C4F_Triangle> triangleList;
834834

835835
int vertex_count = 0;
836836

@@ -858,7 +858,7 @@ void DrawNode::_drawPolygon(const Vec2* verts,
858858
p2t::Point* vec2 = t->GetPoint(1);
859859
p2t::Point* vec3 = t->GetPoint(2);
860860

861-
V2F_C4F_T2F_Triangle triangle = {
861+
V2F_T2F_C4F_Triangle triangle = {
862862
{Vec2(vec1->x, vec1->y), Vec2::ZERO, fillColor},
863863
{Vec2(vec2->x, vec2->y), Vec2::ZERO, fillColor},
864864
{Vec2(vec3->x, vec3->y), Vec2::ZERO, fillColor},
@@ -885,7 +885,7 @@ void DrawNode::_drawPolygon(const Vec2* verts,
885885

886886
vertex_count *= 3;
887887

888-
auto triangles = reinterpret_cast<V2F_C4F_T2F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
888+
auto triangles = reinterpret_cast<V2F_T2F_C4F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
889889
_trianglesDirty = true;
890890

891891
// start drawing...
@@ -1086,7 +1086,7 @@ void DrawNode::_drawSegment(const Vec2& from,
10861086

10871087
unsigned int vertex_count = 3 * ((etStart != DrawNode::EndType::Butt) ? 2 : 0) + 3 * 2 +
10881088
3 * ((etEnd != DrawNode::EndType::Butt) ? 2 : 0);
1089-
auto triangles = reinterpret_cast<V2F_C4F_T2F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
1089+
auto triangles = reinterpret_cast<V2F_T2F_C4F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
10901090
_trianglesDirty = true;
10911091

10921092
int ii = 0;
@@ -1182,7 +1182,7 @@ void DrawNode::_drawSegment(const Vec2& from,
11821182
void DrawNode::_drawDot(const Vec2& pos, float radius, const Color& color)
11831183
{
11841184
unsigned int vertex_count = 2 * 3;
1185-
auto triangles = reinterpret_cast<V2F_C4F_T2F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
1185+
auto triangles = reinterpret_cast<V2F_T2F_C4F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
11861186
_trianglesDirty = true;
11871187

11881188
V2F_T2F_C4F a = {Vec2(pos.x - radius, pos.y - radius), Vec2(-1.0f, -1.0f), color};
@@ -1264,7 +1264,7 @@ void DrawNode::_drawTriangle(Vec2* vertices3,
12641264
{
12651265
applyTransform(vertices3, vertices3, vertex_count);
12661266

1267-
auto triangles = reinterpret_cast<V2F_C4F_T2F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
1267+
auto triangles = reinterpret_cast<V2F_T2F_C4F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
12681268
_trianglesDirty = true;
12691269

12701270
triangles[0] = {{vertices3[0], Vec2::ZERO, fillColor},

core/2d/FastTMXLayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class AX_DLL FastTMXLayer : public Node
371371
float _cameraZoomDirty;
372372

373373
std::vector<int> _tileToQuadIndex;
374-
std::vector<V3F_C4F_T2F_Quad> _totalQuads;
374+
std::vector<V3F_T2F_C4F_Quad> _totalQuads;
375375
#ifdef AX_FAST_TILEMAP_32_BIT_INDICES
376376
std::vector<unsigned int> _indices;
377377
#else

core/2d/Label.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,15 +1775,15 @@ void Label::updateBuffer(TextureAtlas* textureAtlas, CustomCommand& customComman
17751775
{
17761776
if (textureAtlas->getTotalQuads() > customCommand.getVertexCapacity())
17771777
{
1778-
customCommand.createVertexBuffer((unsigned int)sizeof(V3F_C4F_T2F_Quad),
1778+
customCommand.createVertexBuffer((unsigned int)sizeof(V3F_T2F_C4F_Quad),
17791779
(unsigned int)textureAtlas->getTotalQuads(),
17801780
CustomCommand::BufferUsage::DYNAMIC);
17811781
customCommand.createIndexBuffer(CustomCommand::IndexFormat::U_SHORT,
17821782
(unsigned int)textureAtlas->getTotalQuads() * 6,
17831783
CustomCommand::BufferUsage::DYNAMIC);
17841784
}
17851785
customCommand.updateVertexBuffer(textureAtlas->getQuads(),
1786-
(unsigned int)(textureAtlas->getTotalQuads() * sizeof(V3F_C4F_T2F_Quad)));
1786+
(unsigned int)(textureAtlas->getTotalQuads() * sizeof(V3F_T2F_C4F_Quad)));
17871787
customCommand.updateIndexBuffer(textureAtlas->getIndices(),
17881788
(unsigned int)(textureAtlas->getTotalQuads() * 6 * sizeof(unsigned short)));
17891789
customCommand.setIndexDrawInfo(0, (unsigned int)(textureAtlas->getTotalQuads() * 6));
@@ -1895,7 +1895,7 @@ void Label::updateEffectUniforms(BatchCommand& batch,
18951895
_displayedOpacity = _shadowColor.a * (oldOPacity / 255.0f) * 255;
18961896
setColor(Color3B(_shadowColor));
18971897
batch.shadowCommand.updateVertexBuffer(
1898-
textureAtlas->getQuads(), (unsigned int)(textureAtlas->getTotalQuads() * sizeof(V3F_C4F_T2F_Quad)));
1898+
textureAtlas->getQuads(), (unsigned int)(textureAtlas->getTotalQuads() * sizeof(V3F_T2F_C4F_Quad)));
18991899
batch.shadowCommand.init(_globalZOrder);
19001900
renderer->addCommand(&batch.shadowCommand);
19011901

core/2d/LabelAtlas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void LabelAtlas::updateAtlasValues()
161161
}
162162

163163
AXASSERT(n <= _textureAtlas->getCapacity(), "updateAtlasValues: Invalid String length");
164-
V3F_C4F_T2F_Quad* quads = _textureAtlas->getQuads();
164+
V3F_T2F_C4F_Quad* quads = _textureAtlas->getQuads();
165165
for (ssize_t i = 0; i < n; i++)
166166
{
167167

core/2d/ParticleBatchNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ void ParticleBatchNode::increaseAtlasCapacityTo(ssize_t quantity)
474474
// sets a 0'd quad into the quads array
475475
void ParticleBatchNode::disableParticle(int particleIndex)
476476
{
477-
V3F_C4F_T2F_Quad* quad = &((_textureAtlas->getQuads())[particleIndex]);
477+
V3F_T2F_C4F_Quad* quad = &((_textureAtlas->getQuads())[particleIndex]);
478478
quad->br.position.x = quad->br.position.y = quad->tr.position.x = quad->tr.position.y = quad->tl.position.x =
479479
quad->tl.position.y = quad->bl.position.x = quad->bl.position.y = 0.0f;
480480
}

core/2d/ParticleSystemQuad.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect)
176176
// Important. Texture in cocos2d are inverted, so the Y component should be inverted
177177
std::swap(top, bottom);
178178

179-
V3F_C4F_T2F_Quad* quads = nullptr;
179+
V3F_T2F_C4F_Quad* quads = nullptr;
180180
unsigned int start = 0, end = 0;
181181
if (_batchNode)
182182
{
@@ -260,7 +260,7 @@ void ParticleSystemQuad::initIndices()
260260
}
261261
}
262262

263-
inline void updatePosWithParticle(V3F_C4F_T2F_Quad* quad,
263+
inline void updatePosWithParticle(V3F_T2F_C4F_Quad* quad,
264264
const Vec2& newPosition,
265265
float size,
266266
float scaleInSize,
@@ -323,11 +323,11 @@ void ParticleSystemQuad::updateParticleQuads()
323323
currentPosition = _position;
324324
}
325325

326-
V3F_C4F_T2F_Quad* startQuad;
326+
V3F_T2F_C4F_Quad* startQuad;
327327
Vec2 pos = Vec2::ZERO;
328328
if (_batchNode)
329329
{
330-
V3F_C4F_T2F_Quad* batchQuads = _batchNode->getTextureAtlas()->getQuads();
330+
V3F_T2F_C4F_Quad* batchQuads = _batchNode->getTextureAtlas()->getQuads();
331331
startQuad = &(batchQuads[_atlasIndex]);
332332
pos = _position;
333333
}
@@ -352,7 +352,7 @@ void ParticleSystemQuad::updateParticleQuads()
352352
float* sr = _particleData.staticRotation;
353353
float* sid = _particleData.scaleInDelta;
354354
float* sil = _particleData.scaleInLength;
355-
V3F_C4F_T2F_Quad* quadStart = startQuad;
355+
V3F_T2F_C4F_Quad* quadStart = startQuad;
356356
if (_isScaleInAllocated)
357357
{
358358
for (int i = 0; i < _particleCount;
@@ -393,7 +393,7 @@ void ParticleSystemQuad::updateParticleQuads()
393393
float* sr = _particleData.staticRotation;
394394
float* sid = _particleData.scaleInDelta;
395395
float* sil = _particleData.scaleInLength;
396-
V3F_C4F_T2F_Quad* quadStart = startQuad;
396+
V3F_T2F_C4F_Quad* quadStart = startQuad;
397397
if (_isScaleInAllocated)
398398
{
399399
for (int i = 0; i < _particleCount;
@@ -430,7 +430,7 @@ void ParticleSystemQuad::updateParticleQuads()
430430
float* sr = _particleData.staticRotation;
431431
float* sid = _particleData.scaleInDelta;
432432
float* sil = _particleData.scaleInLength;
433-
V3F_C4F_T2F_Quad* quadStart = startQuad;
433+
V3F_T2F_C4F_Quad* quadStart = startQuad;
434434
if (_isScaleInAllocated)
435435
{
436436
for (int i = 0; i < _particleCount;
@@ -450,7 +450,7 @@ void ParticleSystemQuad::updateParticleQuads()
450450
}
451451
}
452452

453-
V3F_C4F_T2F_Quad* quad = startQuad;
453+
V3F_T2F_C4F_Quad* quad = startQuad;
454454
float* r = _particleData.colorR;
455455
float* g = _particleData.colorG;
456456
float* b = _particleData.colorB;
@@ -628,7 +628,7 @@ void ParticleSystemQuad::updateParticleQuads()
628628
// It was proved to be effective especially for low-end devices.
629629
if ((_isLifeAnimated || _isEmitterAnimated || _isLoopAnimated) && _isAnimAllocated)
630630
{
631-
V3F_C4F_T2F_Quad* quad = startQuad;
631+
V3F_T2F_C4F_Quad* quad = startQuad;
632632
unsigned short* cellIndex = _particleData.animCellIndex;
633633

634634
ParticleFrameDescriptor index;
@@ -700,7 +700,7 @@ void ParticleSystemQuad::setTotalParticles(int tp)
700700
AXLOGW("Particle system: not enough memory");
701701
return;
702702
}
703-
V3F_C4F_T2F_Quad* quadsNew = (V3F_C4F_T2F_Quad*)realloc(_quads, quadsSize);
703+
V3F_T2F_C4F_Quad* quadsNew = (V3F_T2F_C4F_Quad*)realloc(_quads, quadsSize);
704704
unsigned short* indicesNew = (unsigned short*)realloc(_indices, indicesSize);
705705

706706
if (quadsNew && indicesNew)
@@ -780,7 +780,7 @@ bool ParticleSystemQuad::allocMemory()
780780
AX_SAFE_FREE(_quads);
781781
AX_SAFE_FREE(_indices);
782782

783-
_quads = (V3F_C4F_T2F_Quad*)malloc(_totalParticles * sizeof(V3F_C4F_T2F_Quad));
783+
_quads = (V3F_T2F_C4F_Quad*)malloc(_totalParticles * sizeof(V3F_T2F_C4F_Quad));
784784
_indices = (unsigned short*)malloc(_totalParticles * 6 * sizeof(unsigned short));
785785

786786
if (!_quads || !_indices)
@@ -792,7 +792,7 @@ bool ParticleSystemQuad::allocMemory()
792792
return false;
793793
}
794794

795-
memset(_quads, 0, _totalParticles * sizeof(V3F_C4F_T2F_Quad));
795+
memset(_quads, 0, _totalParticles * sizeof(V3F_T2F_C4F_Quad));
796796
memset(_indices, 0, _totalParticles * 6 * sizeof(unsigned short));
797797

798798
return true;
@@ -818,8 +818,8 @@ void ParticleSystemQuad::setBatchNode(ParticleBatchNode* batchNode)
818818
else if (!oldBatch)
819819
{
820820
// copy current state to batch
821-
V3F_C4F_T2F_Quad* batchQuads = _batchNode->getTextureAtlas()->getQuads();
822-
V3F_C4F_T2F_Quad* quad = &(batchQuads[_atlasIndex]);
821+
V3F_T2F_C4F_Quad* batchQuads = _batchNode->getTextureAtlas()->getQuads();
822+
V3F_T2F_C4F_Quad* quad = &(batchQuads[_atlasIndex]);
823823
memcpy(quad, _quads, _totalParticles * sizeof(_quads[0]));
824824

825825
AX_SAFE_FREE(_quads);

0 commit comments

Comments
 (0)