mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
remove String_StripCols from public API
This commit is contained in:
parent
556134290b
commit
3c6d837088
@ -723,7 +723,7 @@ void Font_Free(struct FontDesc* desc) {
|
|||||||
|
|
||||||
void SysFonts_Register(const String* path) { }
|
void SysFonts_Register(const String* path) { }
|
||||||
static int Font_SysTextWidth(struct DrawTextArgs* args) { return 0; }
|
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
|
#else
|
||||||
#include "freetype/ft2build.h"
|
#include "freetype/ft2build.h"
|
||||||
#include "freetype/freetype.h"
|
#include "freetype/freetype.h"
|
||||||
|
@ -134,6 +134,15 @@ static void AddTablistEntry(EntityID id, const String* playerName, const String*
|
|||||||
TabList_Set(id, &rawName, listName, groupName, groupRank);
|
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) {
|
static void CheckName(EntityID id, String* name, String* skin) {
|
||||||
String colorlessName; char colorlessBuffer[STRING_SIZE];
|
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);
|
if (!skin->length) String_Copy(skin, name);
|
||||||
RemoveEndPlus(skin);
|
RemoveEndPlus(skin);
|
||||||
String_StripCols(skin);
|
StripCols(skin);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Classic_ReadAbsoluteLocation(cc_uint8* data, EntityID id, cc_bool interpolate);
|
static void Classic_ReadAbsoluteLocation(cc_uint8* data, EntityID id, cc_bool interpolate);
|
||||||
|
@ -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) {
|
void String_Copy(String* dst, const String* src) {
|
||||||
dst->length = 0;
|
dst->length = 0;
|
||||||
String_AppendString(dst, src);
|
String_AppendString(dst, src);
|
||||||
|
@ -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) */
|
/* 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;
|
#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. */
|
/* Sets length of dst to 0, then appends all characters in src. */
|
||||||
CC_API void String_Copy(String* dst, const String* 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. */
|
/* Copies up to capacity characters from src into dst. Appends \0 after if src->length is < capacity. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user