From 6538d1e5ddfae1dd54fa8b6bc30095e4d76803f3 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 19 Mar 2021 14:28:04 -0700 Subject: [PATCH] Add Graphics::bigrprint() Same as bigbprint(), we duplicate some of the calculations because it's better than duplicating another text printing function. --- desktop_version/src/Graphics.cpp | 24 ++++++++++++++++++++++++ desktop_version/src/Graphics.h | 1 + 2 files changed, 25 insertions(+) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 1fe39b9d..4d9e4dac 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -3177,6 +3177,30 @@ void Graphics::bigrprint(int x, int y, std::string& t, int r, int g, int b, bool } } +void Graphics::bigbrprint(int x, int y, std::string& s, int r, int g, int b, bool cen, float sc) +{ + if (!notextoutline) + { + int x_o = x / sc - len(s); + bigrprint(x, y - sc, s, 0, 0, 0, cen, sc); + if (cen) + { + x_o = VVV_max(160 - (len(s) / 2) * sc, 0); + bigprint(x_o - sc, y, s, 0, 0, 0, false, sc); + bigprint(x_o + sc, y, s, 0, 0, 0, false, sc); + } + else + { + x_o *= sc; + bigprint(x_o - sc, y, s, 0, 0, 0, false, sc); + bigprint(x_o + sc, y, s, 0, 0, 0, false, sc); + } + bigrprint(x, y + sc, s, 0, 0, 0, cen, sc); + } + + bigrprint(x, y, s, r, g, b, cen, sc); +} + void Graphics::drawtele(int x, int y, int t, Uint32 c) { setcolreal(getRGB(16,16,16)); diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 045c17dd..247c465c 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -169,6 +169,7 @@ public: void drawtrophytext(void); void bigrprint(int x, int y, std::string& t, int r, int g, int b, bool cen = false, float sc = 2); + void bigbrprint(int x, int y, std::string& t, int r, int g, int b, bool cen = false, float sc = 2); void drawtele(int x, int y, int t, Uint32 c);