input: add menu specific controls (#824)

Resolves #814.
This commit is contained in:
walkawayy 2023-05-14 19:18:10 -04:00 committed by GitHub
parent 99178701b5
commit 43ae1920c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 84 additions and 72 deletions

View file

@ -5,6 +5,7 @@
- added an inverted look camera option (#700)
- added a camera speed option for the manual camera (#815)
- added an option to fix original texture issues (#826)
- added menu specific controls meaning arrow keys, return, and escape now always function in menus (#814, regression from 2.12)
- fixed sounds stopping instead of pausing if game sounds in inventory are disabled (#717)
- fixed ceiling heights at times being miscalculated, resulting in camera issues and Lara being able to jump into the ceiling (#323)
- fixed Lara not being able to jump off trapdoors or crumbling floors if the sidestep descent fix is enabled (#830)

View file

@ -33,7 +33,7 @@ bool Game_Cutscene_Control(int32_t nframes)
}
Input_Update();
if (g_InputDB.deselect || g_InputDB.select) {
if (g_InputDB.menu_confirm || g_InputDB.menu_back) {
return true;
}

View file

@ -64,8 +64,8 @@ bool Game_Demo_ProcessInput(void)
.step_left = (bool)(*m_DemoPtr & (1 << 10)),
.step_right = (bool)(*m_DemoPtr & (1 << 11)),
.roll = (bool)(*m_DemoPtr & (1 << 12)),
.select = (bool)(*m_DemoPtr & (1 << 20)),
.deselect = (bool)(*m_DemoPtr & (1 << 21)),
.menu_confirm = (bool)(*m_DemoPtr & (1 << 20)),
.menu_back = (bool)(*m_DemoPtr & (1 << 21)),
.save = (bool)(*m_DemoPtr & (1 << 22)),
.load = (bool)(*m_DemoPtr & (1 << 23)),
};

View file

@ -100,7 +100,12 @@ void Input_Update(void)
g_Input = S_Input_GetCurrentState(
g_Config.input.layout, g_Config.input.cntlr_layout);
g_Input.select |= g_Input.action;
g_Input.menu_up |= g_Input.forward;
g_Input.menu_down |= g_Input.back;
g_Input.menu_left |= g_Input.left;
g_Input.menu_right |= g_Input.right;
g_Input.menu_confirm |= g_Input.action;
g_Input.menu_back |= g_Input.option;
g_Input.option &= g_Camera.type != CAM_CINEMATIC;
g_Input.roll |= g_Input.forward && g_Input.back;
if (g_Input.left && g_Input.right) {

View file

@ -8,7 +8,6 @@
extern INPUT_STATE g_Input;
extern INPUT_STATE g_InputDB;
extern INPUT_STATE g_OldInputDB;
extern bool g_ConflictLayout[INPUT_ROLE_NUMBER_OF];
void Input_Init(void);
void Input_Shutdown(void);

View file

@ -112,7 +112,8 @@ static void Inv_Draw(RING_INFO *ring, IMOTION_INFO *imo)
}
} else if (
ring->number_of_objects == 1
|| (!g_Input.left && !g_Input.right) || !g_Input.left) {
|| (!g_Input.menu_left && !g_Input.menu_right)
|| !g_Input.menu_left) {
g_LsAdder = HIGH_LIGHT;
inv_item->y_rot += 256;
}
@ -459,7 +460,7 @@ static int32_t Inv_ConstructAndDisplay(int inv_mode)
if (imo.status == RNG_OPEN || imo.status == RNG_SELECTING
|| imo.status == RNG_SELECTED || imo.status == RNG_DESELECTING
|| imo.status == RNG_DESELECT || imo.status == RNG_CLOSING_ITEM) {
if (!ring.rotating && !g_Input.left && !g_Input.right) {
if (!ring.rotating && !g_Input.menu_left && !g_Input.menu_right) {
INVENTORY_ITEM *inv_item = ring.list[ring.current_object];
Inv_Ring_Active(inv_item);
}
@ -495,18 +496,18 @@ static int32_t Inv_ConstructAndDisplay(int inv_mode)
if ((g_InvMode == INV_SAVE_MODE || g_InvMode == INV_SAVE_CRYSTAL_MODE
|| g_InvMode == INV_LOAD_MODE || g_InvMode == INV_DEATH_MODE)
&& !pass_mode_open) {
g_InputDB = (INPUT_STATE) { 0, .select = 1 };
g_InputDB = (INPUT_STATE) { 0, .menu_confirm = 1 };
}
switch (imo.status) {
case RNG_OPEN:
if (g_Input.right && ring.number_of_objects > 1) {
if (g_Input.menu_right && ring.number_of_objects > 1) {
Inv_Ring_RotateLeft(&ring);
Sound_Effect(SFX_MENU_ROTATE, NULL, SPM_ALWAYS);
break;
}
if (g_Input.left && ring.number_of_objects > 1) {
if (g_Input.menu_left && ring.number_of_objects > 1) {
Inv_Ring_RotateRight(&ring);
Sound_Effect(SFX_MENU_ROTATE, NULL, SPM_ALWAYS);
break;
@ -537,7 +538,7 @@ static int32_t Inv_ConstructAndDisplay(int inv_mode)
g_InputDB = (INPUT_STATE) { 0 };
}
if (g_InputDB.select) {
if (g_InputDB.menu_confirm) {
if ((g_InvMode == INV_SAVE_MODE
|| g_InvMode == INV_SAVE_CRYSTAL_MODE
|| g_InvMode == INV_LOAD_MODE
@ -597,7 +598,7 @@ static int32_t Inv_ConstructAndDisplay(int inv_mode)
}
}
if (g_InputDB.forward && g_InvMode != INV_TITLE_MODE
if (g_InputDB.menu_up && g_InvMode != INV_TITLE_MODE
&& g_InvMode != INV_KEYS_MODE) {
if (ring.type == RT_MAIN) {
if (g_InvKeysObjects) {
@ -628,7 +629,7 @@ static int32_t Inv_ConstructAndDisplay(int inv_mode)
g_InputDB = (INPUT_STATE) { 0 };
}
} else if (
g_InputDB.back && g_InvMode != INV_TITLE_MODE
g_InputDB.menu_down && g_InvMode != INV_TITLE_MODE
&& g_InvMode != INV_KEYS_MODE) {
if (ring.type == RT_KEYS) {
if (g_InvMainObjects) {
@ -756,7 +757,7 @@ static int32_t Inv_ConstructAndDisplay(int inv_mode)
if (!busy && !g_IDelay) {
Option_DoInventory(inv_item);
if (g_InputDB.deselect) {
if (g_InputDB.menu_back) {
inv_item->sprlist = NULL;
Inv_Ring_MotionSetup(
&ring, RNG_CLOSING_ITEM, RNG_DESELECT, 0);
@ -772,7 +773,7 @@ static int32_t Inv_ConstructAndDisplay(int inv_mode)
}
}
if (g_InputDB.select) {
if (g_InputDB.menu_confirm) {
inv_item->sprlist = NULL;
g_InvChosen = inv_item->object_number;
if (ring.type == RT_MAIN) {

View file

@ -70,7 +70,7 @@ void Option_DoInventory(INVENTORY_ITEM *inv_item)
case O_PICKUP_OPTION1:
case O_PICKUP_OPTION2:
case O_SCION_OPTION:
g_InputDB.select = 1;
g_InputDB.menu_confirm = 1;
break;
case O_GUN_AMMO_OPTION:
@ -80,7 +80,7 @@ void Option_DoInventory(INVENTORY_ITEM *inv_item)
break;
default:
if (g_InputDB.deselect || g_InputDB.select) {
if (g_InputDB.menu_confirm || g_InputDB.menu_back) {
inv_item->goal_frame = 0;
inv_item->anim_direction = -1;
}

View file

@ -131,7 +131,7 @@ void Option_Compass(INVENTORY_ITEM *inv_item)
Text_ChangeText(m_Text[TEXT_TIME], buf);
}
if (g_InputDB.deselect || g_InputDB.select) {
if (g_InputDB.menu_confirm || g_InputDB.menu_back) {
for (int i = 0; i < TEXT_NUMBER_OF; i++) {
Text_Remove(m_Text[i]);
m_Text[i] = NULL;

View file

@ -517,16 +517,16 @@ static INPUT_LAYOUT Option_ControlChangeLayout(CONTROL_MODE mode)
{
INPUT_LAYOUT layout_num = INPUT_LAYOUT_DEFAULT;
if (mode == CM_KEYBOARD) {
g_Config.input.layout += g_InputDB.left ? -1 : 0;
g_Config.input.layout += g_InputDB.right ? 1 : 0;
g_Config.input.layout += g_InputDB.menu_left ? -1 : 0;
g_Config.input.layout += g_InputDB.menu_right ? 1 : 0;
g_Config.input.layout += INPUT_LAYOUT_NUMBER_OF;
g_Config.input.layout %= INPUT_LAYOUT_NUMBER_OF;
layout_num = g_Config.input.layout;
}
if (mode == CM_CONTROLLER) {
g_Config.input.cntlr_layout += g_InputDB.left ? -1 : 0;
g_Config.input.cntlr_layout += g_InputDB.right ? 1 : 0;
g_Config.input.cntlr_layout += g_InputDB.menu_left ? -1 : 0;
g_Config.input.cntlr_layout += g_InputDB.menu_right ? 1 : 0;
g_Config.input.cntlr_layout += INPUT_LAYOUT_NUMBER_OF;
g_Config.input.cntlr_layout %= INPUT_LAYOUT_NUMBER_OF;
layout_num = g_Config.input.cntlr_layout;
@ -680,8 +680,8 @@ CONTROL_MODE Option_Control(INVENTORY_ITEM *inv_item, CONTROL_MODE mode)
break;
}
if (g_InputDB.deselect
|| (g_InputDB.select && m_ControlMenu.cur_role == KC_TITLE)) {
if (g_InputDB.menu_back
|| (g_InputDB.menu_confirm && m_ControlMenu.cur_role == KC_TITLE)) {
Option_ControlShutdownText();
m_KeyMode = KM_INACTIVE;
g_Input = (INPUT_STATE) { 0 };
@ -689,16 +689,16 @@ CONTROL_MODE Option_Control(INVENTORY_ITEM *inv_item, CONTROL_MODE mode)
return CM_PICK;
}
if ((g_InputDB.left || g_InputDB.right)
if ((g_InputDB.menu_left || g_InputDB.menu_right)
&& m_ControlMenu.cur_role == KC_TITLE) {
layout_num = Option_ControlChangeLayout(mode);
}
if (g_InputDB.select) {
if (g_InputDB.menu_confirm) {
if (layout_num > INPUT_LAYOUT_DEFAULT) {
m_KeyMode = KM_BROWSEKEYUP;
}
} else if (g_InputDB.forward) {
} else if (g_InputDB.menu_up) {
if (m_ControlMenu.cur_role == KC_TITLE) {
m_ControlMenu.row_num = m_ControlMenu.vis_options - 1;
m_ControlMenu.cur_role = m_ControlMenu.last_role;
@ -727,7 +727,7 @@ CONTROL_MODE Option_Control(INVENTORY_ITEM *inv_item, CONTROL_MODE mode)
}
Option_ControlUpdateText(mode, layout_num);
Option_ControlFlashConflicts(mode, layout_num);
} else if (g_InputDB.back) {
} else if (g_InputDB.menu_down) {
if (m_ControlMenu.cur_role == KC_TITLE) {
m_ControlMenu.row_num++;
m_ControlMenu.cur_role = m_ControlMenu.first_role;

View file

@ -61,7 +61,7 @@ CONTROL_MODE Option_ControlPick(void)
Option_ControlPickInitText();
}
if (g_InputDB.forward && g_OptionSelected > TEXT_OPTION_MIN) {
if (g_InputDB.menu_up && g_OptionSelected > TEXT_OPTION_MIN) {
Text_RemoveOutline(m_Text[g_OptionSelected]);
Text_RemoveBackground(m_Text[g_OptionSelected]);
--g_OptionSelected;
@ -70,7 +70,7 @@ CONTROL_MODE Option_ControlPick(void)
Text_AddOutline(m_Text[g_OptionSelected], true, TS_REQUESTED);
}
if (g_InputDB.back && g_OptionSelected < TEXT_OPTION_MAX) {
if (g_InputDB.menu_down && g_OptionSelected < TEXT_OPTION_MAX) {
Text_RemoveOutline(m_Text[g_OptionSelected]);
Text_RemoveBackground(m_Text[g_OptionSelected]);
++g_OptionSelected;
@ -81,7 +81,7 @@ CONTROL_MODE Option_ControlPick(void)
switch (g_OptionSelected) {
case TEXT_KEYBOARD:
if (g_InputDB.select) {
if (g_InputDB.menu_confirm) {
Option_ControlPickShutdownText();
g_Input = (INPUT_STATE) { 0 };
g_InputDB = (INPUT_STATE) { 0 };
@ -90,7 +90,7 @@ CONTROL_MODE Option_ControlPick(void)
break;
case TEXT_CONTROLLER:
if (g_InputDB.select) {
if (g_InputDB.menu_confirm) {
Option_ControlPickShutdownText();
g_Input = (INPUT_STATE) { 0 };
g_InputDB = (INPUT_STATE) { 0 };
@ -99,7 +99,7 @@ CONTROL_MODE Option_ControlPick(void)
break;
}
if (g_InputDB.deselect) {
if (g_InputDB.menu_back) {
Option_ControlPickShutdownText();
}

View file

@ -304,7 +304,7 @@ void Option_Graphics(INVENTORY_ITEM *inv_item)
m_IsTextInit = true;
}
if (g_InputDB.forward && g_OptionSelected > TEXT_OPTION_MIN) {
if (g_InputDB.menu_up && g_OptionSelected > TEXT_OPTION_MIN) {
g_OptionSelected--;
Text_AddBackground(
m_Text[TEXT_ROW_SELECT], ROW_WIDTH - 7, 0, 0,
@ -312,7 +312,7 @@ void Option_Graphics(INVENTORY_ITEM *inv_item)
Text_AddOutline(m_Text[TEXT_ROW_SELECT], true, TS_REQUESTED);
}
if (g_InputDB.back && g_OptionSelected < TEXT_OPTION_MAX) {
if (g_InputDB.menu_down && g_OptionSelected < TEXT_OPTION_MAX) {
g_OptionSelected++;
Text_AddBackground(
m_Text[TEXT_ROW_SELECT], ROW_WIDTH - 7, 0, 0,
@ -322,7 +322,7 @@ void Option_Graphics(INVENTORY_ITEM *inv_item)
int32_t reset = -1;
if (g_InputDB.right) {
if (g_InputDB.menu_right) {
switch (g_OptionSelected) {
case TEXT_PERSPECTIVE:
if (!g_Config.rendering.enable_perspective_filter) {
@ -372,7 +372,7 @@ void Option_Graphics(INVENTORY_ITEM *inv_item)
}
}
if (g_InputDB.left) {
if (g_InputDB.menu_left) {
switch (g_OptionSelected) {
case TEXT_PERSPECTIVE:
if (g_Config.rendering.enable_perspective_filter) {
@ -422,7 +422,7 @@ void Option_Graphics(INVENTORY_ITEM *inv_item)
}
}
if (g_InputDB.deselect || g_InputDB.select) {
if (g_InputDB.menu_confirm || g_InputDB.menu_back) {
reset = TEXT_NUMBER_OF;
}

View file

@ -317,7 +317,7 @@ static void Option_PassportLoadGame(void)
if (!(g_SavegameRequester.item_flags[g_SavegameRequester.requested]
& RIF_BLOCKED)
|| !(g_SavegameRequester.flags & RIF_BLOCKABLE)) {
if (g_InputDB.right) {
if (g_InputDB.menu_right) {
g_GameInfo.current_save_slot = g_SavegameRequester.requested;
Text_Hide(m_Text[TEXT_LEVEL_ARROW_RIGHT], true);
Requester_Remove(&g_SavegameRequester);
@ -355,7 +355,7 @@ static void Option_PassportLoadGame(void)
static void Option_PassportSelectLevel(void)
{
if (g_InputDB.left) {
if (g_InputDB.menu_left) {
Text_Hide(m_Text[TEXT_LEVEL_ARROW_LEFT], true);
Requester_Remove(&m_SelectLevelRequester);
Option_PassportInitSaveRequester(PASSPORT_PAGE_1);
@ -397,8 +397,8 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
}
if (g_InvMode == INV_SAVE_MODE || g_InvMode == INV_SAVE_CRYSTAL_MODE) {
g_InputDB.left = 0;
g_InputDB.right = 0;
g_InputDB.menu_left = 0;
g_InputDB.menu_right = 0;
}
switch (page) {
@ -416,7 +416,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
Text_ChangeText(
m_Text[TEXT_PAGE_NAME],
g_GameFlow.strings[GS_PASSPORT_LOAD_GAME]);
if (g_InputDB.select || g_InvMode == INV_LOAD_MODE) {
if (g_InputDB.menu_confirm || g_InvMode == INV_LOAD_MODE) {
g_SavegameRequester.flags |= RIF_BLOCKABLE;
Option_PassportInitSaveRequester(page);
m_PassportMode = PASSPORT_MODE_SHOW_SAVES;
@ -439,7 +439,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
Text_Hide(m_Text[TEXT_LEFT_ARROW], false);
Text_Hide(m_Text[TEXT_RIGHT_ARROW], false);
if (g_SavedGamesCount == 0) {
g_InputDB.left = 0;
g_InputDB.menu_left = 0;
Text_Hide(m_Text[TEXT_LEFT_ARROW], true);
}
@ -464,7 +464,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
g_GameFlow.strings[GS_PASSPORT_SAVE_GAME]);
}
if (g_InputDB.select || g_InvMode == INV_SAVE_MODE
if (g_InputDB.menu_confirm || g_InvMode == INV_SAVE_MODE
|| g_InvMode == INV_SAVE_CRYSTAL_MODE) {
Text_Hide(m_Text[TEXT_LEFT_ARROW], true);
Text_Hide(m_Text[TEXT_RIGHT_ARROW], true);
@ -516,7 +516,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
true,
};
if (g_InputDB.left && (g_SavedGamesCount || page > PASSPORT_PAGE_1)) {
if (g_InputDB.menu_left && (g_SavedGamesCount || page > PASSPORT_PAGE_1)) {
while (--page >= PASSPORT_PAGE_1) {
if (pages_available[page]) {
break;
@ -533,7 +533,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
g_InputDB = (INPUT_STATE) { 0 };
}
if (g_InputDB.right) {
if (g_InputDB.menu_right) {
g_Input = (INPUT_STATE) { 0 };
g_InputDB = (INPUT_STATE) { 0 };
@ -550,7 +550,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
}
}
if (g_InputDB.deselect) {
if (g_InputDB.menu_back) {
if (g_InvMode == INV_DEATH_MODE) {
g_Input = (INPUT_STATE) { 0 };
g_InputDB = (INPUT_STATE) { 0 };
@ -566,7 +566,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
}
}
if (g_InputDB.select) {
if (g_InputDB.menu_confirm) {
g_GameInfo.passport_page = page;
if (page == PASSPORT_PAGE_3) {
inv_item->anim_direction = 1;

View file

@ -74,7 +74,7 @@ void Option_Sound(INVENTORY_ITEM *inv_item)
Option_SoundInitText();
}
if (g_InputDB.forward && g_OptionSelected > TEXT_OPTION_MIN) {
if (g_InputDB.menu_up && g_OptionSelected > TEXT_OPTION_MIN) {
Text_RemoveOutline(m_Text[g_OptionSelected]);
Text_RemoveBackground(m_Text[g_OptionSelected]);
--g_OptionSelected;
@ -85,7 +85,7 @@ void Option_Sound(INVENTORY_ITEM *inv_item)
Text_SetPos(m_Text[TEXT_RIGHT_ARROW], 40, 0);
}
if (g_InputDB.back && g_OptionSelected < TEXT_OPTION_MAX) {
if (g_InputDB.menu_down && g_OptionSelected < TEXT_OPTION_MAX) {
Text_RemoveOutline(m_Text[g_OptionSelected]);
Text_RemoveBackground(m_Text[g_OptionSelected]);
++g_OptionSelected;
@ -98,7 +98,7 @@ void Option_Sound(INVENTORY_ITEM *inv_item)
switch (g_OptionSelected) {
case TEXT_MUSIC_VOLUME:
if (g_Input.left && g_Config.music_volume > MIN_VOLUME) {
if (g_Input.menu_left && g_Config.music_volume > MIN_VOLUME) {
g_Config.music_volume--;
g_IDelay = true;
g_IDCount = 10;
@ -107,7 +107,7 @@ void Option_Sound(INVENTORY_ITEM *inv_item)
sprintf(buf, "| %2d", g_Config.music_volume);
Text_ChangeText(m_Text[TEXT_MUSIC_VOLUME], buf);
Config_Write();
} else if (g_Input.right && g_Config.music_volume < MAX_VOLUME) {
} else if (g_Input.menu_right && g_Config.music_volume < MAX_VOLUME) {
g_Config.music_volume++;
g_IDelay = true;
g_IDCount = 10;
@ -130,7 +130,7 @@ void Option_Sound(INVENTORY_ITEM *inv_item)
break;
case TEXT_SOUND_VOLUME:
if (g_Input.left && g_Config.sound_volume > MIN_VOLUME) {
if (g_Input.menu_left && g_Config.sound_volume > MIN_VOLUME) {
g_Config.sound_volume--;
g_IDelay = true;
g_IDCount = 10;
@ -139,7 +139,7 @@ void Option_Sound(INVENTORY_ITEM *inv_item)
sprintf(buf, "} %2d", g_Config.sound_volume);
Text_ChangeText(m_Text[TEXT_SOUND_VOLUME], buf);
Config_Write();
} else if (g_Input.right && g_Config.sound_volume < MAX_VOLUME) {
} else if (g_Input.menu_right && g_Config.sound_volume < MAX_VOLUME) {
g_Config.sound_volume++;
g_IDelay = true;
g_IDCount = 10;
@ -162,7 +162,7 @@ void Option_Sound(INVENTORY_ITEM *inv_item)
break;
}
if (g_InputDB.deselect || g_InputDB.select) {
if (g_InputDB.menu_confirm || g_InputDB.menu_back) {
for (int i = 0; i < TEXT_NUMBER_OF; i++) {
Text_Remove(m_Text[i]);
m_Text[i] = NULL;

View file

@ -132,7 +132,7 @@ int32_t Requester_Display(REQUEST_INFO *req)
}
}
if (g_InputDB.back) {
if (g_InputDB.menu_down) {
if (req->requested < req->items - 1) {
req->requested++;
}
@ -144,7 +144,7 @@ int32_t Requester_Display(REQUEST_INFO *req)
return 0;
}
if (g_InputDB.forward) {
if (g_InputDB.menu_up) {
if (req->requested) {
req->requested--;
}
@ -156,7 +156,7 @@ int32_t Requester_Display(REQUEST_INFO *req)
return 0;
}
if (g_InputDB.select) {
if (g_InputDB.menu_confirm) {
if ((req->item_flags[req->requested] & RIF_BLOCKED)
&& (req->flags & RIF_BLOCKABLE)) {
g_Input = (INPUT_STATE) { 0 };
@ -165,7 +165,7 @@ int32_t Requester_Display(REQUEST_INFO *req)
Requester_Remove(req);
return req->requested + 1;
}
} else if (g_InputDB.deselect) {
} else if (g_InputDB.menu_back) {
Requester_Remove(req);
return -1;
}

View file

@ -369,7 +369,7 @@ void Stats_Show(int32_t level_num)
Input_Update();
Text_Draw();
Output_DumpScreen();
} while (!g_InputDB.select && !g_InputDB.deselect);
} while (!g_InputDB.menu_confirm && !g_InputDB.menu_back);
Output_FadeToBlack(false);
Text_RemoveAll();
@ -529,7 +529,7 @@ void Stats_ShowTotal(const char *filename)
Input_Update();
Text_Draw();
Output_DumpScreen();
} while (!g_InputDB.select && !g_InputDB.deselect);
} while (!g_InputDB.menu_confirm && !g_InputDB.menu_back);
// fade out
Output_FadeToBlack(true);

View file

@ -2006,8 +2006,6 @@ typedef union INPUT_STATE {
uint64_t step_right : 1;
uint64_t roll : 1;
uint64_t pause : 1;
uint64_t select : 1;
uint64_t deselect : 1;
uint64_t save : 1;
uint64_t load : 1;
uint64_t fly_cheat : 1;
@ -2029,6 +2027,12 @@ typedef union INPUT_STATE {
uint64_t toggle_bilinear_filter : 1;
uint64_t toggle_perspective_filter : 1;
uint64_t toggle_fps_counter : 1;
uint64_t menu_up : 1;
uint64_t menu_down : 1;
uint64_t menu_left : 1;
uint64_t menu_right : 1;
uint64_t menu_confirm : 1;
uint64_t menu_back : 1;
};
} INPUT_STATE;

View file

@ -2185,7 +2185,7 @@ static void S_FMV_RefreshLoopWaitEvent(VideoState *is, SDL_Event *event)
event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {
Input_Update();
if (g_InputDB.deselect || g_InputDB.select) {
if (g_InputDB.menu_confirm || g_InputDB.menu_back) {
is->abort_request = true;
}

View file

@ -608,7 +608,7 @@ static const char *S_Input_GetButtonName(SDL_GameControllerButton button)
case SDL_CONTROLLER_BUTTON_DPAD_DOWN: return "\202 ";
case SDL_CONTROLLER_BUTTON_DPAD_LEFT: return "\200 ";
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: return "\201 ";
case SDL_CONTROLLER_BUTTON_MISC1: return "MIC"; /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
case SDL_CONTROLLER_BUTTON_MISC1: return "MIC"; /* PS5 microphone button */
case SDL_CONTROLLER_BUTTON_PADDLE1: return "PADDLE 1"; /* Xbox Elite paddle P1 (upper left, facing the back) */
case SDL_CONTROLLER_BUTTON_PADDLE2: return "PADDLE 2"; /* Xbox Elite paddle P3 (upper right, facing the back) */
case SDL_CONTROLLER_BUTTON_PADDLE3: return "PADDLE 3"; /* Xbox Elite paddle P2 (lower left, facing the back) */
@ -637,7 +637,7 @@ static const char *S_Input_GetButtonName(SDL_GameControllerButton button)
case SDL_CONTROLLER_BUTTON_DPAD_DOWN: return "\202 ";
case SDL_CONTROLLER_BUTTON_DPAD_LEFT: return "\200 ";
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: return "\201 ";
case SDL_CONTROLLER_BUTTON_MISC1: return "CAPTURE"; /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
case SDL_CONTROLLER_BUTTON_MISC1: return "CAPTURE"; /* Nintendo Switch capture button */
case SDL_CONTROLLER_BUTTON_PADDLE1: return "PADDLE 1"; /* Xbox Elite paddle P1 (upper left, facing the back) */
case SDL_CONTROLLER_BUTTON_PADDLE2: return "PADDLE 2"; /* Xbox Elite paddle P3 (upper right, facing the back) */
case SDL_CONTROLLER_BUTTON_PADDLE3: return "PADDLE 3"; /* Xbox Elite paddle P2 (lower left, facing the back) */
@ -666,7 +666,7 @@ static const char *S_Input_GetButtonName(SDL_GameControllerButton button)
case SDL_CONTROLLER_BUTTON_DPAD_DOWN: return "\202 ";
case SDL_CONTROLLER_BUTTON_DPAD_LEFT: return "\200 ";
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: return "\201 ";
case SDL_CONTROLLER_BUTTON_MISC1: return "SHARE"; /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
case SDL_CONTROLLER_BUTTON_MISC1: return "SHARE"; /* Xbox Series X share button */
case SDL_CONTROLLER_BUTTON_PADDLE1: return "PADDLE 1"; /* Xbox Elite paddle P1 (upper left, facing the back) */
case SDL_CONTROLLER_BUTTON_PADDLE2: return "PADDLE 2"; /* Xbox Elite paddle P3 (upper right, facing the back) */
case SDL_CONTROLLER_BUTTON_PADDLE3: return "PADDLE 3"; /* Xbox Elite paddle P2 (lower left, facing the back) */
@ -832,12 +832,10 @@ static INPUT_STATE S_Input_GetControllerState(
state.slow |= S_Input_GetBindState(INPUT_ROLE_SLOW, cntlr_layout_num);
state.jump |= S_Input_GetBindState(INPUT_ROLE_JUMP, cntlr_layout_num);
state.action |= S_Input_GetBindState(INPUT_ROLE_ACTION, cntlr_layout_num);
state.select |= S_Input_GetBindState(INPUT_ROLE_ACTION, cntlr_layout_num);
state.draw |= S_Input_GetBindState(INPUT_ROLE_DRAW, cntlr_layout_num);
state.look |= S_Input_GetBindState(INPUT_ROLE_LOOK, cntlr_layout_num);
state.roll |= S_Input_GetBindState(INPUT_ROLE_ROLL, cntlr_layout_num);
state.option |= S_Input_GetBindState(INPUT_ROLE_OPTION, cntlr_layout_num);
state.deselect |= S_Input_GetBindState(INPUT_ROLE_OPTION, cntlr_layout_num);
state.pause |= S_Input_GetBindState(INPUT_ROLE_PAUSE, cntlr_layout_num);
state.camera_up |= S_Input_GetBindState(INPUT_ROLE_CAMERA_UP, cntlr_layout_num);
state.camera_down |= S_Input_GetBindState(INPUT_ROLE_CAMERA_DOWN, cntlr_layout_num);
@ -937,8 +935,12 @@ INPUT_STATE S_Input_GetCurrentState(
linput.use_small_medi = S_Input_Key(INPUT_ROLE_USE_SMALL_MEDI, layout_num);
linput.use_big_medi = S_Input_Key(INPUT_ROLE_USE_BIG_MEDI, layout_num);
linput.select = S_Input_Key(INPUT_ROLE_ACTION, layout_num);
linput.deselect = S_Input_Key(INPUT_ROLE_OPTION, layout_num);
linput.menu_up = KEY_DOWN(SDL_SCANCODE_UP);
linput.menu_down = KEY_DOWN(SDL_SCANCODE_DOWN);
linput.menu_left = KEY_DOWN(SDL_SCANCODE_LEFT);
linput.menu_right = KEY_DOWN(SDL_SCANCODE_RIGHT);
linput.menu_confirm = KEY_DOWN(SDL_SCANCODE_RETURN);
linput.menu_back = KEY_DOWN(SDL_SCANCODE_ESCAPE);
linput.save = S_Input_Key(INPUT_ROLE_SAVE, layout_num);
linput.load = S_Input_Key(INPUT_ROLE_LOAD, layout_num);