diff --git a/src/Drawer2D.c b/src/Drawer2D.c index c188da99a..e89080099 100644 --- a/src/Drawer2D.c +++ b/src/Drawer2D.c @@ -723,7 +723,7 @@ void Font_Free(struct FontDesc* desc) { void SysFonts_Register(const String* path) { } static int Font_SysTextWidth(struct DrawTextArgs* args) { return 0; } -static void Font_SysTextDraw(struct DrawTextArgs* args, Bitmap* bmp, int x, int y, cc_bool shadow) { return 0; } +static void Font_SysTextDraw(struct DrawTextArgs* args, Bitmap* bmp, int x, int y, cc_bool shadow) { } #else #include "freetype/ft2build.h" #include "freetype/freetype.h" diff --git a/src/Protocol.c b/src/Protocol.c index da4c75772..3c74cb8af 100644 --- a/src/Protocol.c +++ b/src/Protocol.c @@ -134,6 +134,15 @@ static void AddTablistEntry(EntityID id, const String* playerName, const String* TabList_Set(id, &rawName, listName, groupName, groupRank); } +static void StripCols(String* str) { + int i; + for (i = str->length - 1; i >= 0; i--) { + if (str->buffer[i] != '&') continue; + /* Remove the & and the colour code following it */ + String_DeleteAt(str, i); String_DeleteAt(str, i); + } +} + static void CheckName(EntityID id, String* name, String* skin) { String colorlessName; char colorlessBuffer[STRING_SIZE]; @@ -147,7 +156,7 @@ static void CheckName(EntityID id, String* name, String* skin) { if (!skin->length) String_Copy(skin, name); RemoveEndPlus(skin); - String_StripCols(skin); + StripCols(skin); } static void Classic_ReadAbsoluteLocation(cc_uint8* data, EntityID id, cc_bool interpolate); diff --git a/src/String.c b/src/String.c index dd3e9aa6a..f093e9ea2 100644 --- a/src/String.c +++ b/src/String.c @@ -27,15 +27,6 @@ String String_FromReadonly(STRING_REF const char* buffer) { } -void String_StripCols(String* str) { - int i; - for (i = str->length - 1; i >= 0; i--) { - if (str->buffer[i] != '&') continue; - /* Remove the & and the colour code following it */ - String_DeleteAt(str, i); String_DeleteAt(str, i); - } -} - void String_Copy(String* dst, const String* src) { dst->length = 0; String_AppendString(dst, src); diff --git a/src/String.h b/src/String.h index 006e89b53..0f645cbc1 100644 --- a/src/String.h +++ b/src/String.h @@ -49,8 +49,6 @@ CC_NOINLINE String String_FromReadonly(STRING_REF const char* buffer); /* Initialises a string from a compile time array. (leaving 1 byte of room for null terminator) */ #define String_InitArray_NT(str, buffr) str.buffer = buffr; str.length = 0; str.capacity = sizeof(buffr) - 1; -/* Removes all colour codes from the given string. */ -CC_API void String_StripCols(String* str); /* Sets length of dst to 0, then appends all characters in src. */ CC_API void String_Copy(String* dst, const String* src); /* Copies up to capacity characters from src into dst. Appends \0 after if src->length is < capacity. */