Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Axes! #6371

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/controlconfig/controlsconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ enum Joy_axis_index : short {
JOY_RX_AXIS,
JOY_RY_AXIS,
JOY_RZ_AXIS,
JOY_U_AXIS,
JOY_V_AXIS,

JOY_NUM_AXES // Number of axes a joystick may have. Must be last enum in Joy_axis_index.
JOY_NUM_AXES //!< Max number of joy axes that FSO can handle. Must be last enum in Joy_axis_index.
};

// Aliases for mouse axes. Really should unify this...
Expand Down
4 changes: 4 additions & 0 deletions code/controlconfig/controlsconfigcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,8 @@ void control_config_common_init()
Axis_text[3] = vm_strdup(XSTR("rX Axis", 1650)); // XSTR 1024 - "Joystick rX Axis"
Axis_text[4] = vm_strdup(XSTR("rY Axis", 1651)); // XSTR 1025 - "Joystick rY Axis"
Axis_text[5] = vm_strdup(XSTR("rZ Axis", 1652)); // XSTR 1026 - "Joystick rZ Axis"
Axis_text[6] = vm_strdup(XSTR("U Axis", 1857)); // XSTR 1026 - "Joystick rZ Axis"
Axis_text[7] = vm_strdup(XSTR("V Axis", 1858)); // XSTR 1026 - "Joystick rZ Axis"

Mouse_button_text[0] = vm_strdup(XSTR("Left Button", 1027));
Mouse_button_text[1] = vm_strdup(XSTR("Right Button", 1028));
Expand Down Expand Up @@ -1206,6 +1208,8 @@ void LoadEnumsIntoAxisMap() {
mAxisNameToVal["RX_AXIS"] = JOY_RX_AXIS;
mAxisNameToVal["RY_AXIS"] = JOY_RY_AXIS;
mAxisNameToVal["RZ_AXIS"] = JOY_RZ_AXIS;
mAxisNameToVal["U_AXIS"] = JOY_U_AXIS;
mAxisNameToVal["V_AXIS"] = JOY_V_AXIS;
}

void LoadEnumsIntoHatMap() {
Expand Down
2 changes: 1 addition & 1 deletion code/io/joy.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "SDL_joystick.h"

// z64: Moved up here for compatibility. Bye bye, organization!
const int JOY_NUM_BUTTONS = 32;
const int JOY_NUM_BUTTONS = 128; // Max number of buttons FSO can handle. OS max may differ.
z64555 marked this conversation as resolved.
Show resolved Hide resolved
const int JOY_NUM_HAT_POS = 4;
const int JOY_TOTAL_BUTTONS = (JOY_NUM_BUTTONS + JOY_NUM_HAT_POS);

Expand Down
2 changes: 1 addition & 1 deletion code/localization/localize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bool *Lcl_unexpected_tstring_check = nullptr;
// NOTE: with map storage of XSTR strings, the indexes no longer need to be contiguous,
// but internal strings should still increment XSTR_SIZE to avoid collisions.
// retail XSTR_SIZE = 1570
// #define XSTR_SIZE 1857 // This is the next available ID
// #define XSTR_SIZE 1859 // This is the next available ID


// struct to allow for strings.tbl-determined x offset
Expand Down
Loading