Skip to content

Commit 476bf4d

Browse files
committed
Fixup merge issue cause compile errors
1 parent eac6d86 commit 476bf4d

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

core/2d/DrawNode.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -1179,17 +1179,16 @@ void DrawNode::_drawSegment(const Vec2& from,
11791179
}
11801180
}
11811181
// Internal function _drawLine => thickness is always 1 (fastes way to draw a line)
1182-
void DrawNode::_drawLine(const Vec2& from, const Vec2& to, const Color4B& color)
1182+
void DrawNode::_drawLine(const Vec2& from, const Vec2& to, const Color& color)
11831183
{
11841184
Vec2 vertices[2] = {from, to};
11851185
applyTransform(vertices, vertices, 2);
11861186

1187-
1188-
auto line = expandBufferAndGetPointer(_lines, 2);
1187+
auto line = expandBufferAndGetPointer(_lines, 2);
11891188
_linesDirty = true;
11901189

1191-
line[0] = {vertices[0], color, Vec2::ZERO};
1192-
line[1] = {vertices[1], color, Vec2::ZERO};
1190+
line[0] = {vertices[0], Vec2::ZERO, color};
1191+
line[1] = {vertices[1], Vec2::ZERO, color};
11931192
}
11941193

11951194
void DrawNode::_drawDot(const Vec2& pos, float radius, const Color& color)

core/2d/DrawNode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ class AX_DLL DrawNode : public Node
634634
bool isconvex = true);
635635

636636
// Internal function _drawLine
637-
void _drawLine(const Vec2& from, const Vec2& to, const Color4B& color);
637+
void _drawLine(const Vec2& from, const Vec2& to, const Color& color);
638638

639639
// Internal function _drawSegment
640640
void _drawSegment(const Vec2& origin,

core/2d/Label.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1728,8 +1728,8 @@ void Label::updateContent()
17281728

17291729
if (_lineDrawNode)
17301730
{
1731-
Color4B lineColor = Color4B(_displayedColor);
1732-
if (_textColor != Color4B::WHITE && _textColor != lineColor)
1731+
Color32 lineColor = Color32(_displayedColor);
1732+
if (_textColor != Color32::WHITE && _textColor != lineColor)
17331733
lineColor = _textColor;
17341734

17351735
_lineDrawNode->clear();

tests/cpp-tests/Source/DrawNodeTest/DrawNodeTest.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1929,9 +1929,9 @@ void DrawNodeLineDrawTest::update(float dt)
19291929
float x = radius * cosf(rads) + center.x;
19301930
float y = radius * sinf(rads) + center.y;
19311931

1932-
drawNode->drawLine(center - Vec2(20, 40), Vec2(x, y)- Vec2(20, 40), Color4F::RED, sliderValue[sliderType::Thickness]);
1933-
drawNode->drawLine(center + Vec2(120, 20), Vec2(x, y) + Vec2(120,20), Color4F::BLUE, sliderValue[sliderType::Thickness]);
1934-
drawNode->drawLine(center - Vec2(130, 110),Vec2(x,y) - Vec2(130,110), Color4F::GREEN, sliderValue[sliderType::Thickness]);
1932+
drawNode->drawLine(center - Vec2(20, 40), Vec2(x, y)- Vec2(20, 40), Color::RED, sliderValue[sliderType::Thickness]);
1933+
drawNode->drawLine(center + Vec2(120, 20), Vec2(x, y) + Vec2(120,20), Color::BLUE, sliderValue[sliderType::Thickness]);
1934+
drawNode->drawLine(center - Vec2(130, 110),Vec2(x,y) - Vec2(130,110), Color::GREEN, sliderValue[sliderType::Thickness]);
19351935
}
19361936
}
19371937

tests/cpp-tests/Source/LabelTest/LabelTestNew.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -3316,8 +3316,8 @@ LabelUnderlineStrikethroughMultiline::LabelUnderlineStrikethroughMultiline()
33163316
// Glow SDF (GPU)
33173317
auto label1 = Label::createWithTTF(ttfConf, "Glow1", TextHAlignment::CENTER, s.width);
33183318
label1->setPosition(Vec2(s.width / 2, s.height * 0.7));
3319-
label1->setTextColor(Color4B::GREEN);
3320-
label1->enableGlow(Color4B::YELLOW);
3319+
label1->setTextColor(Color32::GREEN);
3320+
label1->enableGlow(Color32::YELLOW);
33213321
label1->enableUnderline();
33223322
label1->enableStrikethrough();
33233323
addChild(label1);
@@ -3326,8 +3326,8 @@ LabelUnderlineStrikethroughMultiline::LabelUnderlineStrikethroughMultiline()
33263326
ttfConf.distanceFieldEnabled = false;
33273327
auto label2 = Label::createWithTTF(ttfConf, "Glow2", TextHAlignment::CENTER, s.width);
33283328
label2->setPosition(Vec2(s.width / 2, s.height * 0.6));
3329-
label2->setTextColor(Color4B::GREEN);
3330-
label2->enableGlow(Color4B::YELLOW);
3329+
label2->setTextColor(Color32::GREEN);
3330+
label2->enableGlow(Color32::YELLOW);
33313331
label2->enableUnderline();
33323332
label2->enableStrikethrough();
33333333
addChild(label2);
@@ -3337,8 +3337,8 @@ LabelUnderlineStrikethroughMultiline::LabelUnderlineStrikethroughMultiline()
33373337
ttfConf.outlineSize = 2;
33383338
auto label3 = Label::createWithTTF(ttfConf, "Outline1", TextHAlignment::CENTER, s.width);
33393339
label3->setPosition(Vec2(s.width / 2, s.height * 0.48));
3340-
label3->setTextColor(Color4B::RED);
3341-
label3->enableOutline(Color4B::BLUE);
3340+
label3->setTextColor(Color32::RED);
3341+
label3->enableOutline(Color32::BLUE);
33423342
label3->enableUnderline();
33433343
label3->enableStrikethrough();
33443344
addChild(label3);
@@ -3348,8 +3348,8 @@ LabelUnderlineStrikethroughMultiline::LabelUnderlineStrikethroughMultiline()
33483348
ttfConf.outlineSize = 2;
33493349
auto label4 = Label::createWithTTF(ttfConf, "Outline2", TextHAlignment::CENTER, s.width);
33503350
label4->setPosition(Vec2(s.width / 2, s.height * 0.36));
3351-
label4->setTextColor(Color4B::RED);
3352-
label4->enableOutline(Color4B::BLUE, 2);
3351+
label4->setTextColor(Color32::RED);
3352+
label4->enableOutline(Color32::BLUE, 2);
33533353
label4->enableUnderline();
33543354
label4->enableStrikethrough();
33553355
addChild(label4);
@@ -3365,29 +3365,29 @@ LabelUnderlineStrikethroughMultiline::LabelUnderlineStrikethroughMultiline()
33653365
Label* labels[count];
33663366

33673367
labels[0] = Label::createWithSystemFont("SystemFont TextVAlignment::TOP\nusing setTextColor(255, 0, 255, 100)", font, 14, Vec2::ZERO, TextHAlignment::LEFT, TextVAlignment::TOP);
3368-
labels[0]->setTextColor(Color4B(255, 0, 255, 100));
3369-
labels[0]->enableGlow(Color4B::BLUE);
3368+
labels[0]->setTextColor(Color32(255, 0, 255, 100));
3369+
labels[0]->enableGlow(Color32::BLUE);
33703370

33713371
labels[1] = Label::createWithSystemFont("SystemFont TextVAlignment::CENTER\nusing setColor(*RED*)", font, 14, Vec2::ZERO, TextHAlignment::RIGHT, TextVAlignment::CENTER);
33723372
labels[1]->setColor(Color3B::RED);
33733373

33743374
labels[2] = Label::createWithSystemFont("SystemFont TextVAlignment::BOTTOM\nusingsetTextColor(*YELLOW)", font, 14,
33753375
Vec2::ZERO, TextHAlignment::CENTER, TextVAlignment::BOTTOM);
3376-
labels[2]->setTextColor(Color4B::YELLOW);
3376+
labels[2]->setTextColor(Color32::YELLOW);
33773377

33783378
labels[3] = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "BMFont\nwith default color", TextHAlignment::CENTER, s.width);
33793379

33803380
labels[4] = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "BMFont\nusing setTextColor(0, 255, 0, 100)",
33813381
TextHAlignment::CENTER, s.width);
3382-
labels[4]->setTextColor(Color4B(0, 255, 0, 100));
3382+
labels[4]->setTextColor(Color32(0, 255, 0, 100));
33833383

33843384
labels[5] = Label::createWithTTF(ttfConfig, "TTF setColor(*BLUE*)\nwith multiline 1\nand a much more longer multiline 2",
33853385
TextHAlignment::LEFT, s.width);
33863386
labels[5]->setColor(Color3B::BLUE);
33873387

33883388
labels[6] = Label::createWithTTF("TTF setTextColor(*RED*)\nwith multiline 1\nand a much more longer multiline 2",
33893389
font, 14);
3390-
labels[6]->setTextColor(Color4B::RED);
3390+
labels[6]->setTextColor(Color32::RED);
33913391

33923392
for (int i = 0; i < count; i++)
33933393
{

0 commit comments

Comments
 (0)