From f7173027ce499c8cec300c5d611fe66d430221ec Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 19 Mar 2021 14:26:59 -0700 Subject: [PATCH] Add Graphics::bigbprint() It's just like bigprint() except it duplicates some of the calculations because I didn't want to make a bigprintoff() function which would duplicate even more code. I'm beginning to think these text printing functions are completely horrible to work with... --- desktop_version/src/Graphics.cpp | 22 ++++++++++++++++++++++ desktop_version/src/Graphics.h | 1 + 2 files changed, 23 insertions(+) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 5e4c99b6..1fe39b9d 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -541,6 +541,28 @@ void Graphics::bigprint( int _x, int _y, std::string _s, int r, int g, int b, b } } +void Graphics::bigbprint(int x, int y, std::string s, int r, int g, int b, bool cen, int sc) +{ + if (!notextoutline) + { + bigprint(x, y - sc, s, 0, 0, 0, cen, sc); + if (cen) + { + int x_cen = VVV_max(160 - (len(s) / 2) * sc, 0); + bigprint(x_cen - sc, y, s, 0, 0, 0, false, sc); + bigprint(x_cen + sc, y, s, 0, 0, 0, false, sc); + } + else + { + bigprint(x - sc, y, s, 0, 0, 0, cen, sc); + bigprint(x + sc, y, s, 0, 0, 0, cen, sc); + } + bigprint(x, y + sc, s, 0, 0, 0, cen, sc); + } + + bigprint(x, y, s, r, g, b, cen, sc); +} + int Graphics::len(std::string t) { int bfontpos = 0; diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index af41b09b..045c17dd 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -144,6 +144,7 @@ public: int len(std::string t); void bigprint( int _x, int _y, std::string _s, int r, int g, int b, bool cen = false, int sc = 2 ); + void bigbprint(int x, int y, 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);