mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-04 00:46:27 +00:00
Fix a dependance of rtexture to rtext (#4171)
This commit is contained in:
@@ -1213,6 +1213,7 @@ Image GenImageText(int width, int height, const char *text)
|
|||||||
{
|
{
|
||||||
Image image = { 0 };
|
Image image = { 0 };
|
||||||
|
|
||||||
|
#ifdef SUPPORT_MODULE_RTEXT
|
||||||
int textLength = TextLength(text);
|
int textLength = TextLength(text);
|
||||||
int imageViewSize = width*height;
|
int imageViewSize = width*height;
|
||||||
|
|
||||||
@@ -1223,6 +1224,10 @@ Image GenImageText(int width, int height, const char *text)
|
|||||||
image.mipmaps = 1;
|
image.mipmaps = 1;
|
||||||
|
|
||||||
memcpy(image.data, text, (textLength > imageViewSize)? imageViewSize : textLength);
|
memcpy(image.data, text, (textLength > imageViewSize)? imageViewSize : textLength);
|
||||||
|
#else
|
||||||
|
TRACELOG(LOG_WARNING, "IMAGE: GenImageText() requires module: rtext");
|
||||||
|
image = GenImageColor(width, height, BLACK); // Generating placeholder black image rectangle
|
||||||
|
#endif
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user