diff options
| author | Ray <raysan5@gmail.com> | 2018-05-28 00:48:07 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2018-05-28 00:48:07 +0200 |
| commit | dbff40944a72df4b5435520fc09f3fb68e3cebdf (patch) | |
| tree | add5b694d39c5337f18213657e9493d13bb9232a /examples | |
| parent | 1f0cc57ec7e4c56baf013ecaaab2050282b0733b (diff) | |
| download | raylib-dbff40944a72df4b5435520fc09f3fb68e3cebdf.tar.gz raylib-dbff40944a72df4b5435520fc09f3fb68e3cebdf.zip | |
Corrected issue with floats on TCC
It seems TCC was not casting correctly int values to float in some
specific situations
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/textures/textures_rectangle.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/textures/textures_rectangle.c b/examples/textures/textures_rectangle.c index c90db8ac..e1247746 100644 --- a/examples/textures/textures_rectangle.c +++ b/examples/textures/textures_rectangle.c @@ -27,7 +27,7 @@ int main() Texture2D scarfy = LoadTexture("resources/scarfy.png"); // Texture loading Vector2 position = { 350.0f, 280.0f }; - Rectangle frameRec = { 0, 0, scarfy.width/6, scarfy.height }; + Rectangle frameRec = { 0.0f, 0.0f, (float)scarfy.width/6, (float)scarfy.height }; int currentFrame = 0; int framesCounter = 0; @@ -50,7 +50,7 @@ int main() if (currentFrame > 5) currentFrame = 0; - frameRec.x = currentFrame*scarfy.width/6; + frameRec.x = (float)currentFrame*(float)scarfy.width/6; } if (IsKeyPressed(KEY_RIGHT)) framesSpeed++; |
