summaryrefslogtreecommitdiffhomepage
path: root/examples/core/core_2d_camera.c
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2021-02-20 14:37:32 -0800
committerGitHub <[email protected]>2021-02-20 23:37:32 +0100
commit48a7cd3c8788799505b4fa9f84cb8f5979397c29 (patch)
treef9cbed3827f8855d0e3c27916930b9d82de3e423 /examples/core/core_2d_camera.c
parent82cdd88ffe6cb9d2f97e34bd0724d791030372bf (diff)
downloadraylib-48a7cd3c8788799505b4fa9f84cb8f5979397c29.tar.gz
raylib-48a7cd3c8788799505b4fa9f84cb8f5979397c29.zip
[Examples] Fix typecast warnings in examples. (#1601)
* Fixing typecast warnings generated by visual studio 2019 in examples. * Changes to fixes based on feedback Co-authored-by: Jeffery Myers <[email protected]>
Diffstat (limited to 'examples/core/core_2d_camera.c')
-rw-r--r--examples/core/core_2d_camera.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/core/core_2d_camera.c b/examples/core/core_2d_camera.c
index d6c85079..0b4754f7 100644
--- a/examples/core/core_2d_camera.c
+++ b/examples/core/core_2d_camera.c
@@ -30,19 +30,19 @@ int main(void)
for (int i = 0; i < MAX_BUILDINGS; i++)
{
- buildings[i].width = GetRandomValue(50, 200);
- buildings[i].height = GetRandomValue(100, 800);
- buildings[i].y = screenHeight - 130 - buildings[i].height;
- buildings[i].x = -6000 + spacing;
+ buildings[i].width = (float)GetRandomValue(50, 200);
+ buildings[i].height = (float)GetRandomValue(100, 800);
+ buildings[i].y = screenHeight - 130.0f - buildings[i].height;
+ buildings[i].x = -6000.0f + spacing;
- spacing += buildings[i].width;
+ spacing += (int)buildings[i].width;
buildColors[i] = (Color){ GetRandomValue(200, 240), GetRandomValue(200, 240), GetRandomValue(200, 250), 255 };
}
Camera2D camera = { 0 };
- camera.target = (Vector2){ player.x + 20, player.y + 20 };
- camera.offset = (Vector2){ screenWidth/2, screenHeight/2 };
+ camera.target = (Vector2){ player.x + 20.0f, player.y + 20.0f };
+ camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
camera.rotation = 0.0f;
camera.zoom = 1.0f;
@@ -98,8 +98,8 @@ int main(void)
DrawRectangleRec(player, RED);
- DrawLine(camera.target.x, -screenHeight*10, camera.target.x, screenHeight*10, GREEN);
- DrawLine(-screenWidth*10, camera.target.y, screenWidth*10, camera.target.y, GREEN);
+ DrawLine((int)camera.target.x, -screenHeight*10, (int)camera.target.x, screenHeight*10, GREEN);
+ DrawLine(-screenWidth*10, (int)camera.target.y, screenWidth*10, (int)camera.target.y, GREEN);
EndMode2D();