diff options
| author | raysan5 <raysan5@gmail.com> | 2016-08-08 17:21:46 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-08-08 17:21:46 +0200 |
| commit | ed387d00aaaee50ef7d4dc2f355123e16c7727ca (patch) | |
| tree | 0b11e66ec52bd894f268ba4dcee9b847cff69b6c | |
| parent | 7fbd821727228396e03f47786a4db27f00aaebba (diff) | |
| download | raylib-ed387d00aaaee50ef7d4dc2f355123e16c7727ca.tar.gz raylib-ed387d00aaaee50ef7d4dc2f355123e16c7727ca.zip | |
Corrected issue with VS
| -rw-r--r-- | src/text.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -859,7 +859,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); unsigned char *dataBitmap = (unsigned char *)malloc(FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT*sizeof(unsigned char)); // One channel bitmap returned! - stbtt_bakedchar charData[numChars]; + stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*numChars); SpriteFont font = { 0 }; @@ -922,6 +922,8 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int font.charOffsets[i] = (Vector2){ charData[i].xoff, charData[i].yoff }; font.charAdvanceX[i] = (int)charData[i].xadvance; } + + free(charData); return font; }
\ No newline at end of file |
