From 4c6ab6e6b7d65a5c8c5132166519bb9125cf9e9b Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 3 Jul 2020 02:20:07 -0700 Subject: [PATCH] Remove unused vars from Graphics/GraphicsResources These unused vars are: - Graphics::bfontmask_rect - Graphics::backgrounds - Graphics::bfontmask - GraphicsResources::im_bfontmask While it seems that Graphics::backgrounds was indexed in Graphics::drawbackground(), in reality there was never anything in that vector and thus actually using it would cause a segfault. --- desktop_version/src/Graphics.cpp | 2 -- desktop_version/src/Graphics.h | 4 ---- desktop_version/src/GraphicsResources.cpp | 2 -- desktop_version/src/GraphicsResources.h | 1 - 4 files changed, 9 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 02c1f1f0..cc8d1fac 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -16,7 +16,6 @@ void Graphics::init() setRect(tiles_rect, 0,0,8,8); setRect(sprites_rect, 0,0,32,32); setRect(bfont_rect, 0,0,8,8); - setRect(bfontmask_rect, 0,0,8,8); setRect(bg_rect, 0,0,320,240); setRect(footerrect, 0, 230, 320, 10); setRect(prect, 0, 0, 4, 4); @@ -2217,7 +2216,6 @@ void Graphics::drawbackground( int t ) break; default: FillRect(backBuffer, 0x000000 ); - BlitSurfaceStandard(backgrounds[t], NULL, backBuffer, &bg_rect); break; } diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 477523f3..24a220e4 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -215,7 +215,6 @@ public: int m; - std::vector backgrounds; std::vector images; std::vector tele; @@ -226,9 +225,7 @@ public: std::vector sprites; std::vector flipsprites; std::vector bfont; - std::vector bfontmask; std::vector flipbfont; - std::vector flipbfontmask; bool flipmode; bool setflipmode; @@ -246,7 +243,6 @@ public: SDL_Rect bfont_rect; SDL_Rect tiles_rect; SDL_Rect sprites_rect; - SDL_Rect bfontmask_rect; SDL_Rect images_rect; SDL_Rect bg_rect; SDL_Rect line_rect; diff --git a/desktop_version/src/GraphicsResources.cpp b/desktop_version/src/GraphicsResources.cpp index c4f52615..f22a60c5 100644 --- a/desktop_version/src/GraphicsResources.cpp +++ b/desktop_version/src/GraphicsResources.cpp @@ -89,7 +89,6 @@ void GraphicsResources::init(void) im_sprites = LoadImage("graphics/sprites.png"); im_flipsprites = LoadImage("graphics/flipsprites.png"); im_bfont = LoadImage("graphics/font.png"); - im_bfontmask = LoadImage("graphics/fontmask.png"); im_teleporter = LoadImage("graphics/teleporter.png"); im_image0 = LoadImage("graphics/levelcomplete.png", false); @@ -117,7 +116,6 @@ void GraphicsResources::destroy(void) SDL_FreeSurface(im_sprites); SDL_FreeSurface(im_flipsprites); SDL_FreeSurface(im_bfont); - SDL_FreeSurface(im_bfontmask); SDL_FreeSurface(im_teleporter); SDL_FreeSurface(im_image0); diff --git a/desktop_version/src/GraphicsResources.h b/desktop_version/src/GraphicsResources.h index 265e0234..6b63f868 100644 --- a/desktop_version/src/GraphicsResources.h +++ b/desktop_version/src/GraphicsResources.h @@ -16,7 +16,6 @@ public: SDL_Surface* im_sprites; SDL_Surface* im_flipsprites; SDL_Surface* im_bfont; - SDL_Surface* im_bfontmask; SDL_Surface* im_teleporter; SDL_Surface* im_image0; SDL_Surface* im_image1;