Remove useless arguments from drawimagecol()

Turns out, the r, g, and b arguments don't actually do anything!

There was a call to RGBf() in the function. RGBf() is just getRGB() but
first adds 128 and then divides by 3 to each of the color channels
beforehand. Unfortunately, RGBf() does not have any side effects, and
the function threw away the return value. Bravo.

This also reveals that the website images drawn in the credits in the
main menu are only recolored because of a stale `ct` set by the previous
graphics.bigprint(), and not because any color values were passed in to
drawimagecol()... What fun surprises the game has in store for me every
day.
This commit is contained in:
Misa 2021-09-11 02:12:03 -07:00
parent 58ae93c4cc
commit f237f41d8e
3 changed files with 5 additions and 9 deletions

View File

@ -1090,17 +1090,13 @@ void Graphics::updatetextboxes(void)
}
}
void Graphics::drawimagecol( int t, int xp, int yp, int r = 0, int g = 0, int b = 0, bool cent/*= false*/ )
void Graphics::drawimagecol( int t, int xp, int yp, bool cent/*= false*/ )
{
if (!INBOUNDS_VEC(t, images))
{
return;
}
SDL_Rect trect;
if(r+g+b != 0)
{
RGBf(r,g,b);
}
point tpoint;
if (cent)

View File

@ -113,7 +113,7 @@ public:
void drawimage(int t, int xp, int yp, bool cent=false);
void drawimagecol(int t, int xp, int yp, int r, int g, int b, bool cent= false);
void drawimagecol(int t, int xp, int yp, bool cent= false);
void updatetextboxes(void);
void drawgui(void);

View File

@ -433,16 +433,16 @@ static void menurender(void)
graphics.Print( -1, 50, "VVVVVV is a game by", tr, tg, tb, true);
graphics.bigprint( 40, 65, "Terry Cavanagh", tr, tg, tb, true, 2);
graphics.drawimagecol(7, -1, 86, tr *0.75, tg *0.75, tb *0.75, true);
graphics.drawimagecol(7, -1, 86, true);
graphics.Print( -1, 120, "and features music by", tr, tg, tb, true);
graphics.bigprint( 40, 135, "Magnus P~lsson", tr, tg, tb, true, 2);
graphics.drawimagecol(8, -1, 156, tr *0.75, tg *0.75, tb *0.75, true);
graphics.drawimagecol(8, -1, 156, true);
break;
case Menu::credits2:
graphics.Print( -1, 50, "Roomnames are by", tr, tg, tb, true);
graphics.bigprint( 40, 65, "Bennett Foddy", tr, tg, tb, true);
graphics.drawimagecol(9, -1, 86, tr*0.75, tg *0.75, tb *0.75, true);
graphics.drawimagecol(9, -1, 86, true);
graphics.Print( -1, 110, "C++ version by", tr, tg, tb, true);
graphics.bigprint( 40, 125, "Simon Roth", tr, tg, tb, true);
graphics.bigprint( 40, 145, "Ethan Lee", tr, tg, tb, true);