diff --git a/src/text/OptionScreen.cpp b/src/text/OptionScreen.cpp index 66f9b27..9fa68f5 100644 --- a/src/text/OptionScreen.cpp +++ b/src/text/OptionScreen.cpp @@ -17,6 +17,12 @@ int_least64_t getCurrentEpochTimeMillis() { OptionScreen::OptionScreen(const std::string &text, SDL_Point *screenSize, int seconds) : TextScreen(text, screenSize, std::nullopt), stepsToDo(seconds) { + secondaryFont = TTF_OpenFont(getDefaultFontPath(), 100); + if (secondaryFont == nullptr) { + std::cerr << "Failed to load secondary font: " << TTF_GetError() << std::endl; + exit(-1); + } + } void OptionScreen::update() { @@ -30,6 +36,7 @@ void OptionScreen::update() { stepsDone++; } else { isDone_ = true; + std::swap(font, secondaryFont); } } @@ -41,4 +48,5 @@ void OptionScreen::startCountDown() { nextMsEpoch = epochMs; hasStartedCounting_ = true; stepsDone = 0; + std::swap(font, secondaryFont); } \ No newline at end of file diff --git a/src/text/OptionScreen.h b/src/text/OptionScreen.h index 5d9a270..5428e85 100644 --- a/src/text/OptionScreen.h +++ b/src/text/OptionScreen.h @@ -13,6 +13,7 @@ private: int stepsToDo, stepsDone = 0; bool isDone_ = false; + TTF_Font *secondaryFont; public: [[nodiscard]] const bool &isDone() const { return isDone_; diff --git a/src/text/TextScreen.h b/src/text/TextScreen.h index 370ecdd..6138668 100644 --- a/src/text/TextScreen.h +++ b/src/text/TextScreen.h @@ -19,7 +19,6 @@ class TextScreen { private: std::vector surfaces; std::vector shadowSurfaces; - TTF_Font *font; SDL_Point *screenSize; std::optional basePosition; @@ -32,6 +31,7 @@ private: const int shadowOffset = 3; protected: + TTF_Font *font; std::vector lines; bool hasUpdated;