From 9749858365375bdbd785b10a485a2bfc9ccb2d4c Mon Sep 17 00:00:00 2001 From: Dav999-v Date: Tue, 17 Jan 2023 05:19:17 +0100 Subject: [PATCH] Completely remove Graphics::bigbprint, bigrprint and bigbrprint I migrated all of them to font::print, so they can now be removed. Six deprecated print functions left! (Of which some are used a whole lot, it's simpler if the lesser-used ones are gone first.) --- desktop_version/src/Graphics.cpp | 30 ------------------------------ desktop_version/src/Graphics.h | 5 ----- desktop_version/src/Render.cpp | 18 +++++++++--------- 3 files changed, 9 insertions(+), 44 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index b37c141e..9a5c2947 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -383,16 +383,6 @@ void Graphics::bigprint( int x, int y, const std::string& text, int r, int g, i font::print(PR_scX, x, y, text, r, g, b); } -void Graphics::bigbprint(int x, int y, const std::string& text, int r, int g, int b, bool cen, int sc) -{ - // DEPRECATED. Also, use PR_2X/PR_3X/etc directly - int PR_scX = (sc-1); - if (cen) - font::print(PR_scX | PR_CEN | PR_BOR, -1, y, text, r, g, b); - else - font::print(PR_scX | PR_BOR, x, y, text, r, g, b); -} - void Graphics::bprint( int x, int y, const std::string& text, int r, int g, int b, bool cen /*= false*/ ) { // DEPRECATED if (cen) @@ -3288,26 +3278,6 @@ void Graphics::renderfixedpost(void) } } -void Graphics::bigrprint(int x, int y, const std::string& text, int r, int g, int b, bool cen, int sc) -{ - // DEPRECATED. Also, use PR_2X/PR_3X/etc directly - int PR_scX = (sc-1); - if (cen) - font::print(PR_scX | PR_CEN, -1, y, text, r, g, b); - else - font::print(PR_scX | PR_RIGHT, x, y, text, r, g, b); -} - -void Graphics::bigbrprint(int x, int y, const std::string& text, int r, int g, int b, bool cen, int sc) -{ - // DEPRECATED. Also, use PR_2X/PR_3X/etc directly - int PR_scX = (sc-1); - if (cen) - font::print(PR_scX | PR_CEN | PR_BOR, -1, y, text, r, g, b); - else - font::print(PR_scX | PR_RIGHT | PR_BOR, x, y, text, r, g, b); -} - void Graphics::drawtele(int x, int y, int t, const SDL_Color color) { SDL_Rect telerect; diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index bc369942..90b07948 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -213,7 +213,6 @@ public: void bprintalpha(int x, int y, const std::string& t, int r, int g, int b, int a, bool cen = false); void bigprint( int _x, int _y, const std::string& _s, int r, int g, int b, bool cen = false, int sc = 2 ); - void bigbprint(int x, int y, const std::string& s, int r, int g, int b, bool cen = false, int sc = 2); void drawspritesetcol(int x, int y, int t, int c); @@ -237,10 +236,6 @@ public: void drawtrophytext(void); - void bigrprint(int x, int y, const std::string& t, int r, int g, int b, bool cen = false, int sc = 2); - void bigbrprint(int x, int y, const std::string& t, int r, int g, int b, bool cen = false, int sc = 2); - - void drawtele(int x, int y, int t, SDL_Color c); SDL_Color getRGBA(Uint8 r, Uint8 g, Uint8 b, Uint8 a); diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 877113bc..e9feecef 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2006,7 +2006,7 @@ void gamerender(void) if (game.swngame == 0) { std::string tempstring = help.timestring(game.swntimer); - graphics.bigbprint( -1, 20, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + font::print(PR_2X | PR_CEN | PR_BOR, -1, 20, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); } else if (game.swngame == 1) { @@ -2101,16 +2101,16 @@ void gamerender(void) { if (game.swndelay >= 60) { - graphics.bigbprint( -1, 20, loc::gettext("SUPER GRAVITRON"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + font::print(PR_2X | PR_BOR | PR_CEN, -1, 20, loc::gettext("SUPER GRAVITRON"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); std::string tempstring = help.timestring(game.swnrecord); - graphics.bprint( 240, 190, loc::gettext("Best Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true); - graphics.bigbrprint( 300, 205, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + font::print(PR_BOR | PR_CEN, -1, 190, loc::gettext("Best Time"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + font::print(PR_2X | PR_BOR | PR_CEN, -1, 205, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); } - else if (int(game.swndelay / 10) % 2 == 1) + else if (int(game.swndelay / 10) % 2 == 1) { - graphics.bigbprint( -1, 20, loc::gettext("SUPER GRAVITRON"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); - graphics.bigbprint( -1, 200, loc::gettext("GO!"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 3); + font::print(PR_2X | PR_BOR | PR_CEN, -1, 20, loc::gettext("SUPER GRAVITRON"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); + font::print(PR_3X | PR_BOR | PR_CEN, -1, 200, loc::gettext("GO!"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); } } } @@ -2518,7 +2518,7 @@ void maprender(void) std::string tempstring = help.timestring(game.swnrecord); graphics.Print( 240, 124, loc::gettext("Best Time"), 196, 196, 255 - help.glow, true); - graphics.bigrprint( 300, 94, tempstring, 196, 196, 255 - help.glow, true, 2); + font::print(PR_2X | PR_CEN, -1, 102, tempstring, 196, 196, 255 - help.glow); switch(game.swnbestrank) { @@ -2551,7 +2551,7 @@ void maprender(void) std::string tempstring = help.timestring(game.swnrecord); graphics.Print( 240, 90, loc::gettext("Best Time"), 196, 196, 255 - help.glow, true); - graphics.bigrprint( 300, 104, tempstring, 196, 196, 255 - help.glow, true, 2); + font::print(PR_2X | PR_CEN, -1, 104, tempstring, 196, 196, 255 - help.glow); switch(game.swnbestrank) {