diff --git a/src/Drawer2D.c b/src/Drawer2D.c index 7d122d5ba..c8a63d88f 100644 --- a/src/Drawer2D.c +++ b/src/Drawer2D.c @@ -323,7 +323,6 @@ bool Drawer2D_ValidColCodeAt(const String* text, int i) { if (i >= text->length) return false; return Drawer2D_GetCol(text->buffer[i]).A > 0; } -bool Drawer2D_ValidColCode(char c) { return Drawer2D_GetCol(c).A > 0; } bool Drawer2D_IsEmptyText(const String* text) { int i; diff --git a/src/Drawer2D.h b/src/Drawer2D.h index 61a7ec834..4baa88abb 100644 --- a/src/Drawer2D.h +++ b/src/Drawer2D.h @@ -73,12 +73,12 @@ void Drawer2D_Clear(Bitmap* bmp, BitmapCol col, int x, int y, int width, int hei void Drawer2D_Underline(Bitmap* bmp, int x, int y, int width, int height, BitmapCol col); /* Draws text using the given font at the given coordinates. */ -void Drawer2D_DrawText(Bitmap* bmp, struct DrawTextArgs* args, int x, int y); +CC_API void Drawer2D_DrawText(Bitmap* bmp, struct DrawTextArgs* args, int x, int y); /* Returns how wide the given text would be when drawn. */ int Drawer2D_TextWidth(struct DrawTextArgs* args); /* Returns size the given text would be when drawn. */ /* NOTE: Height returned only depends on the font. (see Drawer2D_FontHeight).*/ -Size2D Drawer2D_MeasureText(struct DrawTextArgs* args); +CC_API Size2D Drawer2D_MeasureText(struct DrawTextArgs* args); /* Similar to Drawer2D_DrawText, but trims the text with trailing ".." if wider than maxWidth. */ void Drawer2D_DrawClippedText(Bitmap* bmp, struct DrawTextArgs* args, int x, int y, int maxWidth); /* Returns the line height for drawing any character in the font. */ @@ -86,17 +86,20 @@ int Drawer2D_FontHeight(const FontDesc* font, bool useShadow); /* Creates a texture consisting only of the given text drawn onto it. */ /* NOTE: The returned texture is always padded up to nearest power of two dimensions. */ -void Drawer2D_MakeTextTexture(struct Texture* tex, struct DrawTextArgs* args, int X, int Y); +CC_API void Drawer2D_MakeTextTexture(struct Texture* tex, struct DrawTextArgs* args, int X, int Y); /* Creates a texture consisting of the pixels from the given bitmap. */ /* NOTE: bmp must always have power of two dimensions. */ /* used specifies what region of the texture actually should be drawn. */ -void Drawer2D_Make2DTexture(struct Texture* tex, Bitmap* bmp, Size2D used, int X, int Y); +CC_API void Drawer2D_Make2DTexture(struct Texture* tex, Bitmap* bmp, Size2D used, int X, int Y); /* Returns whether the given colour code is used/valid. */ bool Drawer2D_ValidColCodeAt(const String* text, int i); /* Returns whether the given colour code is used/valid. */ /* NOTE: This can change if the server defines custom colour codes. */ -bool Drawer2D_ValidColCode(char c); +static CC_INLINE bool Drawer2D_ValidColCode(char c) { + return Drawer2D_GetCol(c).A > 0; +} + /* Whether text is empty or consists purely of valid colour codes. */ bool Drawer2D_IsEmptyText(const String* text); /* Returns the last valid colour code in the given input, or \0 if not found. */