mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
examples/demo/02-woodeneye-008: Minor coding style tweaks.
This commit is contained in:
parent
32563c2048
commit
3e2ff3f105
1 changed files with 11 additions and 4 deletions
|
|
@ -47,7 +47,9 @@ static int whoseMouse(SDL_MouseID mouse, const Player players[], int players_len
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < players_len; i++) {
|
for (i = 0; i < players_len; i++) {
|
||||||
if (players[i].mouse == mouse) return i;
|
if (players[i].mouse == mouse) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -56,7 +58,9 @@ static int whoseKeyboard(SDL_KeyboardID keyboard, const Player players[], int pl
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < players_len; i++) {
|
for (i = 0; i < players_len; i++) {
|
||||||
if (players[i].keyboard == keyboard) return i;
|
if (players[i].keyboard == keyboard) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +69,9 @@ static int whoseGamepad(SDL_JoystickID gamepad, const Player players[], int play
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < players_len; i++) {
|
for (i = 0; i < players_len; i++) {
|
||||||
if (SDL_GetGamepadID(players[i].gamepad) == gamepad) return i;
|
if (SDL_GetGamepadID(players[i].gamepad) == gamepad) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -561,8 +567,9 @@ void SDL_AppQuit(void *appstate, SDL_AppResult result)
|
||||||
int player_count = as->player_count;
|
int player_count = as->player_count;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < player_count; i++) {
|
for (i = 0; i < player_count; i++) {
|
||||||
if (players[i].gamepad)
|
if (players[i].gamepad) {
|
||||||
SDL_CloseGamepad(players[i].gamepad);
|
SDL_CloseGamepad(players[i].gamepad);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SDL_free(appstate); // just free the memory, SDL will clean up the window/renderer for us.
|
SDL_free(appstate); // just free the memory, SDL will clean up the window/renderer for us.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue