From b478d8295c41de0475d925488016d3e08552b39b Mon Sep 17 00:00:00 2001 From: ephphatha Date: Sat, 19 Jun 2021 14:08:31 +1000 Subject: [PATCH] Remove dead code, FreeText() is never called Given the program already lets the destructors get called naturally there's no need to explicitly call this function. Even if it was desirable to re-init the font data the old instances will be destroyed when the new instance is assigned to the optional. --- Source/engine/render/text_render.cpp | 9 --------- Source/engine/render/text_render.hpp | 1 - 2 files changed, 10 deletions(-) diff --git a/Source/engine/render/text_render.cpp b/Source/engine/render/text_render.cpp index 0ac200d57..38d51297d 100644 --- a/Source/engine/render/text_render.cpp +++ b/Source/engine/render/text_render.cpp @@ -195,15 +195,6 @@ void InitText() } } -void FreeText() -{ - fonts[GameFontSmall] = std::nullopt; - fonts[GameFontMed] = std::nullopt; - fonts[GameFontBig] = std::nullopt; - - pSPentSpn2Cels = std::nullopt; -} - int GetLineWidth(const char *text, GameFontTables size, int spacing, int *charactersInLine) { int lineWidth = 0; diff --git a/Source/engine/render/text_render.hpp b/Source/engine/render/text_render.hpp index 5396c235e..5d10f2b3f 100644 --- a/Source/engine/render/text_render.hpp +++ b/Source/engine/render/text_render.hpp @@ -24,7 +24,6 @@ enum GameFontTables : uint8_t { extern std::optional pSPentSpn2Cels; void InitText(); -void FreeText(); /** * @brief Calculate pixel width of first line of text, respecting kerning