mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
examples/demo/02-woodeneye-008: use right stick for camera, not left.
This matches the standard for console FPS titles.
This commit is contained in:
parent
39c5dce189
commit
32563c2048
1 changed files with 4 additions and 4 deletions
|
|
@ -114,10 +114,10 @@ static void shoot(int shooter, Player players[], int players_len)
|
|||
static void updatePlayerGamepad(Player *player)
|
||||
{
|
||||
if (player->gamepad) {
|
||||
const int leftx = (int)SDL_GetGamepadAxis(player->gamepad, SDL_GAMEPAD_AXIS_LEFTX);
|
||||
const int lefty = (int)SDL_GetGamepadAxis(player->gamepad, SDL_GAMEPAD_AXIS_LEFTY);
|
||||
player->yaw -= leftx * 0x00000800;
|
||||
player->pitch = SDL_max(-0x40000000, SDL_min(0x40000000, player->pitch - lefty * 0x00000800));
|
||||
const int rightx = (int)SDL_GetGamepadAxis(player->gamepad, SDL_GAMEPAD_AXIS_RIGHTX);
|
||||
const int righty = (int)SDL_GetGamepadAxis(player->gamepad, SDL_GAMEPAD_AXIS_RIGHTY);
|
||||
player->yaw -= rightx * 0x00000800;
|
||||
player->pitch = SDL_max(-0x40000000, SDL_min(0x40000000, player->pitch - righty * 0x00000800));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue