diff options
| author | Jeffery Myers <[email protected]> | 2021-03-22 23:51:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-23 07:51:52 +0100 |
| commit | e48b9a6da1d3dd6163b1596e47c58e7026530dc1 (patch) | |
| tree | 9d1bca87d19ae07f7605c112c53971531b109dc2 /examples/textures/textures_mouse_painting.c | |
| parent | c6dd41495b2c0d96cf4d1ca108729ec87c9a0b53 (diff) | |
| download | raylib-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_mouse_painting.c')
| -rw-r--r-- | examples/textures/textures_mouse_painting.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/textures/textures_mouse_painting.c b/examples/textures/textures_mouse_painting.c index e9b876b4..30fd390f 100644 --- a/examples/textures/textures_mouse_painting.c +++ b/examples/textures/textures_mouse_painting.c @@ -35,7 +35,7 @@ int main(void) for (int i = 0; i < MAX_COLORS_COUNT; i++) { - colorsRecs[i].x = 10 + 30*i + 2*i; + colorsRecs[i].x = 10 + 30.0f*i + 2*i; colorsRecs[i].y = 10; colorsRecs[i].width = 30; colorsRecs[i].height = 30; @@ -44,7 +44,7 @@ int main(void) int colorSelected = 0; int colorSelectedPrev = colorSelected; int colorMouseHover = 0; - int brushSize = 20; + float brushSize = 20.0f; bool mouseWasPressed = false; Rectangle btnSaveRec = { 750, 10, 40, 30 }; @@ -113,7 +113,7 @@ int main(void) // NOTE: To avoid discontinuous circles, we could store // previous-next mouse points and just draw a line using brush size BeginTextureMode(target); - if (mousePos.y > 50) DrawCircle(mousePos.x, mousePos.y, brushSize, colors[colorSelected]); + if (mousePos.y > 50) DrawCircle((int)mousePos.x, (int)mousePos.y, brushSize, colors[colorSelected]); EndTextureMode(); } @@ -129,7 +129,7 @@ int main(void) // Erase circle from render texture BeginTextureMode(target); - if (mousePos.y > 50) DrawCircle(mousePos.x, mousePos.y, brushSize, colors[0]); + if (mousePos.y > 50) DrawCircle((int)mousePos.x, (int)mousePos.y, brushSize, colors[0]); EndTextureMode(); } else if (IsMouseButtonReleased(MOUSE_RIGHT_BUTTON) && mouseWasPressed) @@ -172,7 +172,7 @@ int main(void) ClearBackground(RAYWHITE); // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, (Rectangle) { 0, 0, target.texture.width, -target.texture.height }, (Vector2) { 0, 0 }, WHITE); + DrawTextureRec(target.texture, (Rectangle) { 0, 0, (float)target.texture.width, (float)-target.texture.height }, (Vector2) { 0, 0 }, WHITE); // Draw drawing circle for reference if (mousePos.y > 50) |
