summaryrefslogtreecommitdiffhomepage
path: root/examples/text
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2021-04-25 09:50:26 -0700
committerGitHub <[email protected]>2021-04-25 18:50:26 +0200
commit6c518008a58853197890b45e941f342e4195de60 (patch)
tree429e12c1ee0c6206c69c7a93c7726aa3ab3d533b /examples/text
parent87198586554e218834542098ec40e6611452c3aa (diff)
downloadraylib-6c518008a58853197890b45e941f342e4195de60.tar.gz
raylib-6c518008a58853197890b45e941f342e4195de60.zip
Fixes for 64 bit typecast warnings (#1733)
Diffstat (limited to 'examples/text')
-rw-r--r--examples/text/text_font_filters.c6
-rw-r--r--examples/text/text_font_spritefont.c12
-rw-r--r--examples/text/text_raylib_fonts.c4
-rw-r--r--examples/text/text_rectangle_bounds.c8
4 files changed, 15 insertions, 15 deletions
diff --git a/examples/text/text_font_filters.c b/examples/text/text_font_filters.c
index 9ad5cff4..71213ced 100644
--- a/examples/text/text_font_filters.c
+++ b/examples/text/text_font_filters.c
@@ -35,8 +35,8 @@ int main(void)
// NOTE: On 2D drawing it won't be noticeable, it looks like FILTER_BILINEAR
GenTextureMipmaps(&font.texture);
- float fontSize = font.baseSize;
- Vector2 fontPosition = { 40, screenHeight/2 - 80 };
+ float fontSize = (float)font.baseSize;
+ Vector2 fontPosition = { 40.0f, screenHeight/2.0f - 80.0f };
Vector2 textSize = { 0.0f, 0.0f };
// Setup texture scaling filter
@@ -86,7 +86,7 @@ int main(void)
if (IsFileExtension(droppedFiles[0], ".ttf"))
{
UnloadFont(font);
- font = LoadFontEx(droppedFiles[0], fontSize, 0, 0);
+ font = LoadFontEx(droppedFiles[0], (int)fontSize, 0, 0);
ClearDroppedFiles();
}
}
diff --git a/examples/text/text_font_spritefont.c b/examples/text/text_font_spritefont.c
index 8ff63bb9..424e2719 100644
--- a/examples/text/text_font_spritefont.c
+++ b/examples/text/text_font_spritefont.c
@@ -38,14 +38,14 @@ int main(void)
Font font2 = LoadFont("resources/custom_alagard.png"); // Font loading
Font font3 = LoadFont("resources/custom_jupiter_crash.png"); // Font loading
- Vector2 fontPosition1 = { screenWidth/2 - MeasureTextEx(font1, msg1, (float)font1.baseSize, -3).x/2,
- screenHeight/2 - font1.baseSize/2 - 80 };
+ Vector2 fontPosition1 = { screenWidth/2.0f - MeasureTextEx(font1, msg1, (float)font1.baseSize, -3).x/2,
+ screenHeight/2.0f - font1.baseSize/2.0f - 80.0f };
- Vector2 fontPosition2 = { screenWidth/2 - MeasureTextEx(font2, msg2, (float)font2.baseSize, -2).x/2,
- screenHeight/2 - font2.baseSize/2 - 10 };
+ Vector2 fontPosition2 = { screenWidth/2.0f - MeasureTextEx(font2, msg2, (float)font2.baseSize, -2.0f).x/2.0f,
+ screenHeight/2.0f - font2.baseSize/2.0f - 10.0f };
- Vector2 fontPosition3 = { screenWidth/2.0f - MeasureTextEx(font3, msg3, (float)font3.baseSize, 2).x/2,
- screenHeight/2.0f - font3.baseSize/2 + 50 };
+ Vector2 fontPosition3 = { screenWidth/2.0f - MeasureTextEx(font3, msg3, (float)font3.baseSize, 2.0f).x/2.0f,
+ screenHeight/2.0f - font3.baseSize/2.0f + 50.0f };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
diff --git a/examples/text/text_raylib_fonts.c b/examples/text/text_raylib_fonts.c
index 782a5f87..7bcfb7f6 100644
--- a/examples/text/text_raylib_fonts.c
+++ b/examples/text/text_raylib_fonts.c
@@ -52,8 +52,8 @@ int main(void)
for (int i = 0; i < MAX_FONTS; i++)
{
- positions[i].x = screenWidth/2.0f - MeasureTextEx(fonts[i], messages[i], fonts[i].baseSize*2.0f, spacings[i]).x/2.0f;
- positions[i].y = 60 + fonts[i].baseSize + 45*i;
+ positions[i].x = screenWidth/2.0f - MeasureTextEx(fonts[i], messages[i], fonts[i].baseSize*2.0f, (float)spacings[i]).x/2.0f;
+ positions[i].y = 60.0f + fonts[i].baseSize + 45.0f*i;
}
// Small Y position corrections
diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c
index 4d3edacc..cb246955 100644
--- a/examples/text/text_rectangle_bounds.c
+++ b/examples/text/text_rectangle_bounds.c
@@ -29,14 +29,14 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris
bool resizing = false;
bool wordWrap = true;
- Rectangle container = { 25, 25, screenWidth - 50, screenHeight - 250};
+ Rectangle container = { 25.0f, 25.0f, screenWidth - 50.0f, screenHeight - 250.0f };
Rectangle resizer = { container.x + container.width - 17, container.y + container.height - 17, 14, 14 };
// Minimum width and heigh for the container rectangle
const float minWidth = 60;
const float minHeight = 60;
- const float maxWidth = screenWidth - 50;
- const float maxHeight = screenHeight - 160;
+ const float maxWidth = screenWidth - 50.0f;
+ const float maxHeight = screenHeight - 160.0f;
Vector2 lastMouse = { 0.0f, 0.0f }; // Stores last mouse coordinates
Color borderColor = MAROON; // Container border color
@@ -99,7 +99,7 @@ tempor incididunt ut labore et dolore magna aliqua. Nec ullamcorper sit amet ris
// Draw bottom info
DrawRectangle(0, screenHeight - 54, screenWidth, 54, GRAY);
- DrawRectangleRec((Rectangle){ 382, screenHeight - 34, 12, 12 }, MAROON);
+ DrawRectangleRec((Rectangle){ 382.0f, screenHeight - 34.0f, 12.0f, 12.0f }, MAROON);
DrawText("Word Wrap: ", 313, screenHeight-115, 20, BLACK);
if (wordWrap) DrawText("ON", 447, screenHeight - 115, 20, RED);