From 3f7ed4b94ac360d302a64e1232553f04035ed7ca Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 30 Jun 2020 11:10:00 -0700 Subject: [PATCH] Don't selectively undraw tiles in towers if backgrounds are off The game for some reason had this thing where it would not draw the diagonal background tiles if you had animated backgrounds turned off. Which is weird, because spikes with that background are still drawn as spikes with that background. And also, it doesn't do this for any of the tower hallway rooms, which is inconsistent. Better to simplify the logic in Render.cpp anyways by removing graphics.drawtower_nobackground() and making it really clear what exactly we'll do if backgrounds are turned off. ("Aren't we already not drawing the background? What's this _nobackground() function for?") --- desktop_version/src/Graphics.cpp | 14 -------------- desktop_version/src/Graphics.h | 2 -- desktop_version/src/Render.cpp | 3 +-- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index ab8b28f2..8ea37492 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -2441,20 +2441,6 @@ void Graphics::drawtowermap() } } -void Graphics::drawtowermap_nobackground() -{ - int temp; - int yoff = lerp(map.oldypos, map.ypos); - for (int j = 0; j < 31; j++) - { - for (int i = 0; i < 40; i++) - { - temp = map.tower.at(i, j, yoff); - if (temp > 0 && temp<28) drawtile3(i * 8, (j * 8) - (yoff % 8), temp, map.colstate); - } - } -} - void Graphics::drawtowerspikes() { int spikeleveltop = lerp(map.oldspikeleveltop, map.spikeleveltop); diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index dcbde730..bf42d562 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -191,8 +191,6 @@ public: void drawtowermap(); - void drawtowermap_nobackground(); - void drawtowerspikes(); bool onscreen(int t); diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 6a16756f..27f27eef 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1382,13 +1382,12 @@ void gamerender() if (!game.colourblindmode) { graphics.drawtowerbackground(); - graphics.drawtowermap(); } else { FillRect(graphics.backBuffer,0x00000); - graphics.drawtowermap_nobackground(); } + graphics.drawtowermap(); } else {