Skip to content

Commit c3b42bb

Browse files
committed
COLOR32 -> RGBAtoColor32
Revert "Renamed COLOR32." This reverts commit d933f86, reversing changes made to 26bb881. Revert "Merge pull request #75 from StarbotArc/main" This reverts commit 64724d7, reversing changes made to d933f86.
1 parent 64724d7 commit c3b42bb

File tree

11 files changed

+66
-66
lines changed

11 files changed

+66
-66
lines changed

src/Core/Draw.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const colorf Colorsf::white = {1, 1, 1, 1};
2929
const colorf Colorsf::black = {0, 0, 0, 1};
3030
const colorf Colorsf::blank = {0, 0, 0, 0};
3131

32-
const color32 Colors::white = COLOR32(255, 255, 255, 255);
33-
const color32 Colors::black = COLOR32(0, 0, 0, 255);
34-
const color32 Colors::blank = COLOR32(0, 0, 0, 0);
32+
const color32 Colors::white = RGBAtoColor32(255, 255, 255, 255);
33+
const color32 Colors::black = RGBAtoColor32(0, 0, 0, 255);
34+
const color32 Colors::blank = RGBAtoColor32(0, 0, 0, 0);
3535

3636
// ================================================================================================
3737
// TileBar.

src/Core/QuadBatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void BatchSprite::draw(QuadBatchT* out, int x, int y, int y2)
8686

8787
void BatchSprite::draw(QuadBatchTC* out, int x, int y, uchar alpha)
8888
{
89-
draw(out, x, y, RGBAtoColor32(255, 255, 255, alpha));
89+
draw(out, x, y, (color32)RGBAtoColor32(255, 255, 255, alpha));
9090
}
9191

9292
void BatchSprite::draw(QuadBatchTC* out, int x, int y, color32 col)

src/Core/TextLayout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,4 +854,4 @@ int Text::getEscapedCharIndex(const char* str, int index)
854854
return offset;
855855
}
856856

857-
};
857+
};

src/Editor/Common.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ color32 ToColor(Difficulty dt)
111111
{
112112
switch(dt)
113113
{
114-
case DIFF_BEGINNER: return COLOR32(16, 222, 255, 255);
115-
case DIFF_EASY: return COLOR32(99, 220, 99, 255);
116-
case DIFF_MEDIUM: return COLOR32(255, 228, 98, 255);
117-
case DIFF_HARD: return COLOR32(255, 98, 97, 255);
118-
case DIFF_CHALLENGE: return COLOR32(109, 142, 210, 255);
114+
case DIFF_BEGINNER: return RGBAtoColor32(16, 222, 255, 255);
115+
case DIFF_EASY: return RGBAtoColor32(99, 220, 99, 255);
116+
case DIFF_MEDIUM: return RGBAtoColor32(255, 228, 98, 255);
117+
case DIFF_HARD: return RGBAtoColor32(255, 98, 97, 255);
118+
case DIFF_CHALLENGE: return RGBAtoColor32(109, 142, 210, 255);
119119
};
120-
return COLOR32(180, 183, 186, 255);
120+
return RGBAtoColor32(180, 183, 186, 255);
121121
}
122122

123123
const char* ToString(SnapType st)

src/Editor/Editor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ void init()
196196
text.font = Font(myFontPath.str(), Text::HINT_AUTO);
197197
text.fontSize = myFontSize;
198198
text.textColor = Colors::white;
199-
text.shadowColor = COLOR32(0, 0, 0, 128);
199+
text.shadowColor = RGBAtoColor32(0, 0, 0, 128);
200200
text.makeDefault();
201201

202202
// Create the text overlay, so other editor components can show HUD messages.
@@ -877,8 +877,8 @@ void updateTitle()
877877
void drawLogo()
878878
{
879879
vec2i size = gSystem->getWindowSize();
880-
Draw::fill({0, 0, size.x, size.y}, COLOR32(38, 38, 38, 255));
881-
Draw::sprite(myLogo, {size.x / 2, size.y / 2}, COLOR32(255, 255, 255, 26));
880+
Draw::fill({0, 0, size.x, size.y}, RGBAtoColor32(38, 38, 38, 255));
881+
Draw::sprite(myLogo, {size.x / 2, size.y / 2}, RGBAtoColor32(255, 255, 255, 26));
882882
}
883883

884884
void tick()

src/Editor/Minimap.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ static const int NUM_PIECES = MAP_HEIGHT / TEXTURE_SIZE;
3434

3535
static const color32 arrowcol[9] =
3636
{
37-
COLOR32(255, 0, 0, 255), // Red.
38-
COLOR32( 12, 74, 206, 255), // Blue.
39-
COLOR32(145, 12, 206, 255), // Purple.
40-
COLOR32(255, 255, 0, 255), // Yellow.
41-
COLOR32(206, 12, 113, 255), // Pink.
42-
COLOR32(247, 148, 29, 255), // Orange.
43-
COLOR32(105, 231, 245, 255), // Teal.
44-
COLOR32( 0, 198, 0, 255), // Green.
45-
COLOR32(132, 132, 132, 255), // Gray.
37+
RGBAtoColor32(255, 0, 0, 255), // Red.
38+
RGBAtoColor32( 12, 74, 206, 255), // Blue.
39+
RGBAtoColor32(145, 12, 206, 255), // Purple.
40+
RGBAtoColor32(255, 255, 0, 255), // Yellow.
41+
RGBAtoColor32(206, 12, 113, 255), // Pink.
42+
RGBAtoColor32(247, 148, 29, 255), // Orange.
43+
RGBAtoColor32(105, 231, 245, 255), // Teal.
44+
RGBAtoColor32( 0, 198, 0, 255), // Green.
45+
RGBAtoColor32(132, 132, 132, 255), // Gray.
4646
};
4747
static const color32 freezecol =
4848
{
49-
COLOR32(64, 128, 0, 255) // Green
49+
RGBAtoColor32(64, 128, 0, 255) // Green
5050
};
5151
static const color32 rollcol =
5252
{
53-
COLOR32(96, 96, 128, 255), // Blue gray
53+
RGBAtoColor32(96, 96, 128, 255), // Blue gray
5454
};
5555
static const color32 minecol =
5656
{
57-
COLOR32(192, 192, 192, 255), // Light gray
57+
RGBAtoColor32(192, 192, 192, 255), // Light gray
5858
};
5959

6060
struct SetPixelData
@@ -141,7 +141,7 @@ void renderNotes(SetPixelData& spd, const int* colx)
141141
color32 color;
142142
if(note.isSelected)
143143
{
144-
color = COLOR32(255, 255, 255, 255);
144+
color = RGBAtoColor32(255, 255, 255, 255);
145145
}
146146
else
147147
{
@@ -163,7 +163,7 @@ void renderNotes(SetPixelData& spd, const int* colx)
163163
color32 color;
164164
if(note.isSelected)
165165
{
166-
color = COLOR32(255, 255, 255, 255);
166+
color = RGBAtoColor32(255, 255, 255, 255);
167167
}
168168
else
169169
{
@@ -434,20 +434,20 @@ void draw()
434434
auto region = gSelection->getSelectedRegion();
435435
double top = gView->rowToOffset(region.beginRow);
436436
double btm = gView->rowToOffset(region.endRow);
437-
drawRegion(rect.x, rect.w, top, btm, COLOR32(153, 255, 153, 153));
437+
drawRegion(rect.x, rect.w, top, btm, RGBAtoColor32(153, 255, 153, 153));
438438
}
439439

440440
// Draw the marker lines for the first and last row.
441441
recti chartRect = myGetChartRect();
442-
Draw::fill(SideT(chartRect, 1), COLOR32(128, 128, 128, 255));
443-
Draw::fill(SideB(chartRect, 1), COLOR32(128, 128, 128, 255));
442+
Draw::fill(SideT(chartRect, 1), RGBAtoColor32(128, 128, 128, 255));
443+
Draw::fill(SideB(chartRect, 1), RGBAtoColor32(128, 128, 128, 255));
444444

445445
// Draw the view range.
446446
if(myNotesH > 0)
447447
{
448448
double top = gView->yToOffset(0);
449449
double btm = gView->yToOffset(gView->getHeight());
450-
drawRegion(rect.x, rect.w, top, btm, COLOR32(255, 204, 102, 128));
450+
drawRegion(rect.x, rect.w, top, btm, RGBAtoColor32(255, 204, 102, 128));
451451
}
452452

453453
// Draw the minimap image.

src/Editor/Notefield.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ bool myShowSongPreview;
145145

146146
NotefieldImpl()
147147
{
148-
mySongBgColor = COLOR32(255, 255, 255, 255);
148+
mySongBgColor = RGBAtoColor32(255, 255, 255, 255);
149149
myBgBrightness = 50;
150150

151151
myShowWaveform = true;
@@ -197,7 +197,7 @@ void onChanges(int changes)
197197
int r = (int)(0.5f * (float)rsum / (float)numPixels);
198198
int g = (int)(0.5f * (float)gsum / (float)numPixels);
199199
int b = (int)(0.5f * (float)bsum / (float)numPixels);
200-
mySongBgColor = COLOR32(r, g, b, 255);
200+
mySongBgColor = RGBAtoColor32(r, g, b, 255);
201201
mySongBg = Texture(img.width, img.height, img.pixels, false, Texture::RGBA);
202202
ImageLoader::release(img);
203203
}
@@ -342,7 +342,7 @@ void drawBackground()
342342
}
343343
else
344344
{
345-
Draw::fill({myX, view.y, myW, view.h}, COLOR32(0, 0, 0, 128));
345+
Draw::fill({myX, view.y, myW, view.h}, RGBAtoColor32(0, 0, 0, 128));
346346
}
347347
}
348348

@@ -469,7 +469,7 @@ void drawStopsAndWarps()
469469
int b = (int)(oy + dy * it->rowTime);
470470
if(validSegmentRegion(t, b, viewTop, viewBtm))
471471
{
472-
color32 col = COLOR32(26, 128, 128, 128);
472+
color32 col = RGBAtoColor32(26, 128, 128, 128);
473473
Draw::fill(&batch, {myX, t, myW, b - t}, col);
474474
}
475475
}
@@ -479,7 +479,7 @@ void drawStopsAndWarps()
479479
int b = (int)(oy + dy * it->endTime);
480480
if(validSegmentRegion(t, b, viewTop, viewBtm))
481481
{
482-
color32 col = COLOR32(128, 128, 51, 128);
482+
color32 col = RGBAtoColor32(128, 128, 51, 128);
483483
Draw::fill(&batch, {myX, t, myW, b - t}, col);
484484
}
485485
}
@@ -495,7 +495,7 @@ void drawStopsAndWarps()
495495
int b = (int)(oy + dy * (it + 1)->row);
496496
if(validSegmentRegion(t, b, viewTop, viewBtm))
497497
{
498-
color32 col = COLOR32(128, 26, 51, 128);
498+
color32 col = RGBAtoColor32(128, 26, 51, 128);
499499
Draw::fill(&batch, {myX, t, myW, b - t}, col);
500500
}
501501
}
@@ -747,7 +747,7 @@ void drawGhostNote(const Note& n)
747747
const int signedScale = gView->hasReverseScroll() ? -scale : scale;
748748

749749
// Render ghost hold.
750-
Renderer::setColor(COLOR32(255, 255, 255, 192));
750+
Renderer::setColor(RGBAtoColor32(255, 255, 255, 192));
751751
Renderer::bindShader(Renderer::SH_TEXTURE);
752752
Renderer::bindTexture(noteskin->noteTex.handle());
753753

@@ -782,7 +782,7 @@ void drawSongPreviewArea()
782782
{
783783
int yt = max(0, gView->timeToY(start));
784784
int yb = min(gView->getHeight(), gView->timeToY(end));
785-
Draw::fill({myX, yt, myW, yb - yt}, COLOR32(255, 255, 255, 64));
785+
Draw::fill({myX, yt, myW, yb - yt}, RGBAtoColor32(255, 255, 255, 64));
786786
if(gView->getScaleLevel() > 2)
787787
{
788788
TextStyle textStyle;
@@ -873,7 +873,7 @@ void TweakInfoBox::draw(recti r)
873873
TextStyle textStyle;
874874
for(int i = 0; i < 4; ++i)
875875
{
876-
textStyle.textColor = COLOR32(255, 255, 255, 128);
876+
textStyle.textColor = RGBAtoColor32(255, 255, 255, 128);
877877
Text::arrange(Text::TR, textStyle, keys[i]);
878878
Text::draw(vec2i{r.x - 8, r.y + 32 + i * 14});
879879

src/Editor/Selection.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void drawRegionSelection()
271271
// Draw area selection box.
272272
if(myIsSelectingRegion || myRegion.beginRow != myRegion.endRow)
273273
{
274-
color32 outline = COLOR32(153, 255, 153, 153);
274+
color32 outline = RGBAtoColor32(153, 255, 153, 153);
275275
auto coords = gView->getReceptorCoords();
276276
int x = coords.xl, w = coords.xr - coords.xl;
277277
if(myIsSelectingRegion)
@@ -283,7 +283,7 @@ void drawRegionSelection()
283283
{
284284
int t = gView->rowToY(myRegion.beginRow);
285285
int b = gView->rowToY(myRegion.endRow);
286-
Draw::fill({x, t, w, b - t}, COLOR32(153, 255, 153, 90));
286+
Draw::fill({x, t, w, b - t}, RGBAtoColor32(153, 255, 153, 90));
287287
Draw::outline({x, t, w, b - t}, outline);
288288
}
289289
}
@@ -298,8 +298,8 @@ void drawSelectionBox()
298298
vec2i start = {myDragSelectionX, gView->offsetToY(myDragSelectionTor)};
299299

300300
// Selection rectangle.
301-
color32 outline = COLOR32(255, 191, 128, 128);
302-
color32 fill = COLOR32(255, 191, 128, 89);
301+
color32 outline = RGBAtoColor32(255, 191, 128, 128);
302+
color32 fill = RGBAtoColor32(255, 191, 128, 89);
303303

304304
int x = start.x, x2 = mpos.x;
305305
int y = start.y, y2 = mpos.y;

src/Editor/TempoBoxes.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,17 +419,17 @@ void drawBoxHelp(const TempoBox& box)
419419
vec2i nameSize = Text::getSize();
420420

421421
style.fontSize = 10;
422-
style.textColor = COLOR32(192, 192, 192, 255);
422+
style.textColor = RGBAtoColor32(192, 192, 192, 255);
423423
Text::arrange(Text::TC, style, meta->help);
424424
vec2i helpSize = Text::getSize();
425425

426426
int w = max(nameSize.x, helpSize.x) + 12;
427427
int h = nameSize.y + helpSize.y + 8;
428428
recti r = recti{x - w / 2, y, w, h};
429429

430-
Draw::roundedBox(r, COLOR32(128, 128, 128, 255));
430+
Draw::roundedBox(r, RGBAtoColor32(128, 128, 128, 255));
431431
r = Shrink(r, 1);
432-
Draw::roundedBox(r, COLOR32(26, 26, 26, 255));
432+
Draw::roundedBox(r, RGBAtoColor32(26, 26, 26, 255));
433433

434434
Text::draw(vec2i{x, y + nameSize.y + 4});
435435

src/Editor/TextOverlay.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void DrawTitleText(const char* left, const char* mid, const char* right)
320320
{
321321
vec2i size = gSystem->getWindowSize();
322322

323-
Draw::fill({0, 0, size.x, 28}, COLOR32(0, 0, 0, 191));
323+
Draw::fill({0, 0, size.x, 28}, RGBAtoColor32(0, 0, 0, 191));
324324
Draw::fill({0, 28, size.x, 1}, Colors::white);
325325

326326
if(right)
@@ -350,9 +350,9 @@ void DrawScrollbar()
350350
int barY = box.y + box.h * textOverlayScrollPos_ / (textOverlayScrollEnd_ + textOverlayPageSize_);
351351
int barH = box.h * textOverlayPageSize_ / (textOverlayScrollEnd_ + textOverlayPageSize_);
352352

353-
Draw::outline(box, COLOR32(255, 255, 255, 128));
354-
Draw::fill(box, COLOR32(255, 255, 255, 64));
355-
Draw::fill({box.x, barY, box.w, barH}, COLOR32(255, 255, 255, 128));
353+
Draw::outline(box, RGBAtoColor32(255, 255, 255, 128));
354+
Draw::fill(box, RGBAtoColor32(255, 255, 255, 64));
355+
Draw::fill({box.x, barY, box.w, barH}, RGBAtoColor32(255, 255, 255, 128));
356356
}
357357
}
358358

@@ -361,7 +361,7 @@ void draw()
361361
if(textOverlayMode_ != HUD)
362362
{
363363
vec2i size = gSystem->getWindowSize();
364-
Draw::fill({0, 0, size.x, size.y}, COLOR32(0, 0, 0, 191));
364+
Draw::fill({0, 0, size.x, size.y}, RGBAtoColor32(0, 0, 0, 191));
365365
}
366366
switch(textOverlayMode_)
367367
{
@@ -452,8 +452,8 @@ void drawHud()
452452
recti r = {x - size.x / 2, y, size.x, size.y};
453453
recti r2 = {r.x - 4, r.y - 4, r.w + 8, r.h + 8};
454454

455-
Draw::fill(r2, COLOR32(0, 0, 0, 128));
456-
Draw::outline(r2, COLOR32(128, 128, 128, 128));
455+
Draw::fill(r2, RGBAtoColor32(0, 0, 0, 128));
456+
Draw::outline(r2, RGBAtoColor32(128, 128, 128, 128));
457457

458458
box->draw(r);
459459

0 commit comments

Comments
 (0)