From 38c3b4ab4188403382f35d6ebb1c8e01528c78f3 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 2 Jan 2023 11:15:54 -0800 Subject: [PATCH] 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. --- desktop_version/src/Graphics.cpp | 20 +++++++------------- desktop_version/src/Graphics.h | 6 ------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 01cc3aa2..1fdbf2ba 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -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)) diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 4a4ff53e..24a5f4ac 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -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;