Review variables initialization

This commit is contained in:
Ray
2019-05-27 00:18:15 +02:00
parent 241c4c8d14
commit 87774a0a21
33 changed files with 52 additions and 56 deletions

View File

@ -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
//--------------------------------------------------------------------------------------

View File

@ -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);

View File

@ -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 };

View File

@ -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++)

View File

@ -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;

View File

@ -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;