summaryrefslogtreecommitdiffhomepage
path: root/examples/textures/textures_sprite_button.c
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2021-03-22 23:51:52 -0700
committerGitHub <[email protected]>2021-03-23 07:51:52 +0100
commite48b9a6da1d3dd6163b1596e47c58e7026530dc1 (patch)
tree9d1bca87d19ae07f7605c112c53971531b109dc2 /examples/textures/textures_sprite_button.c
parentc6dd41495b2c0d96cf4d1ca108729ec87c9a0b53 (diff)
downloadraylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.tar.gz
raylib-e48b9a6da1d3dd6163b1596e47c58e7026530dc1.zip
[Examples] Warning fixes (pt 1) (#1668)
* Fix some warnings in examples. * cleanups from review Co-authored-by: Jeffery Myers <[email protected]>
Diffstat (limited to 'examples/textures/textures_sprite_button.c')
-rw-r--r--examples/textures/textures_sprite_button.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/textures/textures_sprite_button.c b/examples/textures/textures_sprite_button.c
index a5b2d8d1..6ca4ea90 100644
--- a/examples/textures/textures_sprite_button.c
+++ b/examples/textures/textures_sprite_button.c
@@ -28,11 +28,11 @@ int main(void)
Texture2D button = LoadTexture("resources/button.png"); // Load button texture
// Define frame rectangle for drawing
- int frameHeight = button.height/NUM_FRAMES;
- Rectangle sourceRec = { 0, 0, button.width, frameHeight };
+ float frameHeight = (float)button.height/NUM_FRAMES;
+ Rectangle sourceRec = { 0, 0, (float)button.width, frameHeight };
// Define button bounds on screen
- Rectangle btnBounds = { screenWidth/2 - button.width/2, screenHeight/2 - button.height/NUM_FRAMES/2, button.width, frameHeight };
+ Rectangle btnBounds = { screenWidth/2.0f - button.width/2.0f, screenHeight/2.0f - button.height/NUM_FRAMES/2.0f, (float)button.width, frameHeight };
int btnState = 0; // Button state: 0-NORMAL, 1-MOUSE_HOVER, 2-PRESSED
bool btnAction = false; // Button action should be activated