summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-01-06 19:49:52 +0100
committerraysan5 <[email protected]>2020-01-06 19:49:52 +0100
commitb5b3bbb30b38b00eb0ded0520a66091af2df72cd (patch)
tree1747da81f2027aee7e7133b81b7442c508f4a74d
parent615cb35d96f1f1ab30455132b1a889799ca4e56f (diff)
downloadraylib-b5b3bbb30b38b00eb0ded0520a66091af2df72cd.tar.gz
raylib-b5b3bbb30b38b00eb0ded0520a66091af2df72cd.zip
Review variable name
-rw-r--r--src/text.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/text.c b/src/text.c
index 1863c76d..2d3556be 100644
--- a/src/text.c
+++ b/src/text.c
@@ -447,39 +447,39 @@ Font LoadFontFromImage(Image image, Color key, int firstChar)
RL_FREE(pixels); // Free pixels array memory
// Create spritefont with all data parsed from image
- Font spriteFont = { 0 };
+ Font font = { 0 };
- spriteFont.texture = LoadTextureFromImage(fontClear); // Convert processed image to OpenGL texture
- spriteFont.charsCount = index;
+ font.texture = LoadTextureFromImage(fontClear); // Convert processed image to OpenGL texture
+ font.charsCount = index;
// We got tempCharValues and tempCharsRecs populated with chars data
// Now we move temp data to sized charValues and charRecs arrays
- spriteFont.chars = (CharInfo *)RL_MALLOC(spriteFont.charsCount*sizeof(CharInfo));
- spriteFont.recs = (Rectangle *)RL_MALLOC(spriteFont.charsCount*sizeof(Rectangle));
+ font.chars = (CharInfo *)RL_MALLOC(font.charsCount*sizeof(CharInfo));
+ font.recs = (Rectangle *)RL_MALLOC(font.charsCount*sizeof(Rectangle));
- for (int i = 0; i < spriteFont.charsCount; i++)
+ for (int i = 0; i < font.charsCount; i++)
{
- spriteFont.chars[i].value = tempCharValues[i];
+ font.chars[i].value = tempCharValues[i];
// Get character rectangle in the font atlas texture
- spriteFont.recs[i] = tempCharRecs[i];
+ font.recs[i] = tempCharRecs[i];
// NOTE: On image based fonts (XNA style), character offsets and xAdvance are not required (set to 0)
- spriteFont.chars[i].offsetX = 0;
- spriteFont.chars[i].offsetY = 0;
- spriteFont.chars[i].advanceX = 0;
+ font.chars[i].offsetX = 0;
+ font.chars[i].offsetY = 0;
+ font.chars[i].advanceX = 0;
// Fill character image data from fontClear data
- spriteFont.chars[i].image = ImageFromImage(fontClear, tempCharRecs[i]);
+ font.chars[i].image = ImageFromImage(fontClear, tempCharRecs[i]);
}
UnloadImage(fontClear); // Unload processed image once converted to texture
- spriteFont.baseSize = (int)spriteFont.recs[0].height;
+ font.baseSize = (int)font.recs[0].height;
TraceLog(LOG_INFO, "Image file loaded correctly as Font");
- return spriteFont;
+ return font;
}
// Load font data for further use
@@ -742,7 +742,7 @@ Image GenImageFontAtlas(const CharInfo *chars, Rectangle **charRecs, int charsCo
// Unload Font from GPU memory (VRAM)
void UnloadFont(Font font)
{
- // NOTE: Make sure spriteFont is not default font (fallback)
+ // NOTE: Make sure font is not default font (fallback)
if (font.texture.id != GetFontDefault().texture.id)
{
for (int i = 0; i < font.charsCount; i++) UnloadImage(font.chars[i].image);