diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 4761888887..b6ba76bc6e 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -207,6 +207,21 @@ void ChatDraw(DrawPixelInfo& dpi, ColourWithFlags chatBackgroundColor) } } +/** + * strftime wrapper which appends to an existing string. + */ +static size_t StrCatFTime(char* buffer, size_t bufferSize, const char* format, const struct tm* tp) +{ + size_t stringLen = strnlen(buffer, bufferSize); + if (stringLen < bufferSize) + { + char* dst = buffer + stringLen; + size_t dstMaxSize = bufferSize - stringLen; + return strftime(dst, dstMaxSize, format, tp); + } + return 0; +} + void ChatAddHistory(std::string_view s) { // Format a timestamp diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index d6d24ac6ed..b207a8037c 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include /* Case insensitive logical compare */ @@ -191,18 +190,3 @@ uint8_t SoftLight(uint8_t a, uint8_t b) } return static_cast(std::clamp(fr, 0.0f, 1.0f) * 255.0f); } - -/** - * strftime wrapper which appends to an existing string. - */ -size_t StrCatFTime(char* buffer, size_t bufferSize, const char* format, const struct tm* tp) -{ - size_t stringLen = strnlen(buffer, bufferSize); - if (stringLen < bufferSize) - { - char* dst = buffer + stringLen; - size_t dstMaxSize = bufferSize - stringLen; - return strftime(dst, dstMaxSize, format, tp); - } - return 0; -} diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index 8f5ff2c063..3a985ed0b5 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -12,8 +12,6 @@ #include "../core/Money.hpp" #include "../core/StringTypes.h" -#include - int32_t StrLogicalCmp(char const* a, char const* b); char* SafeStrCpy(char* destination, const char* source, size_t num); char* SafeStrCat(char* destination, const char* source, size_t size); @@ -48,8 +46,6 @@ uint8_t Lerp(uint8_t a, uint8_t b, float t); float FLerp(float a, float b, float t); uint8_t SoftLight(uint8_t a, uint8_t b); -size_t StrCatFTime(char* buffer, size_t bufferSize, const char* format, const struct tm* tp); - template [[nodiscard]] constexpr uint64_t EnumToFlag(T v) {