diff options
| author | Jeffery Myers <[email protected]> | 2021-10-25 01:21:16 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-25 10:21:16 +0200 |
| commit | daeccd03ace3eacf7907ecca1a697c7d00961cf4 (patch) | |
| tree | 0be2045a1003eed50c1456fd1a380ff970837233 /examples/physics/physics_movement.c | |
| parent | 086f76ba7abefb1b34e1baa353c5f69dfc5dafdc (diff) | |
| download | raylib-daeccd03ace3eacf7907ecca1a697c7d00961cf4.tar.gz raylib-daeccd03ace3eacf7907ecca1a697c7d00961cf4.zip | |
Fix VC warnings for examples (#2085)
Diffstat (limited to 'examples/physics/physics_movement.c')
| -rw-r--r-- | examples/physics/physics_movement.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/physics/physics_movement.c b/examples/physics/physics_movement.c index e13caec7..068611ad 100644 --- a/examples/physics/physics_movement.c +++ b/examples/physics/physics_movement.c @@ -36,11 +36,11 @@ int main(void) InitPhysics(); // Create floor and walls rectangle physics body - PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, screenWidth, 100, 10); + PhysicsBody floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, (float)screenHeight }, (float)screenWidth, 100, 10); PhysicsBody platformLeft = CreatePhysicsBodyRectangle((Vector2){ screenWidth*0.25f, screenHeight*0.6f }, screenWidth*0.25f, 10, 10); PhysicsBody platformRight = CreatePhysicsBodyRectangle((Vector2){ screenWidth*0.75f, screenHeight*0.6f }, screenWidth*0.25f, 10, 10); - PhysicsBody wallLeft = CreatePhysicsBodyRectangle((Vector2){ -5, screenHeight/2 }, 10, screenHeight, 10); - PhysicsBody wallRight = CreatePhysicsBodyRectangle((Vector2){ screenWidth + 5, screenHeight/2 }, 10, screenHeight, 10); + PhysicsBody wallLeft = CreatePhysicsBodyRectangle((Vector2){ -5, screenHeight/2.0f }, 10, (float)screenHeight, 10); + PhysicsBody wallRight = CreatePhysicsBodyRectangle((Vector2){ (float)screenWidth + 5, screenHeight/2.0f }, 10, (float)screenHeight, 10); // Disable dynamics to floor and walls physics bodies floor->enabled = false; @@ -50,7 +50,7 @@ int main(void) wallRight->enabled = false; // Create movement physics body - PhysicsBody body = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight/2 }, 50, 50, 1); + PhysicsBody body = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2.0f, screenHeight/2.0f }, 50, 50, 1); body->freezeOrient = true; // Constrain body rotation to avoid little collision torque amounts SetTargetFPS(60); // Set our game to run at 60 frames-per-second @@ -66,7 +66,7 @@ int main(void) if (IsKeyPressed(KEY_R)) // Reset physics input { // Reset movement physics body position, velocity and rotation - body->position = (Vector2){ screenWidth/2, screenHeight/2 }; + body->position = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; body->velocity = (Vector2){ 0, 0 }; SetPhysicsBodyRotation(body, 0); } |
