Skip to content

Commit

Permalink
input: use look for camera reset
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Oct 7, 2024
1 parent 8bab311 commit 19c8aae
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 17 deletions.
1 change: 0 additions & 1 deletion data/tr1/ship/cfg/TR1X_gameflow.json5
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@
"KEYMAP_CAMERA_DOWN": "Camera Down",
"KEYMAP_CAMERA_FORWARD": "Camera Forward",
"KEYMAP_CAMERA_LEFT": "Camera Left",
"KEYMAP_CAMERA_RESET": "Reset Camera",
"KEYMAP_CAMERA_RIGHT": "Camera Right",
"KEYMAP_CAMERA_UP": "Camera Up",
"KEYMAP_CHANGE_TARGET": "Change Target",
Expand Down
1 change: 0 additions & 1 deletion data/tr1/ship/cfg/TR1X_gameflow_demo_pc.json5
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
"KEYMAP_CAMERA_DOWN": "Camera Down",
"KEYMAP_CAMERA_FORWARD": "Camera Forward",
"KEYMAP_CAMERA_LEFT": "Camera Left",
"KEYMAP_CAMERA_RESET": "Reset Camera",
"KEYMAP_CAMERA_RIGHT": "Camera Right",
"KEYMAP_CAMERA_UP": "Camera Up",
"KEYMAP_CHANGE_TARGET": "Change Target",
Expand Down
1 change: 0 additions & 1 deletion data/tr1/ship/cfg/TR1X_gameflow_ub.json5
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@
"KEYMAP_CAMERA_DOWN": "Camera Down",
"KEYMAP_CAMERA_FORWARD": "Camera Forward",
"KEYMAP_CAMERA_LEFT": "Camera Left",
"KEYMAP_CAMERA_RESET": "Reset Camera",
"KEYMAP_CAMERA_RIGHT": "Camera Right",
"KEYMAP_CAMERA_UP": "Camera Up",
"KEYMAP_CHANGE_TARGET": "Change Target",
Expand Down
1 change: 1 addition & 0 deletions docs/tr1/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- improved object name matching in console commands to work like TR2X
- improved vertex movement when looking through water portals even more (#1493)
- improved console commands targeting creatures and pickups (#1667)
- removed dedicated camera reset button in favor of pressing the look button (#1658)

## [4.4](https://github.com/LostArtefacts/TRX/compare/tr1-4.3...tr1-4.4) - 2024-09-20
- added `/exit` command (#1462)
Expand Down
2 changes: 1 addition & 1 deletion src/tr1/game/camera/photo_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void Camera_UpdatePhotoMode(void)
g_Camera.target_distance = CAMERA_DEFAULT_DISTANCE;
g_Camera.target_square = SQUARE(g_Camera.target_distance);

if (g_InputDB.look) {
if (g_InputDB.camera_reset) {
M_ResetCamera();
g_Camera.type = CAM_PHOTO_MODE;
}
Expand Down
1 change: 0 additions & 1 deletion src/tr1/game/game_string.def
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ GS_DEFINE(KEYMAP_CAMERA_LEFT, "Camera Left")
GS_DEFINE(KEYMAP_CAMERA_RIGHT, "Camera Right")
GS_DEFINE(KEYMAP_CAMERA_UP, "Camera Up")
GS_DEFINE(KEYMAP_CAMERA_DOWN, "Camera Down")
GS_DEFINE(KEYMAP_CAMERA_RESET, "Reset Camera")
GS_DEFINE(KEYMAP_EQUIP_PISTOLS, "Equip Pistols")
GS_DEFINE(KEYMAP_EQUIP_SHOTGUN, "Equip Shotgun")
GS_DEFINE(KEYMAP_EQUIP_MAGNUMS, "Equip Magnums")
Expand Down
2 changes: 0 additions & 2 deletions src/tr1/game/option/option_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementNormal[] = {
{ INPUT_ROLE_CAMERA_BACK, GS_ID(KEYMAP_CAMERA_BACK), true },
{ INPUT_ROLE_CAMERA_LEFT, GS_ID(KEYMAP_CAMERA_LEFT), true },
{ INPUT_ROLE_CAMERA_RIGHT, GS_ID(KEYMAP_CAMERA_RIGHT), true },
{ INPUT_ROLE_CAMERA_RESET, GS_ID(KEYMAP_CAMERA_RESET), true },
{ INPUT_ROLE_EQUIP_PISTOLS, GS_ID(KEYMAP_EQUIP_PISTOLS), true },
{ INPUT_ROLE_EQUIP_SHOTGUN, GS_ID(KEYMAP_EQUIP_SHOTGUN), true },
{ INPUT_ROLE_EQUIP_MAGNUMS, GS_ID(KEYMAP_EQUIP_MAGNUMS), true },
Expand Down Expand Up @@ -175,7 +174,6 @@ static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementCheats[] = {
{ INPUT_ROLE_CAMERA_BACK, GS_ID(KEYMAP_CAMERA_BACK), true },
{ INPUT_ROLE_CAMERA_LEFT, GS_ID(KEYMAP_CAMERA_LEFT), true },
{ INPUT_ROLE_CAMERA_RIGHT, GS_ID(KEYMAP_CAMERA_RIGHT), true },
{ INPUT_ROLE_CAMERA_RESET, GS_ID(KEYMAP_CAMERA_RESET), true },
{ INPUT_ROLE_EQUIP_PISTOLS, GS_ID(KEYMAP_EQUIP_PISTOLS), true },
{ INPUT_ROLE_EQUIP_SHOTGUN, GS_ID(KEYMAP_EQUIP_SHOTGUN), true },
{ INPUT_ROLE_EQUIP_MAGNUMS, GS_ID(KEYMAP_EQUIP_MAGNUMS), true },
Expand Down
19 changes: 9 additions & 10 deletions src/tr1/specific/s_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static INPUT_SCANCODE m_Layout[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = {
SDL_SCANCODE_S, // INPUT_ROLE_CAMERA_BACK
SDL_SCANCODE_A, // INPUT_ROLE_CAMERA_LEFT
SDL_SCANCODE_D, // INPUT_ROLE_CAMERA_RIGHT
SDL_SCANCODE_EQUALS, // INPUT_ROLE_CAMERA_RESET
0, // padding
SDL_SCANCODE_1, // INPUT_ROLE_EQUIP_PISTOLS
SDL_SCANCODE_2, // INPUT_ROLE_EQUIP_SHOTGUN
SDL_SCANCODE_3, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -94,7 +94,7 @@ static INPUT_SCANCODE m_Layout[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = {
SDL_SCANCODE_S, // INPUT_ROLE_CAMERA_BACK
SDL_SCANCODE_A, // INPUT_ROLE_CAMERA_LEFT
SDL_SCANCODE_D, // INPUT_ROLE_CAMERA_RIGHT
SDL_SCANCODE_EQUALS, // INPUT_ROLE_CAMERA_RESET
0, // padding
SDL_SCANCODE_1, // INPUT_ROLE_EQUIP_PISTOLS
SDL_SCANCODE_2, // INPUT_ROLE_EQUIP_SHOTGUN
SDL_SCANCODE_3, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -136,7 +136,7 @@ static INPUT_SCANCODE m_Layout[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = {
SDL_SCANCODE_S, // INPUT_ROLE_CAMERA_BACK
SDL_SCANCODE_A, // INPUT_ROLE_CAMERA_LEFT
SDL_SCANCODE_D, // INPUT_ROLE_CAMERA_RIGHT
SDL_SCANCODE_EQUALS, // INPUT_ROLE_CAMERA_RESET
0, // padding
SDL_SCANCODE_1, // INPUT_ROLE_EQUIP_PISTOLS
SDL_SCANCODE_2, // INPUT_ROLE_EQUIP_SHOTGUN
SDL_SCANCODE_3, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -178,7 +178,7 @@ static INPUT_SCANCODE m_Layout[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = {
SDL_SCANCODE_S, // INPUT_ROLE_CAMERA_BACK
SDL_SCANCODE_A, // INPUT_ROLE_CAMERA_LEFT
SDL_SCANCODE_D, // INPUT_ROLE_CAMERA_RIGHT
SDL_SCANCODE_EQUALS, // INPUT_ROLE_CAMERA_RESET
0, // padding
SDL_SCANCODE_1, // INPUT_ROLE_EQUIP_PISTOLS
SDL_SCANCODE_2, // INPUT_ROLE_EQUIP_SHOTGUN
SDL_SCANCODE_3, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -225,7 +225,7 @@ static CONTROLLER_MAP
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTY}, 1 }, // INPUT_ROLE_CAMERA_BACK
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, -1 }, // INPUT_ROLE_CAMERA_LEFT
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, 1 }, // INPUT_ROLE_CAMERA_RIGHT
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_RIGHTSTICK}, 0 }, // INPUT_ROLE_CAMERA_RESET
{ 0, {0}, 0 }, // padding
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_PISTOLS
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_SHOTGUN
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -267,7 +267,7 @@ static CONTROLLER_MAP
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTY}, 1 }, // INPUT_ROLE_CAMERA_BACK
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, -1 }, // INPUT_ROLE_CAMERA_LEFT
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, 1 }, // INPUT_ROLE_CAMERA_RIGHT
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_RIGHTSTICK}, 0 }, // INPUT_ROLE_CAMERA_RESET
{ 0, {0}, 0 }, // padding
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_PISTOLS
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_SHOTGUN
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -309,7 +309,7 @@ static CONTROLLER_MAP
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTY}, 1 }, // INPUT_ROLE_CAMERA_BACK
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, -1 }, // INPUT_ROLE_CAMERA_LEFT
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, 1 }, // INPUT_ROLE_CAMERA_RIGHT
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_RIGHTSTICK}, 0 }, // INPUT_ROLE_CAMERA_RESET
{ 0, {0}, 0 }, // padding
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_PISTOLS
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_SHOTGUN
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -351,7 +351,7 @@ static CONTROLLER_MAP
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTY}, 1 }, // INPUT_ROLE_CAMERA_BACK
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, -1 }, // INPUT_ROLE_CAMERA_LEFT
{ BT_AXIS, {SDL_CONTROLLER_AXIS_RIGHTX}, 1 }, // INPUT_ROLE_CAMERA_RIGHT
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_RIGHTSTICK}, 0 }, // INPUT_ROLE_CAMERA_RESET
{ 0, {0}, 0 }, // padding
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_PISTOLS
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_SHOTGUN
{ BT_BUTTON, {SDL_CONTROLLER_BUTTON_INVALID}, 0 }, // INPUT_ROLE_EQUIP_MAGNUMS
Expand Down Expand Up @@ -888,7 +888,6 @@ static INPUT_STATE M_GetControllerState(
state.camera_back |= M_GetBindState(INPUT_ROLE_CAMERA_BACK, cntlr_layout_num);
state.camera_left |= M_GetBindState(INPUT_ROLE_CAMERA_LEFT, cntlr_layout_num);
state.camera_right |= M_GetBindState(INPUT_ROLE_CAMERA_RIGHT, cntlr_layout_num);
state.camera_reset |= M_GetBindState(INPUT_ROLE_CAMERA_RESET, cntlr_layout_num);
state.item_cheat |= M_GetBindState(INPUT_ROLE_ITEM_CHEAT, cntlr_layout_num);
state.fly_cheat |= M_GetBindState(INPUT_ROLE_FLY_CHEAT, cntlr_layout_num);
state.level_skip_cheat |= M_GetBindState(INPUT_ROLE_LEVEL_SKIP_CHEAT, cntlr_layout_num);
Expand Down Expand Up @@ -990,7 +989,7 @@ INPUT_STATE S_Input_GetCurrentState(
linput.camera_back = M_Key(INPUT_ROLE_CAMERA_BACK, layout_num);
linput.camera_left = M_Key(INPUT_ROLE_CAMERA_LEFT, layout_num);
linput.camera_right = M_Key(INPUT_ROLE_CAMERA_RIGHT, layout_num);
linput.camera_reset = M_Key(INPUT_ROLE_CAMERA_RESET, layout_num);
linput.camera_reset = linput.look;
linput.enter_console = M_Key(INPUT_ROLE_ENTER_CONSOLE, layout_num);
linput.change_target = M_Key(INPUT_ROLE_CHANGE_TARGET, layout_num);

Expand Down

0 comments on commit 19c8aae

Please sign in to comment.