diff options
| author | Ray <[email protected]> | 2024-05-29 17:28:55 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2024-05-29 17:28:55 +0200 |
| commit | e37d19ab1eae7d4d0e9d3229c7b2ececf3efb61f (patch) | |
| tree | 93136143af39f594a33b8cf790e3442a5e04226b | |
| parent | 2804e758694390d00a0784ebe761531f7021bfc9 (diff) | |
| download | raylib-e37d19ab1eae7d4d0e9d3229c7b2ececf3efb61f.tar.gz raylib-e37d19ab1eae7d4d0e9d3229c7b2ececf3efb61f.zip | |
REVIEWED: `ExportFontAsCode()`, avoid `const` #4013
| -rw-r--r-- | src/rtext.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rtext.c b/src/rtext.c index 5ebabc66..5ba4e8b6 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1035,7 +1035,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // Save font recs data byteCount += sprintf(txtData + byteCount, "// Font characters rectangles data\n"); - byteCount += sprintf(txtData + byteCount, "static const Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); + byteCount += sprintf(txtData + byteCount, "static Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); for (int i = 0; i < font.glyphCount; i++) { byteCount += sprintf(txtData + byteCount, " { %1.0f, %1.0f, %1.0f , %1.0f },\n", font.recs[i].x, font.recs[i].y, font.recs[i].width, font.recs[i].height); @@ -1047,7 +1047,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // it could be generated from image and recs byteCount += sprintf(txtData + byteCount, "// Font glyphs info data\n"); byteCount += sprintf(txtData + byteCount, "// NOTE: No glyphs.image data provided\n"); - byteCount += sprintf(txtData + byteCount, "static const GlyphInfo fontGlyphs_%s[%i] = {\n", fileNamePascal, font.glyphCount); + byteCount += sprintf(txtData + byteCount, "static GlyphInfo fontGlyphs_%s[%i] = {\n", fileNamePascal, font.glyphCount); for (int i = 0; i < font.glyphCount; i++) { byteCount += sprintf(txtData + byteCount, " { %i, %i, %i, %i, { 0 }},\n", font.glyphs[i].value, font.glyphs[i].offsetX, font.glyphs[i].offsetY, font.glyphs[i].advanceX); @@ -1093,8 +1093,8 @@ bool ExportFontAsCode(Font font, const char *fileName) #else byteCount += sprintf(txtData + byteCount, " // Assign glyph recs and info data directly\n"); byteCount += sprintf(txtData + byteCount, " // WARNING: This font data must not be unloaded\n"); - byteCount += sprintf(txtData + byteCount, " font.recs = (Rectangle *)fontRecs_%s;\n", fileNamePascal); - byteCount += sprintf(txtData + byteCount, " font.glyphs = (GlyphInfo *)fontGlyphs_%s;\n\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.recs = fontRecs_%s;\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.glyphs = fontGlyphs_%s;\n\n", fileNamePascal); #endif byteCount += sprintf(txtData + byteCount, " return font;\n"); byteCount += sprintf(txtData + byteCount, "}\n"); |
