1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 23:48:30 +02:00

Move warpfcol, warpbcol, and warprect off of Graphics

These are all temporary variables only used when drawing the all-sides
warp background.

warpskip isn't though, it's a persistent variable.
This commit is contained in:
Misa 2023-01-02 11:15:54 -08:00
parent b0ca322b3f
commit 38c3b4ab41
2 changed files with 7 additions and 19 deletions

View File

@ -84,8 +84,6 @@ void Graphics::init(void)
backgrounddrawn = false;
warpskip = 0;
SDL_zero(warpfcol);
SDL_zero(warpbcol);
spcol = 0;
spcoldel = 0;
@ -122,7 +120,6 @@ void Graphics::init(void)
trinketr = 0;
trinketg = 0;
trinketb = 0;
warprect = SDL_Rect();
translucentroomname = false;
@ -2654,7 +2651,11 @@ void Graphics::drawbackground( int t )
SDL_BlitSurface(warpbuffer_lerp, &towerbuffer_rect, backBuffer, NULL);
break;
case 5:
{
//Warp zone, central
SDL_Color warpbcol;
SDL_Color warpfcol;
switch(rcol)
{
//Akward ordering to match tileset
@ -2694,17 +2695,18 @@ void Graphics::drawbackground( int t )
for (int i = 10 ; i >= 0; i--)
{
const int temp = (i * 16) + backoffset;
setwarprect(160 - temp, 120 - temp, temp * 2, temp * 2);
const SDL_Rect warprect = {160 - temp, 120 - temp, temp * 2, temp * 2};
if (i % 2 == warpskip)
{
FillRect(backBuffer, warprect, warpbcol);
}
else
{
FillRect(backBuffer,warprect, warpfcol);
FillRect(backBuffer, warprect, warpfcol);
}
}
break;
}
case 6:
//Final Starfield
ClearSurface(backBuffer);
@ -3303,14 +3305,6 @@ SDL_Color Graphics::bigchunkygetcol(int t)
return color;
}
void Graphics::setwarprect( int a, int b, int c, int d )
{
warprect.x = a;
warprect.y = b;
warprect.w = c;
warprect.h = d;
}
void Graphics::textboxcenterx(void)
{
if (!INBOUNDS_VEC(m, textboxes))

View File

@ -60,8 +60,6 @@ public:
void drawfade(void);
void setwarprect(int a, int b, int c, int d);
void createtextboxreal(
const std::string& t,
int xp,
@ -307,8 +305,6 @@ public:
int oldmenuoffset;
bool resumegamemode;
SDL_Rect warprect;
int crewframe;
int crewframedelay;
@ -339,8 +335,6 @@ public:
float backboxint[numbackboxes];
int warpskip;
SDL_Color warpfcol;
SDL_Color warpbcol;
bool translucentroomname;