summaryrefslogtreecommitdiffhomepage
path: root/examples/textures
diff options
context:
space:
mode:
authorRay <[email protected]>2019-05-27 00:18:15 +0200
committerRay <[email protected]>2019-05-27 00:18:15 +0200
commit87774a0a21f8d2998b4dc13e989005270476ae92 (patch)
tree4228376c752b1760be44cc8582725ecac522939b /examples/textures
parent241c4c8d14225bdf30c168802d4b16b59d5043e0 (diff)
downloadraylib-87774a0a21f8d2998b4dc13e989005270476ae92.tar.gz
raylib-87774a0a21f8d2998b4dc13e989005270476ae92.zip
Review variables initialization
Diffstat (limited to 'examples/textures')
-rw-r--r--examples/textures/textures_background_scrolling.c6
-rw-r--r--examples/textures/textures_image_generation.c3
-rw-r--r--examples/textures/textures_image_processing.c2
-rw-r--r--examples/textures/textures_particles_blending.c2
-rw-r--r--examples/textures/textures_raw_data.c2
-rw-r--r--examples/textures/textures_sprite_explosion.c2
6 files changed, 9 insertions, 8 deletions
diff --git a/examples/textures/textures_background_scrolling.c b/examples/textures/textures_background_scrolling.c
index d91b2585..c2e5ac80 100644
--- a/examples/textures/textures_background_scrolling.c
+++ b/examples/textures/textures_background_scrolling.c
@@ -26,9 +26,9 @@ int main(void)
Texture2D midground = LoadTexture("resources/cyberpunk_street_midground.png");
Texture2D foreground = LoadTexture("resources/cyberpunk_street_foreground.png");
- float scrollingBack = 0;
- float scrollingMid = 0;
- float scrollingFore = 0;
+ float scrollingBack = 0.0f;
+ float scrollingMid = 0.0f;
+ float scrollingFore = 0.0f;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
diff --git a/examples/textures/textures_image_generation.c b/examples/textures/textures_image_generation.c
index d9a39a25..0bb10583 100644
--- a/examples/textures/textures_image_generation.c
+++ b/examples/textures/textures_image_generation.c
@@ -30,7 +30,8 @@ int main(void)
Image perlinNoise = GenImagePerlinNoise(screenWidth, screenHeight, 50, 50, 4.0f);
Image cellular = GenImageCellular(screenWidth, screenHeight, 32);
- Texture2D textures[NUM_TEXTURES];
+ Texture2D textures[NUM_TEXTURES] = { 0 };
+
textures[0] = LoadTextureFromImage(verticalGradient);
textures[1] = LoadTextureFromImage(horizontalGradient);
textures[2] = LoadTextureFromImage(radialGradient);
diff --git a/examples/textures/textures_image_processing.c b/examples/textures/textures_image_processing.c
index b9ed51d7..14442290 100644
--- a/examples/textures/textures_image_processing.c
+++ b/examples/textures/textures_image_processing.c
@@ -57,7 +57,7 @@ int main(void)
int currentProcess = NONE;
bool textureReload = false;
- Rectangle selectRecs[NUM_PROCESSES];
+ Rectangle selectRecs[NUM_PROCESSES] = { 0 };
for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40.0f, (float)(50 + 32*i), 150.0f, 30.0f };
diff --git a/examples/textures/textures_particles_blending.c b/examples/textures/textures_particles_blending.c
index 75287ea7..d094c6c2 100644
--- a/examples/textures/textures_particles_blending.c
+++ b/examples/textures/textures_particles_blending.c
@@ -33,7 +33,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [textures] example - particles blending");
// Particles pool, reuse them!
- Particle mouseTail[MAX_PARTICLES];
+ Particle mouseTail[MAX_PARTICLES] = { 0 };
// Initialize particles
for (int i = 0; i < MAX_PARTICLES; i++)
diff --git a/examples/textures/textures_raw_data.c b/examples/textures/textures_raw_data.c
index 17604bde..08269bf7 100644
--- a/examples/textures/textures_raw_data.c
+++ b/examples/textures/textures_raw_data.c
@@ -31,7 +31,7 @@ int main(void)
Texture2D fudesumi = LoadTextureFromImage(fudesumiRaw); // Upload CPU (RAM) image to GPU (VRAM)
UnloadImage(fudesumiRaw); // Unload CPU (RAM) image data
- // Generate a checked texture by code (1024x1024 pixels)
+ // Generate a checked texture by code
int width = 960;
int height = 480;
diff --git a/examples/textures/textures_sprite_explosion.c b/examples/textures/textures_sprite_explosion.c
index 58a8f6fc..823c1b8a 100644
--- a/examples/textures/textures_sprite_explosion.c
+++ b/examples/textures/textures_sprite_explosion.c
@@ -38,7 +38,7 @@ int main(void)
int currentLine = 0;
Rectangle frameRec = { 0, 0, frameWidth, frameHeight };
- Vector2 position = { 0, 0 };
+ Vector2 position = { 0.0f, 0.0f };
bool active = false;
int framesCounter = 0;