MCPcopy Create free account
hub / github.com/RevoSucks/BM64Recomp / controller_axis_to_string

Function controller_axis_to_string

src/game/input.cpp:872–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872std::string controller_axis_to_string(int axis) {
873 bool positive = axis > 0;
874 SDL_GameControllerAxis actual_axis = SDL_GameControllerAxis(abs(axis) - 1);
875 switch (actual_axis) {
876 case SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTX:
877 return positive ? "\u21C0" : "\u21BC";
878 case SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_LEFTY:
879 return positive ? "\u21C2" : "\u21BE";
880 case SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_RIGHTX:
881 return positive ? "\u21C1" : "\u21BD";
882 case SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_RIGHTY:
883 return positive ? "\u21C3" : "\u21BF";
884 case SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_TRIGGERLEFT:
885 return positive ? "\u2196" : "\u21DC";
886 case SDL_GameControllerAxis::SDL_CONTROLLER_AXIS_TRIGGERRIGHT:
887 return positive ? "\u2197" : "\u21DD";
888 default:
889 return "Axis " + std::to_string(actual_axis) + (positive ? '+' : '-');
890 }
891}
892
893std::string recomp::InputField::to_string() const {
894 switch ((InputType)input_type) {

Callers 1

to_stringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected