summaryrefslogtreecommitdiffhomepage
path: root/examples/textures/textures_draw_tiled.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_draw_tiled.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_draw_tiled.c')
-rw-r--r--examples/textures/textures_draw_tiled.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/textures/textures_draw_tiled.c b/examples/textures/textures_draw_tiled.c
index 7d8a3c41..97bffc80 100644
--- a/examples/textures/textures_draw_tiled.c
+++ b/examples/textures/textures_draw_tiled.c
@@ -47,10 +47,10 @@ int main(int argc, char **argv)
// Calculate rectangle for each color
for (int i = 0, x = 0, y = 0; i < MAX_COLORS; i++)
{
- colorRec[i].x = 2 + MARGIN_SIZE + x;
- colorRec[i].y = 22 + 256 + MARGIN_SIZE + y;
- colorRec[i].width = COLOR_SIZE*2;
- colorRec[i].height = COLOR_SIZE;
+ colorRec[i].x = 2.0f + MARGIN_SIZE + x;
+ colorRec[i].y = 22.0f + 256.0f + MARGIN_SIZE + y;
+ colorRec[i].width = COLOR_SIZE*2.0f;
+ colorRec[i].height = (float)COLOR_SIZE;
if (i == (MAX_COLORS/2 - 1))
{
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
ClearBackground(RAYWHITE);
// Draw the tiled area
- DrawTextureTiled(texPattern, recPattern[activePattern], (Rectangle){OPT_WIDTH+MARGIN_SIZE, MARGIN_SIZE, screenWidth - OPT_WIDTH - 2*MARGIN_SIZE, screenHeight - 2*MARGIN_SIZE},
+ DrawTextureTiled(texPattern, recPattern[activePattern], (Rectangle){(float)OPT_WIDTH+MARGIN_SIZE, (float)MARGIN_SIZE, screenWidth - OPT_WIDTH - 2.0f*MARGIN_SIZE, screenHeight - 2.0f*MARGIN_SIZE},
(Vector2){0.0f, 0.0f}, rotation, scale, colors[activeCol]);
// Draw options
@@ -130,13 +130,13 @@ int main(int argc, char **argv)
DrawText("Select Pattern", 2 + MARGIN_SIZE, 30 + MARGIN_SIZE, 10, BLACK);
DrawTexture(texPattern, 2 + MARGIN_SIZE, 40 + MARGIN_SIZE, BLACK);
- DrawRectangle(2 + MARGIN_SIZE + recPattern[activePattern].x, 40 + MARGIN_SIZE + recPattern[activePattern].y, recPattern[activePattern].width, recPattern[activePattern].height, ColorAlpha(DARKBLUE, 0.3f));
+ DrawRectangle(2 + MARGIN_SIZE + (int)recPattern[activePattern].x, 40 + MARGIN_SIZE + (int)recPattern[activePattern].y, (int)recPattern[activePattern].width, (int)recPattern[activePattern].height, ColorAlpha(DARKBLUE, 0.3f));
DrawText("Select Color", 2+MARGIN_SIZE, 10+256+MARGIN_SIZE, 10, BLACK);
for (int i = 0; i < MAX_COLORS; i++)
{
DrawRectangleRec(colorRec[i], colors[i]);
- if (activeCol == i) DrawRectangleLinesEx(colorRec[i], 3.0f, ColorAlpha(WHITE, 0.5f));
+ if (activeCol == i) DrawRectangleLinesEx(colorRec[i], 3, ColorAlpha(WHITE, 0.5f));
}
DrawText("Scale (UP/DOWN to change)", 2 + MARGIN_SIZE, 80 + 256 + MARGIN_SIZE, 10, BLACK);