1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00

Remove getBGR

getBGR, when used in FillRect, was actually passing colors in RGB order.
But now the masks are fixed, so remove it, and fix up all existing
getBGR colors to use getRGB instead.
This commit is contained in:
Misa 2021-08-28 12:59:46 -07:00
parent f6c9ff848f
commit 7430be69e3
4 changed files with 14 additions and 21 deletions

View File

@ -607,7 +607,7 @@ void editorrender(void)
if(customentities[i].p1==1) graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+4,(customentities[i].y*8)- (ed.levy*30*8)+4, "^", 255, 255, 255 - help.glow, false);
if(customentities[i].p1==2) graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+4,(customentities[i].y*8)- (ed.levy*30*8)+4, "<", 255, 255, 255 - help.glow, false);
if(customentities[i].p1==3) graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+4,(customentities[i].y*8)- (ed.levy*30*8)+4, ">", 255, 255, 255 - help.glow, false);
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),16,16,graphics.getBGR(255,164,255));
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),16,16,graphics.getRGB(255,164,255));
break;
case 2: //Threadmills & platforms
if (!INBOUNDS_VEC(obj.customplatformtile, graphics.entcolours))
@ -631,18 +631,18 @@ void editorrender(void)
if(customentities[i].p1==1) graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+12,(customentities[i].y*8)- (ed.levy*30*8), "^", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
if(customentities[i].p1==2) graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+12,(customentities[i].y*8)- (ed.levy*30*8), "<", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
if(customentities[i].p1==3) graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+12,(customentities[i].y*8)- (ed.levy*30*8), ">", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255));
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getRGB(255,255,255));
}
if(customentities[i].p1==5)
{
graphics.Print((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8), ">>>>", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255));
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getRGB(255,255,255));
}
else if(customentities[i].p1==6)
{
graphics.Print((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8), "<<<<", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255));
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getRGB(255,255,255));
}
if(customentities[i].p1>=7)
@ -662,12 +662,12 @@ void editorrender(void)
if(customentities[i].p1==7)
{
graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+4,(customentities[i].y*8)- (ed.levy*30*8), "> > > > ", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),64,8,graphics.getBGR(255,255,255));
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),64,8,graphics.getRGB(255,255,255));
}
else if(customentities[i].p1==8)
{
graphics.Print((customentities[i].x*8)- (ed.levx*40*8)+4,(customentities[i].y*8)- (ed.levy*30*8), "< < < < ", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),64,8,graphics.getBGR(255,255,255));
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),64,8,graphics.getRGB(255,255,255));
}
break;
case 3: //Disappearing Platform
@ -687,7 +687,7 @@ void editorrender(void)
}
graphics.Print((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8), "////", 255 - help.glow, 255 - help.glow, 255 - help.glow, false);
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getBGR(255,255,255));
fillboxabs((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),32,8,graphics.getRGB(255,255,255));
break;
case 9: //Shiny Trinket
graphics.drawsprite((customentities[i].x*8)- (ed.levx*40*8),(customentities[i].y*8)- (ed.levy*30*8),22,196,196,196);
@ -894,7 +894,7 @@ void editorrender(void)
fillboxabs( room->enemyx1, room->enemyy1,
room->enemyx2-room->enemyx1,
room->enemyy2-room->enemyy1,
graphics.getBGR(255-(help.glow/2),64,64));
graphics.getRGB(255-(help.glow/2),64,64));
}
if(room->platx1!=0 || room->platy1!=0
@ -903,7 +903,7 @@ void editorrender(void)
fillboxabs( room->platx1, room->platy1,
room->platx2-room->platx1,
room->platy2-room->platy1,
graphics.getBGR(64,64,255-(help.glow/2)));
graphics.getRGB(64,64,255-(help.glow/2)));
}
}
@ -1139,7 +1139,7 @@ void editorrender(void)
else if(ed.scripteditmod)
{
//Elaborate C64 BASIC menu goes here!
FillRect(graphics.backBuffer, 0,0,320,240, graphics.getBGR(123, 111, 218));
FillRect(graphics.backBuffer, 0,0,320,240, graphics.getRGB(123, 111, 218));
FillRect(graphics.backBuffer, 14,16,292,208, graphics.getRGB(61, 48, 162));
switch(ed.scripthelppage)
{

View File

@ -3041,9 +3041,9 @@ Uint32 Graphics::bigchunkygetcol(int t)
switch (t)
{
case 1:
return getBGR((fRandom() * 64), 10, 10);
return getRGB((fRandom() * 64), 10, 10);
case 2:
return getBGR(int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
return getRGB(int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
}
return 0x00000000;
}
@ -3258,11 +3258,6 @@ Uint32 Graphics::getRGB(Uint8 r, Uint8 g, Uint8 b)
return SDL_MapRGB(backBuffer->format, r, g, b);
}
Uint32 Graphics::getBGR(Uint8 r, Uint8 g, Uint8 b)
{
return SDL_MapRGB(backBuffer->format, r, g, b);
}
Uint32 Graphics::getRGB(Uint32 _col)
{
return ( _col);

View File

@ -183,8 +183,6 @@ public:
Uint32 getRGB(Uint8 r, Uint8 g, Uint8 b);
Uint32 getBGR(Uint8 r, Uint8 g, Uint8 b);
Uint32 getRGB(Uint32 _col);
Uint32 RGBflip(Uint8 r, Uint8 g, Uint8 b);

View File

@ -95,7 +95,7 @@ void preloaderrender(void)
}
}
FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getBGR(0x3E,0x31,0xA2));
FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getRGB(0x3E,0x31,0xA2));
if(pre_fakepercent==100){
graphics.Print(282-(15*8), 204, "LOADING... " + help.String(int(pre_fakepercent))+"%", 124, 112, 218, false);
@ -115,7 +115,7 @@ void preloaderrender(void)
pre_temprecty = 0;
pre_temprecth = 240;
ClearSurface(graphics.backBuffer);
FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getBGR(0x3E,0x31,0xA2));
FillRect(graphics.backBuffer, pre_frontrectx, pre_frontrecty, pre_frontrectw,pre_frontrecth, graphics.getRGB(0x3E,0x31,0xA2));
graphics.Print(282-(15*8), 204, "LOADING... 100%", 124, 112, 218, false);
}