Skip to content

Commit d6aeb84

Browse files
committed
All typo: ax::Color4F ==> ax::Color
1 parent 06ba9c5 commit d6aeb84

File tree

30 files changed

+156
-158
lines changed

30 files changed

+156
-158
lines changed

core/math/Color.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct AX_DLL Color4B
118118

119119
/**
120120
* RGBA color composed of 4 floats.
121-
* @since v3.0
121+
* @since v3.0, renamed from Color4F
122122
*/
123123
struct AX_DLL Color : public Vec4Adapter<Color>
124124
{
@@ -161,7 +161,6 @@ struct AX_DLL Color : public Vec4Adapter<Color>
161161
static const Color GRAY;
162162
static const Color TRANSPARENT; // TRANSPARENT is defined on wingdi.h /*Background Modes*/
163163
};
164-
using Color4F = Color; // DEPRECATED
165164

166165
/**
167166
* Hue Saturation Value color space composed of 4 floats.

extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ ModelRef ProceduralModelGenerator::Generate(const ProceduralModelParameter& para
885885
generator.Rotator = primitiveGenerator;
886886
generator.Noise = noiseFunc;
887887
generator.CrossSectionType = parameter.Ribbon.CrossSection;
888-
generator.position = parameter.Ribbon.position;
888+
generator.Vertices = parameter.Ribbon.Vertices;
889889
generator.Rotate = parameter.Ribbon.Rotate;
890890
generator.Count = parameter.Ribbon.Count;
891891
generator.RibbonSizes = parameter.Ribbon.RibbonSizes;
@@ -923,4 +923,4 @@ void ProceduralModelGenerator::Ungenerate(ModelRef model)
923923
{
924924
}
925925

926-
} // namespace Effekseer
926+
} // namespace Effekseer

extensions/Effekseer/Effekseer/Effekseer/Model/ProceduralModelParameter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ struct ProceduralModelParameter
189189
if (Ribbon.Rotate != rhs.Ribbon.Rotate)
190190
return Ribbon.Rotate < rhs.Ribbon.Rotate;
191191

192-
if (Ribbon.position != rhs.Ribbon.position)
193-
return Ribbon.position < rhs.Ribbon.position;
192+
if (Ribbon.Vertices != rhs.Ribbon.Vertices)
193+
return Ribbon.Vertices < rhs.Ribbon.Vertices;
194194

195195
if (Ribbon.RibbonSizes != rhs.Ribbon.RibbonSizes)
196196
return Ribbon.RibbonSizes < rhs.Ribbon.RibbonSizes;
@@ -366,7 +366,7 @@ struct ProceduralModelParameter
366366
{
367367
reader.Read(Ribbon.CrossSection);
368368
reader.Read(Ribbon.Rotate);
369-
reader.Read(Ribbon.position);
369+
reader.Read(Ribbon.Vertices);
370370
reader.Read(Ribbon.RibbonSizes);
371371
reader.Read(Ribbon.RibbonAngles);
372372
reader.Read(Ribbon.RibbonNoises);
@@ -471,4 +471,4 @@ struct ProceduralModelParameter
471471

472472
} // namespace Effekseer
473473

474-
#endif
474+
#endif

tests/cpp-tests/Source/ActionsTest/ActionsTest.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ void ActionFollow::onEnter()
12441244
float y = s.height;
12451245

12461246
Vec2 vertices[] = {Vec2(5.0f, 5.0f), Vec2(x - 5, 5.0f), Vec2(x - 5, y - 5), Vec2(5.0f, y - 5)};
1247-
drawNode->drawPoly(vertices, 4, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f));
1247+
drawNode->drawPoly(vertices, 4, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f));
12481248

12491249
this->addChild(drawNode);
12501250

@@ -1281,7 +1281,7 @@ void ActionFollowWithOffset::onEnter()
12811281
float y = s.height;
12821282

12831283
Vec2 vertices[] = {Vec2(5.0f, 5.0f), Vec2(x - 5, 5.0f), Vec2(x - 5, y - 5), Vec2(5.0f, y - 5)};
1284-
drawNode->drawPoly(vertices, 4, true, Color4F(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f));
1284+
drawNode->drawPoly(vertices, 4, true, Color(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), 1.0f));
12851285

12861286
this->addChild(drawNode);
12871287

@@ -1523,7 +1523,7 @@ void ActionCatmullRomStacked::onEnter()
15231523

15241524
auto drawNode1 = DrawNode::create();
15251525
drawNode1->setPosition(Vec2(50.0f, 50.0f));
1526-
drawNode1->drawCatmullRom(array, 50, Color4F(1.0f, 1.0f, 0.0f, 0.5f));
1526+
drawNode1->drawCatmullRom(array, 50, Color(1.0f, 1.0f, 0.0f, 0.5f));
15271527
this->addChild(drawNode1);
15281528

15291529
//
@@ -1552,7 +1552,7 @@ void ActionCatmullRomStacked::onEnter()
15521552
MoveBy::create(0.05f, Vec2(-10.0f, 0.0f)), nullptr)));
15531553

15541554
auto drawNode2 = DrawNode::create();
1555-
drawNode2->drawCatmullRom(array2, 50, Color4F(1.0, 0.0, 0.0, 0.5));
1555+
drawNode2->drawCatmullRom(array2, 50, Color(1.0, 0.0, 0.0, 0.5));
15561556
this->addChild(drawNode2);
15571557
}
15581558

@@ -1605,7 +1605,7 @@ void ActionCardinalSplineStacked::onEnter()
16051605

16061606
auto drawNode1 = DrawNode::create();
16071607
drawNode1->setPosition(Vec2(50.0f, 50.0f));
1608-
drawNode1->drawCardinalSpline(array, 0, 100, Color4F(1.0f, 0.0f, 1.0f, 1.0f));
1608+
drawNode1->drawCardinalSpline(array, 0, 100, Color(1.0f, 0.0f, 1.0f, 1.0f));
16091609
this->addChild(drawNode1);
16101610

16111611
//
@@ -1628,7 +1628,7 @@ void ActionCardinalSplineStacked::onEnter()
16281628

16291629
auto drawNode2 = DrawNode::create();
16301630
drawNode2->setPosition(Vec2(s.width / 2, 50.0f));
1631-
drawNode2->drawCardinalSpline(array, 1, 100, Color4F(0.0f, 0.0f, 1.0f, 1.0f));
1631+
drawNode2->drawCardinalSpline(array, 1, 100, Color(0.0f, 0.0f, 1.0f, 1.0f));
16321632
this->addChild(drawNode2);
16331633
}
16341634

@@ -1950,7 +1950,7 @@ void ActionCatmullRom::onEnter()
19501950

19511951
auto drawNode1 = DrawNode::create();
19521952
drawNode1->setPosition(Vec2(50.0f, 50.0f));
1953-
drawNode1->drawCatmullRom(array, 50, Color4F(1.0f, 0.0f, 1.0f, 1.0f));
1953+
drawNode1->drawCatmullRom(array, 50, Color(1.0f, 0.0f, 1.0f, 1.0f));
19541954
this->addChild(drawNode1);
19551955

19561956
//
@@ -1976,7 +1976,7 @@ void ActionCatmullRom::onEnter()
19761976
_kathia->runAction(seq2);
19771977

19781978
auto drawNode2 = DrawNode::create();
1979-
drawNode2->drawCatmullRom(array2, 50, Color4F(0.0f, 1.0f, 1.0f, 1.0f));
1979+
drawNode2->drawCatmullRom(array2, 50, Color(0.0f, 1.0f, 1.0f, 1.0f));
19801980
this->addChild(drawNode2);
19811981
}
19821982

@@ -2026,7 +2026,7 @@ void ActionCardinalSpline::onEnter()
20262026

20272027
auto drawNode1 = DrawNode::create();
20282028
drawNode1->setPosition(Vec2(50.0f, 50.0f));
2029-
drawNode1->drawCardinalSpline(array, 0, 100, Color4F(1.0f, 0.0f, 1.0f, 1.0f));
2029+
drawNode1->drawCardinalSpline(array, 0, 100, Color(1.0f, 0.0f, 1.0f, 1.0f));
20302030
this->addChild(drawNode1);
20312031

20322032
//
@@ -2045,7 +2045,7 @@ void ActionCardinalSpline::onEnter()
20452045

20462046
auto drawNode2 = DrawNode::create();
20472047
drawNode2->setPosition(Vec2(s.width / 2, 50.0f));
2048-
drawNode2->drawCardinalSpline(array, 1, 100, Color4F(1.0f, 0.0f, 1.0f, 1.0f));
2048+
drawNode2->drawCardinalSpline(array, 1, 100, Color(1.0f, 0.0f, 1.0f, 1.0f));
20492049
this->addChild(drawNode2);
20502050
}
20512051

tests/cpp-tests/Source/Box2DTestBed/Box2DTestDebugDrawNode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ struct CircleData
99
{
1010
b2Vec2 position;
1111
float radius;
12-
ax::Color4F rgba;
12+
ax::Color rgba;
1313
};
1414

1515
struct SolidCircleData
1616
{
1717
b2Transform transform;
1818
float radius;
19-
ax::Color4F rgba;
19+
ax::Color rgba;
2020
};
2121

2222
struct CapsuleData
2323
{
2424
b2Transform transform;
2525
float radius;
2626
float length;
27-
ax::Color4F rgba;
27+
ax::Color rgba;
2828
};
2929

3030
class Box2DTestDebugDrawNode : public ax::extension::PhysicsDebugNode

tests/cpp-tests/Source/BugsTest/Bug-12847.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ void Bug12847Layer::update(float dt)
9797
void Bug12847Layer::onEnter()
9898
{
9999
BugsTestBase::onEnter();
100-
Director::getInstance()->setClearColor(Color4F::RED);
100+
Director::getInstance()->setClearColor(Color::RED);
101101
}
102102

103103
void Bug12847Layer::onExit()
104104
{
105-
Director::getInstance()->setClearColor(Color4F::BLACK);
105+
Director::getInstance()->setClearColor(Color::BLACK);
106106
BugsTestBase::onExit();
107107
}

tests/cpp-tests/Source/BugsTest/Bug-DrawNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ bool BugDrawNodeLayer::init()
4949
addChild(testSprite);
5050

5151
auto drawNode = DrawNode::create();
52-
drawNode->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color4F(1, 0, 0, 0.5f));
52+
drawNode->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color(1, 0, 0, 0.5f));
5353
Vec2 point = Vec2(size.width / 2, size.height / 2);
54-
drawNode->drawPoint(point, 8, Color4F(1, 0, 0, 0.5f));
54+
drawNode->drawPoint(point, 8, Color(1, 0, 0, 0.5f));
5555
addChild(drawNode);
5656

5757
auto label = Label::create();

tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -360,16 +360,16 @@ void Camera3DTestDemo::onEnter()
360360
// draw x
361361
for (int j = -20; j <= 20; j++)
362362
{
363-
line->drawLine(Vec3(-100.0f, 0.0f, 5.0f * j), Vec3(100.0f, 0.0f, 5.0f * j), Color4F(1, 0, 0, 1));
363+
line->drawLine(Vec3(-100.0f, 0.0f, 5.0f * j), Vec3(100.0f, 0.0f, 5.0f * j), Color(1, 0, 0, 1));
364364
}
365365
// draw z
366366
for (int j = -20; j <= 20; j++)
367367
{
368-
line->drawLine(Vec3(5.0f * j, 0.0f, -100.0f), Vec3(5.0f * j, 0.0f, 100.0f), Color4F(0, 0, 1, 1));
368+
line->drawLine(Vec3(5.0f * j, 0.0f, -100.0f), Vec3(5.0f * j, 0.0f, 100.0f), Color(0, 0, 1, 1));
369369
}
370370
// draw y
371-
line->drawLine(Vec3(0.0f, -50.0f, 0.0f), Vec3(0, 0, 0), Color4F(0, 0.5, 0, 1));
372-
line->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color4F(0, 1, 0, 1));
371+
line->drawLine(Vec3(0.0f, -50.0f, 0.0f), Vec3(0, 0, 0), Color(0, 0.5, 0, 1));
372+
line->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color(0, 1, 0, 1));
373373
_layer3D->addChild(line);
374374

375375
_layer3D->setCameraMask(2);
@@ -809,7 +809,7 @@ void CameraCullingDemo::update(float dt)
809809
if (_cameraFirst->isVisibleInFrustum(&aabb))
810810
{
811811
aabb.getCorners(corners);
812-
_drawAABB->drawCube(corners, Color4F(0, 1, 0, 1));
812+
_drawAABB->drawCube(corners, Color(0, 1, 0, 1));
813813
}
814814
}
815815
}
@@ -934,7 +934,7 @@ void CameraCullingDemo::drawCameraFrustum()
934934
_drawFrustum->clear();
935935
auto size = Director::getInstance()->getWinSize();
936936

937-
Color4F color(1.f, 1.f, 0.f, 1);
937+
Color color(1.f, 1.f, 0.f, 1);
938938

939939
// top-left
940940
Vec3 tl_0, tl_1;
@@ -1060,15 +1060,15 @@ void CameraArcBallDemo::onEnter()
10601060
// draw x
10611061
for (int j = -20; j <= 20; j++)
10621062
{
1063-
_drawGrid->drawLine(Vec3(-100.0f, 0, 5.0f * j), Vec3(100.0f, 0, 5.0f * j), Color4F(1, 0, 0, 1));
1063+
_drawGrid->drawLine(Vec3(-100.0f, 0, 5.0f * j), Vec3(100.0f, 0, 5.0f * j), Color(1, 0, 0, 1));
10641064
}
10651065
// draw z
10661066
for (int j = -20; j <= 20; j++)
10671067
{
1068-
_drawGrid->drawLine(Vec3(5.0f * j, 0, -100.0f), Vec3(5.0f * j, 0, 100.0f), Color4F(0, 0, 1, 1));
1068+
_drawGrid->drawLine(Vec3(5.0f * j, 0, -100.0f), Vec3(5.0f * j, 0, 100.0f), Color(0, 0, 1, 1));
10691069
}
10701070
// draw y
1071-
_drawGrid->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color4F(0, 1, 0, 1));
1071+
_drawGrid->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color(0, 1, 0, 1));
10721072
_layer3D->addChild(_drawGrid);
10731073

10741074
_layer3D->setCameraMask(2);
@@ -1221,7 +1221,7 @@ void FogTestDemo::onEnter()
12211221
{
12221222
CameraBaseTest::onEnter();
12231223
schedule(AX_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f);
1224-
Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1));
1224+
Director::getInstance()->setClearColor(Color(0.5, 0.5, 0.5, 1));
12251225

12261226
auto s = Director::getInstance()->getWinSize();
12271227
auto listener = EventListenerTouchAllAtOnce::create();
@@ -1296,7 +1296,7 @@ void FogTestDemo::onEnter()
12961296

12971297
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
12981298
_backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) {
1299-
Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1));
1299+
Director::getInstance()->setClearColor(Color(0.5, 0.5, 0.5, 1));
13001300
AX_SAFE_RELEASE_NULL(_programState1);
13011301
AX_SAFE_RELEASE_NULL(_programState2);
13021302

@@ -1360,7 +1360,7 @@ void FogTestDemo::switchTypeCallback(Object* sender, int type)
13601360
void FogTestDemo::onExit()
13611361
{
13621362
CameraBaseTest::onExit();
1363-
Director::getInstance()->setClearColor(Color4F(0, 0, 0, 1));
1363+
Director::getInstance()->setClearColor(Color(0, 0, 0, 1));
13641364
if (_camera)
13651365
{
13661366
_camera = nullptr;
@@ -1460,7 +1460,7 @@ void FogTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event*
14601460
// camera->setCameraFlag(CameraFlag::USER1);
14611461
// camera->setDepth(-1);
14621462
// camera->setFrameBufferObject(fbo);
1463-
// fbo->setClearColor(Color4F(1,1,1,1));
1463+
// fbo->setClearColor(Color(1,1,1,1));
14641464
// addChild(camera);
14651465
// }
14661466

@@ -1511,7 +1511,7 @@ void BackgroundColorBrushTest::onEnter()
15111511

15121512
// 2nd Camera
15131513
auto camera = Camera::createPerspective(60, (float)s.width / s.height, 1, 1000);
1514-
auto colorBrush = CameraBackgroundBrush::createColorBrush(Color4F(.1f, .1f, 1.f, .5f), 1.f);
1514+
auto colorBrush = CameraBackgroundBrush::createColorBrush(Color(.1f, .1f, 1.f, .5f), 1.f);
15151515
camera->setBackgroundBrush(colorBrush);
15161516
camera->setPosition3D(Vec3(0.0f, 0.0f, 200.0f));
15171517
camera->lookAt(Vec3::ZERO);
@@ -1527,7 +1527,7 @@ void BackgroundColorBrushTest::onEnter()
15271527
slider->setPosition(Vec2(s.width / 2, s.height / 4));
15281528
slider->setPercent(50);
15291529
slider->addEventListener([slider, colorBrush](Object*, ui::Slider::EventType) {
1530-
colorBrush->setColor(Color4F(.1f, .1f, 1.f, (float)slider->getPercent() / 100.f));
1530+
colorBrush->setColor(Color(.1f, .1f, 1.f, (float)slider->getPercent() / 100.f));
15311531
});
15321532
addChild(slider);
15331533

tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ DrawNode* BasicTest::shape()
152152
triangle[1] = Vec2(100, -100);
153153
triangle[2] = Vec2(0, 100);
154154

155-
static Color4F green(0, 1, 0, 1);
155+
static Color green(0, 1, 0, 1);
156156
shape->drawPolygon(triangle, 3, green, 0, green);
157157
return shape;
158158
}
@@ -464,7 +464,7 @@ void ScrollViewDemo::setup()
464464
rectangle[2] = Vec2(clipper->getContentSize().width, clipper->getContentSize().height);
465465
rectangle[3] = Vec2(0.0f, clipper->getContentSize().height);
466466

467-
Color4F white(1, 1, 1, 1);
467+
Color white(1, 1, 1, 1);
468468
stencil->drawPolygon(rectangle, 4, white, 1, white);
469469
clipper->setStencil(stencil);
470470

@@ -623,7 +623,7 @@ void RawStencilBufferTest::draw(Renderer* renderer, const Mat4& transform, uint3
623623
_sprites.at(i)->setPosition(spritePoint);
624624
_spritesStencil.at(i)->setPosition(spritePoint);
625625

626-
renderer->clear(ClearFlag::STENCIL, Color4F::BLACK, 0.f, 0x0, _globalZOrder);
626+
renderer->clear(ClearFlag::STENCIL, Color::BLACK, 0.f, 0x0, _globalZOrder);
627627

628628
renderer->addCommand(&_renderCmds[cmdIndex]);
629629
cmdIndex++;
@@ -870,7 +870,7 @@ void ClippingToRenderTextureTest::expectedBehaviour()
870870
triangle[0] = Point(-50, -50);
871871
triangle[1] = Point(50, -50);
872872
triangle[2] = Point(0, 50);
873-
Color4F green(0, 1, 0, 1);
873+
Color green(0, 1, 0, 1);
874874
stencil->drawPolygon(triangle, 3, green, 0, green);
875875

876876
auto clipper = ClippingNode::create();
@@ -884,7 +884,7 @@ void ClippingToRenderTextureTest::expectedBehaviour()
884884
triangle[0] = Point(-200, -200);
885885
triangle[1] = Point(200, -200);
886886
triangle[2] = Point(0, 200);
887-
Color4F red(1, 0, 0, 1);
887+
Color red(1, 0, 0, 1);
888888
img->drawPolygon(triangle, 3, red, 0, red);
889889
clipper->addChild(img);
890890
}
@@ -913,7 +913,7 @@ void ClippingToRenderTextureTest::reproduceBug()
913913
triangle[0] = Point(-50, -50);
914914
triangle[1] = Point(50, -50);
915915
triangle[2] = Point(0, 50);
916-
Color4F green(0, 1, 0, 1);
916+
Color green(0, 1, 0, 1);
917917
stencil->drawPolygon(triangle, 3, green, 0, green);
918918

919919
auto clipper = ClippingNode::create();
@@ -927,7 +927,7 @@ void ClippingToRenderTextureTest::reproduceBug()
927927
triangle[0] = Point(-200, -200);
928928
triangle[1] = Point(200, -200);
929929
triangle[2] = Point(0, 200);
930-
Color4F red(1, 0, 0, 1);
930+
Color red(1, 0, 0, 1);
931931
img->drawPolygon(triangle, 3, red, 0, red);
932932
clipper->addChild(img);
933933

0 commit comments

Comments
 (0)