From d784f7f61aefa47a428b57f54fcc6c10ad52a9fe Mon Sep 17 00:00:00 2001 From: Dav999-v Date: Tue, 17 Jan 2023 18:37:35 +0100 Subject: [PATCH] Completely remove Graphics::PrintAlpha and Graphics::bprintalpha Only four deprecated functions remain: - Graphics::Print - Graphics::PrintWrap - Graphics::bigprint - Graphics::bprint Graphics::bprint is the least-used one of them, and after that, the other functions are used a LOT, but it'll be a lot faster to go through them, since I have less and less flags to worry about. I'll probably start using Vim macros again like I did for loc::gettext()ing strings, or maybe I'll automate this completely. --- desktop_version/src/Graphics.cpp | 18 ------------------ desktop_version/src/Graphics.h | 4 ---- desktop_version/src/Render.cpp | 2 +- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 9a5c2947..651d6c31 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -345,15 +345,6 @@ void Graphics::Print( int x, int y, const std::string& text, int r, int g, int b font::print(0, x, y, text, r, g, b); } -void Graphics::PrintAlpha( int x, int y, const std::string& text, int r, int g, int b, int a, bool cen /*= false*/ ) -{ - // DEPRECATED - if (cen) - font::print(PR_ALPHA(a) | PR_CEN, -1, y, text, r, g, b); - else - font::print(PR_ALPHA(a), x, y, text, r, g, b); -} - int Graphics::PrintWrap( const int x, int y, @@ -391,15 +382,6 @@ void Graphics::bprint( int x, int y, const std::string& text, int r, int g, int font::print(PR_BOR, x, y, text, r, g, b); } -void Graphics::bprintalpha( int x, int y, const std::string& text, int r, int g, int b, int a, bool cen /*= false*/ ) -{ - // DEPRECATED - if (cen) - font::print(PR_ALPHA(a) | PR_CEN | PR_BOR, -1, y, text, r, g, b); - else - font::print(PR_ALPHA(a) | PR_BOR, x, y, text, r, g, b); -} - void Graphics::printcrewname( int x, int y, int t ) { //Print the name of crew member t in the right colour diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 90b07948..21feb498 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -204,14 +204,10 @@ public: void Print(int _x, int _y, const std::string& _s, int r, int g, int b, bool cen = false); - void PrintAlpha(int _x, int _y, const std::string& _s, int r, int g, int b, int a, bool cen = false); - int PrintWrap(int x, int y, const std::string& s, int r, int g, int b, bool cen = false, int linespacing = -1, int maxwidth = -1); void bprint(int x, int y, const std::string& t, int r, int g, int b, bool cen = false); - 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 drawspritesetcol(int x, int y, int t, int c); diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index e9feecef..39ec0e07 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1958,7 +1958,7 @@ void gamerender(void) if(map.custommode && !map.custommodeforreal && !game.advancetext){ //Return to level editor int alpha = graphics.lerp(ed.oldreturneditoralpha, ed.returneditoralpha); - graphics.bprintalpha(5, 5, loc::gettext("[Press ENTER to return to editor]"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), alpha, false); + font::print(PR_ALPHA(alpha) | PR_BOR, 5, 5, loc::gettext("[Press ENTER to return to editor]"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); } #endif