Fixed warning C4244: '=': conversion from 'float' to 'int', possible loss of data

This commit is contained in:
Sam Lantinga 2024-07-16 21:14:39 -07:00
parent 98bea25363
commit 1e828eec57
1 changed files with 2 additions and 2 deletions

View File

@ -140,8 +140,8 @@ int main(int argc, char *argv[])
positions[i].y = SDL_rand(WINDOW_HEIGHT - sprite_h);
positions[i].w = sprite_w;
positions[i].h = sprite_h;
velocities[i].x = 0.0f;
velocities[i].y = 0.0f;
velocities[i].x = 0;
velocities[i].y = 0;
while (velocities[i].x == 0.f && velocities[i].y == 0.f) {
velocities[i].x = (SDL_rand(MAX_SPEED * 2 + 1)) - MAX_SPEED;
velocities[i].y = (SDL_rand(MAX_SPEED * 2 + 1)) - MAX_SPEED;