summaryrefslogtreecommitdiffhomepage
path: root/examples/shapes
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/shapes
parent87198586554e218834542098ec40e6611452c3aa (diff)
downloadraylib-6c518008a58853197890b45e941f342e4195de60.tar.gz
raylib-6c518008a58853197890b45e941f342e4195de60.zip
Fixes for 64 bit typecast warnings (#1733)
Diffstat (limited to 'examples/shapes')
-rw-r--r--examples/shapes/shapes_basic_shapes.c12
-rw-r--r--examples/shapes/shapes_colors_palette.c8
-rw-r--r--examples/shapes/shapes_following_eyes.c8
-rw-r--r--examples/shapes/shapes_lines_bezier.c2
4 files changed, 15 insertions, 15 deletions
diff --git a/examples/shapes/shapes_basic_shapes.c b/examples/shapes/shapes_basic_shapes.c
index f7a8d02f..cd165d2e 100644
--- a/examples/shapes/shapes_basic_shapes.c
+++ b/examples/shapes/shapes_basic_shapes.c
@@ -45,9 +45,9 @@ int main(void)
DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines
DrawRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, MAROON, GOLD);
- DrawTriangle((Vector2){screenWidth/4*3, 80},
- (Vector2){screenWidth/4*3 - 60, 150},
- (Vector2){screenWidth/4*3 + 60, 150}, VIOLET);
+ DrawTriangle((Vector2){screenWidth/4.0f *3.0f, 80.0f},
+ (Vector2){screenWidth/4.0f *3.0f - 60.0f, 150.0f},
+ (Vector2){screenWidth/4.0f *3.0f + 60.0f, 150.0f}, VIOLET);
DrawPoly((Vector2){screenWidth/4*3, 320}, 6, 80, 0, BROWN);
@@ -57,9 +57,9 @@ int main(void)
// this way, all LINES are rendered in a single draw pass
DrawLine(18, 42, screenWidth - 18, 42, BLACK);
DrawCircleLines(screenWidth/4, 340, 80, DARKBLUE);
- DrawTriangleLines((Vector2){screenWidth/4*3, 160},
- (Vector2){screenWidth/4*3 - 20, 230},
- (Vector2){screenWidth/4*3 + 20, 230}, DARKBLUE);
+ DrawTriangleLines((Vector2){screenWidth/4.0f*3.0f, 160.0f},
+ (Vector2){screenWidth/4.0f*3.0f - 20.0f, 230.0f},
+ (Vector2){screenWidth/4.0f*3.0f + 20.0f, 230.0f}, DARKBLUE);
EndDrawing();
//----------------------------------------------------------------------------------
}
diff --git a/examples/shapes/shapes_colors_palette.c b/examples/shapes/shapes_colors_palette.c
index a0bba002..0865d581 100644
--- a/examples/shapes/shapes_colors_palette.c
+++ b/examples/shapes/shapes_colors_palette.c
@@ -37,10 +37,10 @@ int main(void)
// Fills colorsRecs data (for every rectangle)
for (int i = 0; i < MAX_COLORS_COUNT; i++)
{
- colorsRecs[i].x = 20 + 100*(i%7) + 10*(i%7);
- colorsRecs[i].y = 80 + 100*(i/7) + 10*(i/7);
- colorsRecs[i].width = 100;
- colorsRecs[i].height = 100;
+ colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7);
+ colorsRecs[i].y = 80.0f + 100.0f *(i/7) + 10.0f *(i/7);
+ colorsRecs[i].width = 100.0f;
+ colorsRecs[i].height = 100.0f;
}
int colorState[MAX_COLORS_COUNT] = { 0 }; // Color state: 0-DEFAULT, 1-MOUSE_HOVER
diff --git a/examples/shapes/shapes_following_eyes.c b/examples/shapes/shapes_following_eyes.c
index a36a8d67..9ded4feb 100644
--- a/examples/shapes/shapes_following_eyes.c
+++ b/examples/shapes/shapes_following_eyes.c
@@ -22,12 +22,12 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - following eyes");
- Vector2 scleraLeftPosition = { GetScreenWidth()/2 - 100, GetScreenHeight()/2 };
- Vector2 scleraRightPosition = { GetScreenWidth()/2 + 100, GetScreenHeight()/2 };
+ Vector2 scleraLeftPosition = { GetScreenWidth()/2.0f - 100.0f, GetScreenHeight()/2.0f };
+ Vector2 scleraRightPosition = { GetScreenWidth()/2.0f + 100.0f, GetScreenHeight()/2.0f };
float scleraRadius = 80;
- Vector2 irisLeftPosition = { GetScreenWidth()/2 - 100, GetScreenHeight()/2 };
- Vector2 irisRightPosition = { GetScreenWidth()/2 + 100, GetScreenHeight()/2};
+ Vector2 irisLeftPosition = { GetScreenWidth()/2.0f - 100.0f, GetScreenHeight()/2.0f };
+ Vector2 irisRightPosition = { GetScreenWidth()/2.0f + 100.0f, GetScreenHeight()/2.0f };
float irisRadius = 24;
float angle = 0.0f;
diff --git a/examples/shapes/shapes_lines_bezier.c b/examples/shapes/shapes_lines_bezier.c
index 3d4edcde..00b68c9f 100644
--- a/examples/shapes/shapes_lines_bezier.c
+++ b/examples/shapes/shapes_lines_bezier.c
@@ -22,7 +22,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - cubic-bezier lines");
Vector2 start = { 0, 0 };
- Vector2 end = { screenWidth, screenHeight };
+ Vector2 end = { (float)screenWidth, (float)screenHeight };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------