💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.3 KiB

  1. /*
  2. * Copyright (C) 2021 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include "sdl-game-controller-tables.hpp"
  20. #include "game-controller.hpp"
  21. const game_controller_button sdl_button_table[15] =
  22. {
  23. game_controller_button::a, // SDL_CONTROLLER_BUTTON_A,
  24. game_controller_button::b, // SDL_CONTROLLER_BUTTON_B,
  25. game_controller_button::x, // SDL_CONTROLLER_BUTTON_X,
  26. game_controller_button::y, // SDL_CONTROLLER_BUTTON_Y,
  27. game_controller_button::back, // SDL_CONTROLLER_BUTTON_BACK,
  28. game_controller_button::guide, // SDL_CONTROLLER_BUTTON_GUIDE,
  29. game_controller_button::start, // SDL_CONTROLLER_BUTTON_START,
  30. game_controller_button::left_stick, // SDL_CONTROLLER_BUTTON_LEFTSTICK,
  31. game_controller_button::right_stick, // SDL_CONTROLLER_BUTTON_RIGHTSTICK,
  32. game_controller_button::left_shoulder, // SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
  33. game_controller_button::right_shoulder, // SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
  34. game_controller_button::dpad_up, // SDL_CONTROLLER_BUTTON_DPAD_UP,
  35. game_controller_button::dpad_down, // SDL_CONTROLLER_BUTTON_DPAD_DOWN,
  36. game_controller_button::dpad_left, // SDL_CONTROLLER_BUTTON_DPAD_LEFT,
  37. game_controller_button::dpad_right, // SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
  38. };
  39. const game_controller_axis sdl_axis_table[6] =
  40. {
  41. game_controller_axis::left_x, // SDL_CONTROLLER_AXIS_LEFTX,
  42. game_controller_axis::left_y, // SDL_CONTROLLER_AXIS_LEFTY,
  43. game_controller_axis::right_x, // SDL_CONTROLLER_AXIS_RIGHTX,
  44. game_controller_axis::right_y, // SDL_CONTROLLER_AXIS_RIGHTY,
  45. game_controller_axis::trigger_left, // SDL_CONTROLLER_AXIS_TRIGGERLEFT,
  46. game_controller_axis::trigger_right, // SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
  47. };