mirror of
https://github.com/raysan5/raylib.git
synced 2025-11-21 09:36:21 +00:00
Added array bounds check to textures_bunnymark
This commit is contained in:
@@ -54,13 +54,16 @@ int main(void)
|
|||||||
// Create more bunnies
|
// Create more bunnies
|
||||||
for (int i = 0; i < 100; i++)
|
for (int i = 0; i < 100; i++)
|
||||||
{
|
{
|
||||||
bunnies[bunniesCount].position = GetMousePosition();
|
if (bunniesCount < MAX_BUNNIES)
|
||||||
bunnies[bunniesCount].speed.x = (float)GetRandomValue(-250, 250)/60.0f;
|
{
|
||||||
bunnies[bunniesCount].speed.y = (float)GetRandomValue(-250, 250)/60.0f;
|
bunnies[bunniesCount].position = GetMousePosition();
|
||||||
bunnies[bunniesCount].color = (Color){ GetRandomValue(50, 240),
|
bunnies[bunniesCount].speed.x = (float)GetRandomValue(-250, 250)/60.0f;
|
||||||
|
bunnies[bunniesCount].speed.y = (float)GetRandomValue(-250, 250)/60.0f;
|
||||||
|
bunnies[bunniesCount].color = (Color){ GetRandomValue(50, 240),
|
||||||
GetRandomValue(80, 240),
|
GetRandomValue(80, 240),
|
||||||
GetRandomValue(100, 240), 255 };
|
GetRandomValue(100, 240), 255 };
|
||||||
bunniesCount++;
|
bunniesCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user