summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRay <[email protected]>2018-08-06 20:43:28 +0200
committerGitHub <[email protected]>2018-08-06 20:43:28 +0200
commit61b32e45ed9f28c2d41a0d004032941ab27780a3 (patch)
tree919cae03feed99f32eadaba16ac3407ee2b1a602 /examples
parentd4bb444fe502c85e1b93e27da58d965ed7b76e74 (diff)
parentf5f7ed79b820209e8d1cda0159b3d42d2aff196b (diff)
downloadraylib-61b32e45ed9f28c2d41a0d004032941ab27780a3.tar.gz
raylib-61b32e45ed9f28c2d41a0d004032941ab27780a3.zip
Merge pull request #618 from kimkulling/fix_compiler_warnings
Fix compiler warnings
Diffstat (limited to 'examples')
-rw-r--r--examples/textures/textures_image_processing.c6
-rw-r--r--examples/textures/textures_image_text.c6
-rw-r--r--examples/textures/textures_particles_blending.c6
-rw-r--r--examples/textures/textures_srcrec_dstrec.c12
4 files changed, 15 insertions, 15 deletions
diff --git a/examples/textures/textures_image_processing.c b/examples/textures/textures_image_processing.c
index 427faa60..6d33d95b 100644
--- a/examples/textures/textures_image_processing.c
+++ b/examples/textures/textures_image_processing.c
@@ -59,7 +59,7 @@ int main()
Rectangle selectRecs[NUM_PROCESSES];
- for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40, 50 + 32*i, 150, 30 };
+ for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40.0f, (float)(50 + 32*i), 150.0f, 30.0f };
SetTargetFPS(60);
//---------------------------------------------------------------------------------------
@@ -122,8 +122,8 @@ int main()
for (int i = 0; i < NUM_PROCESSES; i++)
{
DrawRectangleRec(selectRecs[i], (i == currentProcess) ? SKYBLUE : LIGHTGRAY);
- DrawRectangleLines(selectRecs[i].x, selectRecs[i].y, selectRecs[i].width, selectRecs[i].height, (i == currentProcess) ? BLUE : GRAY);
- DrawText(processText[i], selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2, selectRecs[i].y + 11, 10, (i == currentProcess) ? DARKBLUE : DARKGRAY);
+ DrawRectangleLines((int)selectRecs[i].x, (int) selectRecs[i].y, (int) selectRecs[i].width, (int) selectRecs[i].height, (i == currentProcess) ? BLUE : GRAY);
+ DrawText( processText[i], (int)( selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2), (int) selectRecs[i].y + 11, 10, (i == currentProcess) ? DARKBLUE : DARKGRAY);
}
DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, WHITE);
diff --git a/examples/textures/textures_image_text.c b/examples/textures/textures_image_text.c
index 78d25c14..c69f0f55 100644
--- a/examples/textures/textures_image_text.c
+++ b/examples/textures/textures_image_text.c
@@ -26,12 +26,12 @@ int main()
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
// Draw over image using custom font
- ImageDrawTextEx(&parrots, (Vector2){ 20, 20 }, font, "[Parrots font drawing]", font.baseSize, 0, WHITE);
+ ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, WHITE);
Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM)
UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
- Vector2 position = { screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 20 };
+ Vector2 position = { (float)(screenWidth/2 - texture.width/2), (float)(screenHeight/2 - texture.height/2 - 20) };
bool showFont = false;
@@ -60,7 +60,7 @@ int main()
// Draw text directly using sprite font
DrawTextEx(font, "[Parrots font drawing]", (Vector2){ position.x + 20,
- position.y + 20 + 280 }, font.baseSize, 0, WHITE);
+ position.y + 20 + 280 }, (float)font.baseSize, 0.0f, WHITE);
}
else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, BLACK);
diff --git a/examples/textures/textures_particles_blending.c b/examples/textures/textures_particles_blending.c
index 842ac77d..b56bc04f 100644
--- a/examples/textures/textures_particles_blending.c
+++ b/examples/textures/textures_particles_blending.c
@@ -42,7 +42,7 @@ int main()
mouseTail[i].color = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
mouseTail[i].alpha = 1.0f;
mouseTail[i].size = (float)GetRandomValue(1, 30)/20.0f;
- mouseTail[i].rotation = GetRandomValue(0, 360);
+ mouseTail[i].rotation = (float) GetRandomValue(0, 360);
mouseTail[i].active = false;
}
@@ -107,9 +107,9 @@ int main()
// Draw active particles
for (int i = 0; i < MAX_PARTICLES; i++)
{
- if (mouseTail[i].active) DrawTexturePro(smoke, (Rectangle){ 0, 0, smoke.width, smoke.height },
+ if (mouseTail[i].active) DrawTexturePro(smoke, (Rectangle){ 0.0f, 0.0f, (float) smoke.width, (float) smoke.height },
(Rectangle){ mouseTail[i].position.x, mouseTail[i].position.y, smoke.width*mouseTail[i].size, smoke.height*mouseTail[i].size },
- (Vector2){ smoke.width*mouseTail[i].size/2, smoke.height*mouseTail[i].size/2 }, mouseTail[i].rotation,
+ (Vector2){ (float) (smoke.width*mouseTail[i].size/2.0f), (float)(smoke.height*mouseTail[i].size/2.0f) }, mouseTail[i].rotation,
Fade(mouseTail[i].color, mouseTail[i].alpha));
}
diff --git a/examples/textures/textures_srcrec_dstrec.c b/examples/textures/textures_srcrec_dstrec.c
index 53ffd1d0..fe948481 100644
--- a/examples/textures/textures_srcrec_dstrec.c
+++ b/examples/textures/textures_srcrec_dstrec.c
@@ -27,13 +27,13 @@ int main()
int frameHeight = scarfy.height;
// NOTE: Source rectangle (part of the texture to use for drawing)
- Rectangle sourceRec = { 0, 0, frameWidth, frameHeight };
+ Rectangle sourceRec = { 0.0f, 0.0f, (float)frameWidth, (float)frameHeight };
// NOTE: Destination rectangle (screen rectangle where drawing part of texture)
- Rectangle destRec = { screenWidth/2, screenHeight/2, frameWidth*2, frameHeight*2 };
+ Rectangle destRec = { (float) screenWidth/2, (float)screenHeight/2, (float)frameWidth*2, (float)frameHeight*2 };
// NOTE: Origin of the texture (rotation/scale point), it's relative to destination rectangle size
- Vector2 origin = { frameWidth, frameHeight };
+ Vector2 origin = { (float) frameWidth, (float) frameHeight };
int rotation = 0;
@@ -59,10 +59,10 @@ int main()
// destRec defines the rectangle where our texture part will fit (scaling it to fit)
// origin defines the point of the texture used as reference for rotation and scaling
// rotation defines the texture rotation (using origin as rotation point)
- DrawTexturePro(scarfy, sourceRec, destRec, origin, rotation, WHITE);
+ DrawTexturePro(scarfy, sourceRec, destRec, origin, (float)rotation, WHITE);
- DrawLine(destRec.x, 0, destRec.x, screenHeight, GRAY);
- DrawLine(0, destRec.y, screenWidth, destRec.y, GRAY);
+ DrawLine((int) destRec.x, 0, (int) destRec.x, screenHeight, GRAY);
+ DrawLine(0, (int)destRec.y, screenWidth, (int)destRec.y, GRAY);
DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, GRAY);