From 5f7034f23ce2519c42999db31acb475ac90f686e Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 22 Jan 2024 01:55:05 +0000 Subject: [PATCH] Fix clang compilation issue with _text_effects --- src/texteff.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/texteff.cpp b/src/texteff.cpp index ca12ffad87..7e8b0ea0fb 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -19,9 +19,6 @@ #include "safeguards.h" -static std::vector _text_effects; ///< Text effects are stored there -static TextEffectID _free_text_effect = 0; - /** Container for all information about a text effect */ struct TextEffect : public ViewportSign { uint64_t params_1; ///< DParam parameter @@ -30,17 +27,22 @@ struct TextEffect : public ViewportSign { uint8_t duration; ///< How long the text effect should stay, in ticks (applies only when mode == TE_RISING) TextEffectMode mode; ///< Type of text effect - /** Reset the text effect */ - void Reset() - { - this->MarkDirty(ZOOM_LVL_OUT_8X); - this->width_normal = 0; - this->string_id = INVALID_STRING_ID; - this->params_1 = _free_text_effect; - _free_text_effect = this - _text_effects.data(); - } + void Reset(); }; +static std::vector _text_effects; ///< Text effects are stored there +static TextEffectID _free_text_effect = 0; + +/** Reset the text effect */ +void TextEffect::Reset() +{ + this->MarkDirty(ZOOM_LVL_OUT_8X); + this->width_normal = 0; + this->string_id = INVALID_STRING_ID; + this->params_1 = _free_text_effect; + _free_text_effect = this - _text_effects.data(); +} + /* Text Effects */ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8_t duration, TextEffectMode mode, uint64_t param1, uint64_t param2) {