소스 검색

Merge pull request #854 from ChrisDill/master

Added array bounds check to textures_bunnymark
pull/856/head
Ray 5 년 전
committed by GitHub
부모
커밋
20bdc3bc2a
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
  1. +8
    -5
      examples/textures/textures_bunnymark.c

+ 8
- 5
examples/textures/textures_bunnymark.c 파일 보기

@ -54,13 +54,16 @@ int main(void)
// Create more bunnies
for (int i = 0; i < 100; i++)
{
bunnies[bunniesCount].position = GetMousePosition();
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),
if (bunniesCount < MAX_BUNNIES)
{
bunnies[bunniesCount].position = GetMousePosition();
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(100, 240), 255 };
bunniesCount++;
bunniesCount++;
}
}
}

불러오는 중...
취소
저장