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:
Ryan C. Gordon 2025-11-08 13:57:52 -05:00
parent 39c5dce189
commit 32563c2048
No known key found for this signature in database
GPG key ID: FA148B892AB48044

View file

@ -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));
}
}