Skip to content

Commit

Permalink
All typo: ax::Color4F ==> ax::Color
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Oct 9, 2024
1 parent c05b010 commit a5a9938
Show file tree
Hide file tree
Showing 32 changed files with 443 additions and 444 deletions.
3 changes: 1 addition & 2 deletions core/math/Color.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct AX_DLL Color4B

/**
* RGBA color composed of 4 floats.
* @since v3.0
* @since v3.0, renamed from Color4F
*/
struct AX_DLL Color : public Vec4Adapter<Color>
{
Expand Down Expand Up @@ -161,7 +161,6 @@ struct AX_DLL Color : public Vec4Adapter<Color>
static const Color GRAY;
static const Color TRANSPARENT; // TRANSPARENT is defined on wingdi.h /*Background Modes*/
};
using Color4F = Color; // DEPRECATED

/**
* Hue Saturation Value color space composed of 4 floats.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ ModelRef ProceduralModelGenerator::Generate(const ProceduralModelParameter& para
generator.Rotator = primitiveGenerator;
generator.Noise = noiseFunc;
generator.CrossSectionType = parameter.Ribbon.CrossSection;
generator.position = parameter.Ribbon.position;
generator.Vertices = parameter.Ribbon.Vertices;
generator.Rotate = parameter.Ribbon.Rotate;
generator.Count = parameter.Ribbon.Count;
generator.RibbonSizes = parameter.Ribbon.RibbonSizes;
Expand Down Expand Up @@ -923,4 +923,4 @@ void ProceduralModelGenerator::Ungenerate(ModelRef model)
{
}

} // namespace Effekseer
} // namespace Effekseer
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ struct ProceduralModelParameter
if (Ribbon.Rotate != rhs.Ribbon.Rotate)
return Ribbon.Rotate < rhs.Ribbon.Rotate;

if (Ribbon.position != rhs.Ribbon.position)
return Ribbon.position < rhs.Ribbon.position;
if (Ribbon.Vertices != rhs.Ribbon.Vertices)
return Ribbon.Vertices < rhs.Ribbon.Vertices;

if (Ribbon.RibbonSizes != rhs.Ribbon.RibbonSizes)
return Ribbon.RibbonSizes < rhs.Ribbon.RibbonSizes;
Expand Down Expand Up @@ -366,7 +366,7 @@ struct ProceduralModelParameter
{
reader.Read(Ribbon.CrossSection);
reader.Read(Ribbon.Rotate);
reader.Read(Ribbon.position);
reader.Read(Ribbon.Vertices);
reader.Read(Ribbon.RibbonSizes);
reader.Read(Ribbon.RibbonAngles);
reader.Read(Ribbon.RibbonNoises);
Expand Down Expand Up @@ -471,4 +471,4 @@ struct ProceduralModelParameter

} // namespace Effekseer

#endif
#endif
20 changes: 10 additions & 10 deletions tests/cpp-tests/Source/ActionsTest/ActionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ void ActionFollow::onEnter()
float y = s.height;

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

this->addChild(drawNode);

Expand Down Expand Up @@ -1281,7 +1281,7 @@ void ActionFollowWithOffset::onEnter()
float y = s.height;

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

this->addChild(drawNode);

Expand Down Expand Up @@ -1523,7 +1523,7 @@ void ActionCatmullRomStacked::onEnter()

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

//
Expand Down Expand Up @@ -1552,7 +1552,7 @@ void ActionCatmullRomStacked::onEnter()
MoveBy::create(0.05f, Vec2(-10.0f, 0.0f)), nullptr)));

auto drawNode2 = DrawNode::create();
drawNode2->drawCatmullRom(array2, 50, Color4F(1.0, 0.0, 0.0, 0.5));
drawNode2->drawCatmullRom(array2, 50, Color(1.0, 0.0, 0.0, 0.5));
this->addChild(drawNode2);
}

Expand Down Expand Up @@ -1605,7 +1605,7 @@ void ActionCardinalSplineStacked::onEnter()

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

//
Expand All @@ -1628,7 +1628,7 @@ void ActionCardinalSplineStacked::onEnter()

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

Expand Down Expand Up @@ -1950,7 +1950,7 @@ void ActionCatmullRom::onEnter()

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

//
Expand All @@ -1976,7 +1976,7 @@ void ActionCatmullRom::onEnter()
_kathia->runAction(seq2);

auto drawNode2 = DrawNode::create();
drawNode2->drawCatmullRom(array2, 50, Color4F(0.0f, 1.0f, 1.0f, 1.0f));
drawNode2->drawCatmullRom(array2, 50, Color(0.0f, 1.0f, 1.0f, 1.0f));
this->addChild(drawNode2);
}

Expand Down Expand Up @@ -2026,7 +2026,7 @@ void ActionCardinalSpline::onEnter()

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

//
Expand All @@ -2045,7 +2045,7 @@ void ActionCardinalSpline::onEnter()

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

Expand Down
6 changes: 3 additions & 3 deletions tests/cpp-tests/Source/Box2DTestBed/Box2DTestDebugDrawNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ struct CircleData
{
b2Vec2 position;
float radius;
ax::Color4F rgba;
ax::Color rgba;
};

struct SolidCircleData
{
b2Transform transform;
float radius;
ax::Color4F rgba;
ax::Color rgba;
};

struct CapsuleData
{
b2Transform transform;
float radius;
float length;
ax::Color4F rgba;
ax::Color rgba;
};

class Box2DTestDebugDrawNode : public ax::extension::PhysicsDebugNode
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Source/BugsTest/Bug-12847.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ void Bug12847Layer::update(float dt)
void Bug12847Layer::onEnter()
{
BugsTestBase::onEnter();
Director::getInstance()->setClearColor(Color4F::RED);
Director::getInstance()->setClearColor(Color::RED);
}

void Bug12847Layer::onExit()
{
Director::getInstance()->setClearColor(Color4F::BLACK);
Director::getInstance()->setClearColor(Color::BLACK);
BugsTestBase::onExit();
}
4 changes: 2 additions & 2 deletions tests/cpp-tests/Source/BugsTest/Bug-DrawNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ bool BugDrawNodeLayer::init()
addChild(testSprite);

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

auto label = Label::create();
Expand Down
30 changes: 15 additions & 15 deletions tests/cpp-tests/Source/Camera3DTest/Camera3DTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,16 +360,16 @@ void Camera3DTestDemo::onEnter()
// draw x
for (int j = -20; j <= 20; j++)
{
line->drawLine(Vec3(-100.0f, 0.0f, 5.0f * j), Vec3(100.0f, 0.0f, 5.0f * j), Color4F(1, 0, 0, 1));
line->drawLine(Vec3(-100.0f, 0.0f, 5.0f * j), Vec3(100.0f, 0.0f, 5.0f * j), Color(1, 0, 0, 1));
}
// draw z
for (int j = -20; j <= 20; j++)
{
line->drawLine(Vec3(5.0f * j, 0.0f, -100.0f), Vec3(5.0f * j, 0.0f, 100.0f), Color4F(0, 0, 1, 1));
line->drawLine(Vec3(5.0f * j, 0.0f, -100.0f), Vec3(5.0f * j, 0.0f, 100.0f), Color(0, 0, 1, 1));
}
// draw y
line->drawLine(Vec3(0.0f, -50.0f, 0.0f), Vec3(0, 0, 0), Color4F(0, 0.5, 0, 1));
line->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color4F(0, 1, 0, 1));
line->drawLine(Vec3(0.0f, -50.0f, 0.0f), Vec3(0, 0, 0), Color(0, 0.5, 0, 1));
line->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color(0, 1, 0, 1));
_layer3D->addChild(line);

_layer3D->setCameraMask(2);
Expand Down Expand Up @@ -809,7 +809,7 @@ void CameraCullingDemo::update(float dt)
if (_cameraFirst->isVisibleInFrustum(&aabb))
{
aabb.getCorners(corners);
_drawAABB->drawCube(corners, Color4F(0, 1, 0, 1));
_drawAABB->drawCube(corners, Color(0, 1, 0, 1));
}
}
}
Expand Down Expand Up @@ -934,7 +934,7 @@ void CameraCullingDemo::drawCameraFrustum()
_drawFrustum->clear();
auto size = Director::getInstance()->getWinSize();

Color4F color(1.f, 1.f, 0.f, 1);
Color color(1.f, 1.f, 0.f, 1);

// top-left
Vec3 tl_0, tl_1;
Expand Down Expand Up @@ -1060,15 +1060,15 @@ void CameraArcBallDemo::onEnter()
// draw x
for (int j = -20; j <= 20; j++)
{
_drawGrid->drawLine(Vec3(-100.0f, 0, 5.0f * j), Vec3(100.0f, 0, 5.0f * j), Color4F(1, 0, 0, 1));
_drawGrid->drawLine(Vec3(-100.0f, 0, 5.0f * j), Vec3(100.0f, 0, 5.0f * j), Color(1, 0, 0, 1));
}
// draw z
for (int j = -20; j <= 20; j++)
{
_drawGrid->drawLine(Vec3(5.0f * j, 0, -100.0f), Vec3(5.0f * j, 0, 100.0f), Color4F(0, 0, 1, 1));
_drawGrid->drawLine(Vec3(5.0f * j, 0, -100.0f), Vec3(5.0f * j, 0, 100.0f), Color(0, 0, 1, 1));
}
// draw y
_drawGrid->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color4F(0, 1, 0, 1));
_drawGrid->drawLine(Vec3(0, 0, 0), Vec3(0, 50.0f, 0), Color(0, 1, 0, 1));
_layer3D->addChild(_drawGrid);

_layer3D->setCameraMask(2);
Expand Down Expand Up @@ -1221,7 +1221,7 @@ void FogTestDemo::onEnter()
{
CameraBaseTest::onEnter();
schedule(AX_SCHEDULE_SELECTOR(FogTestDemo::update), 0.0f);
Director::getInstance()->setClearColor(Color4F(0.5, 0.5, 0.5, 1));
Director::getInstance()->setClearColor(Color(0.5, 0.5, 0.5, 1));

auto s = Director::getInstance()->getWinSize();
auto listener = EventListenerTouchAllAtOnce::create();
Expand Down Expand Up @@ -1296,7 +1296,7 @@ void FogTestDemo::onEnter()

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

Expand Down Expand Up @@ -1360,7 +1360,7 @@ void FogTestDemo::switchTypeCallback(Object* sender, int type)
void FogTestDemo::onExit()
{
CameraBaseTest::onExit();
Director::getInstance()->setClearColor(Color4F(0, 0, 0, 1));
Director::getInstance()->setClearColor(Color(0, 0, 0, 1));
if (_camera)
{
_camera = nullptr;
Expand Down Expand Up @@ -1460,7 +1460,7 @@ void FogTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event*
// camera->setCameraFlag(CameraFlag::USER1);
// camera->setDepth(-1);
// camera->setFrameBufferObject(fbo);
// fbo->setClearColor(Color4F(1,1,1,1));
// fbo->setClearColor(Color(1,1,1,1));
// addChild(camera);
// }

Expand Down Expand Up @@ -1511,7 +1511,7 @@ void BackgroundColorBrushTest::onEnter()

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

Expand Down
14 changes: 7 additions & 7 deletions tests/cpp-tests/Source/ClippingNodeTest/ClippingNodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ DrawNode* BasicTest::shape()
triangle[1] = Vec2(100, -100);
triangle[2] = Vec2(0, 100);

static Color4F green(0, 1, 0, 1);
static Color green(0, 1, 0, 1);
shape->drawPolygon(triangle, 3, green, 0, green);
return shape;
}
Expand Down Expand Up @@ -464,7 +464,7 @@ void ScrollViewDemo::setup()
rectangle[2] = Vec2(clipper->getContentSize().width, clipper->getContentSize().height);
rectangle[3] = Vec2(0.0f, clipper->getContentSize().height);

Color4F white(1, 1, 1, 1);
Color white(1, 1, 1, 1);
stencil->drawPolygon(rectangle, 4, white, 1, white);
clipper->setStencil(stencil);

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

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

renderer->addCommand(&_renderCmds[cmdIndex]);
cmdIndex++;
Expand Down Expand Up @@ -870,7 +870,7 @@ void ClippingToRenderTextureTest::expectedBehaviour()
triangle[0] = Point(-50, -50);
triangle[1] = Point(50, -50);
triangle[2] = Point(0, 50);
Color4F green(0, 1, 0, 1);
Color green(0, 1, 0, 1);
stencil->drawPolygon(triangle, 3, green, 0, green);

auto clipper = ClippingNode::create();
Expand All @@ -884,7 +884,7 @@ void ClippingToRenderTextureTest::expectedBehaviour()
triangle[0] = Point(-200, -200);
triangle[1] = Point(200, -200);
triangle[2] = Point(0, 200);
Color4F red(1, 0, 0, 1);
Color red(1, 0, 0, 1);
img->drawPolygon(triangle, 3, red, 0, red);
clipper->addChild(img);
}
Expand Down Expand Up @@ -913,7 +913,7 @@ void ClippingToRenderTextureTest::reproduceBug()
triangle[0] = Point(-50, -50);
triangle[1] = Point(50, -50);
triangle[2] = Point(0, 50);
Color4F green(0, 1, 0, 1);
Color green(0, 1, 0, 1);
stencil->drawPolygon(triangle, 3, green, 0, green);

auto clipper = ClippingNode::create();
Expand All @@ -927,7 +927,7 @@ void ClippingToRenderTextureTest::reproduceBug()
triangle[0] = Point(-200, -200);
triangle[1] = Point(200, -200);
triangle[2] = Point(0, 200);
Color4F red(1, 0, 0, 1);
Color red(1, 0, 0, 1);
img->drawPolygon(triangle, 3, red, 0, red);
clipper->addChild(img);

Expand Down
Loading

0 comments on commit a5a9938

Please sign in to comment.