Browse Source

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.
pull/2196/head
ephphatha 5 years ago committed by Anders Jenbo
parent
commit
b478d8295c
  1. 9
      Source/engine/render/text_render.cpp
  2. 1
      Source/engine/render/text_render.hpp

9
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;

1
Source/engine/render/text_render.hpp

@ -24,7 +24,6 @@ enum GameFontTables : uint8_t {
extern std::optional<CelSprite> pSPentSpn2Cels;
void InitText();
void FreeText();
/**
* @brief Calculate pixel width of first line of text, respecting kerning

Loading…
Cancel
Save