From ae24a693eef9e0d21bdc96b32b4ba19c4e23493a Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Fri, 29 Nov 2024 21:05:41 +0000 Subject: [PATCH] tr2/data: add pickup item rotation injections This adds injections to rotate pickup items to better suit 3D pickup mode. Resolves #1613. --- data/tr2/ship/cfg/TR2X_gameflow.json5 | 43 +++++++++++++++--- .../data/injections/barkhang_itemrots.bin | Bin 0 -> 100 bytes .../data/injections/catacombs_itemrots.bin | Bin 0 -> 82 bytes .../ship/data/injections/deck_itemrots.bin | Bin 0 -> 46 bytes .../ship/data/injections/diving_itemrots.bin | Bin 0 -> 100 bytes .../data/injections/floating_itemrots.bin | Bin 0 -> 46 bytes .../ship/data/injections/house_itemrots.bin | Bin 0 -> 784 bytes .../ship/data/injections/opera_itemrots.bin | Bin 0 -> 64 bytes .../ship/data/injections/palace_itemrots.bin | Bin 0 -> 82 bytes .../tr2/ship/data/injections/rig_itemrots.bin | Bin 0 -> 46 bytes .../ship/data/injections/tibet_itemrots.bin | Bin 0 -> 82 bytes .../ship/data/injections/wall_itemrots.bin | Bin 0 -> 64 bytes .../ship/data/injections/wreck_itemrots.bin | Bin 0 -> 82 bytes .../ship/data/injections/xian_itemrots.bin | Bin 0 -> 154 bytes docs/tr2/CHANGELOG.md | 1 + src/tr2/config.h | 1 + src/tr2/config_map.def | 1 + src/tr2/game/inject.c | 4 ++ .../TR2X_ConfigTool/Resources/Lang/en.json | 4 ++ .../Resources/specification.json | 5 ++ 20 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 data/tr2/ship/data/injections/barkhang_itemrots.bin create mode 100644 data/tr2/ship/data/injections/catacombs_itemrots.bin create mode 100644 data/tr2/ship/data/injections/deck_itemrots.bin create mode 100644 data/tr2/ship/data/injections/diving_itemrots.bin create mode 100644 data/tr2/ship/data/injections/floating_itemrots.bin create mode 100644 data/tr2/ship/data/injections/house_itemrots.bin create mode 100644 data/tr2/ship/data/injections/opera_itemrots.bin create mode 100644 data/tr2/ship/data/injections/palace_itemrots.bin create mode 100644 data/tr2/ship/data/injections/rig_itemrots.bin create mode 100644 data/tr2/ship/data/injections/tibet_itemrots.bin create mode 100644 data/tr2/ship/data/injections/wall_itemrots.bin create mode 100644 data/tr2/ship/data/injections/wreck_itemrots.bin create mode 100644 data/tr2/ship/data/injections/xian_itemrots.bin diff --git a/data/tr2/ship/cfg/TR2X_gameflow.json5 b/data/tr2/ship/cfg/TR2X_gameflow.json5 index d0ae911ee..780e7d8b9 100644 --- a/data/tr2/ship/cfg/TR2X_gameflow.json5 +++ b/data/tr2/ship/cfg/TR2X_gameflow.json5 @@ -7,7 +7,11 @@ {}, // 1. The Great Wall - {}, + { + "injections": [ + "data/injections/wall_itemrots.bin", + ], + }, // 2. Venice {}, @@ -19,14 +23,23 @@ { "injections": [ "data/injections/opera_fd.bin", + "data/injections/opera_itemrots.bin", ], }, // 5. Offshore Rig - {}, + { + "injections": [ + "data/injections/rig_itemrots.bin", + ], + }, // 6. Diving Area - {}, + { + "injections": [ + "data/injections/diving_itemrots.bin", + ], + }, // 7. 40 Fathoms {}, @@ -35,6 +48,7 @@ { "injections": [ "data/injections/wreck_fd.bin", + "data/injections/wreck_itemrots.bin", ], }, @@ -42,12 +56,17 @@ {}, // 10. The Deck - {}, + { + "injections": [ + "data/injections/deck_itemrots.bin", + ], + }, // 11. Tibetan Foothills { "injections": [ "data/injections/tibet_fd.bin", + "data/injections/tibet_itemrots.bin", ], "object_strings": { "O_TIGER": "Snow Leopard", @@ -55,12 +74,17 @@ }, // 12. Barkhang Monastery - {}, + { + "injections": [ + "data/injections/barkhang_itemrots.bin", + ], + }, // 13. Catacombs of the Talion { "injections": [ "data/injections/catacombs_fd.bin", + "data/injections/catacombs_itemrots.bin", ], "object_strings": { "O_TIGER": "Snow Leopard", @@ -71,6 +95,7 @@ { "injections": [ "data/injections/palace_fd.bin", + "data/injections/palace_itemrots.bin", ], "object_strings": { "O_TIGER": "Snow Leopard", @@ -81,6 +106,7 @@ { "injections": [ "data/injections/xian_fd.bin", + "data/injections/xian_itemrots.bin", ], }, @@ -88,6 +114,7 @@ { "injections": [ "data/injections/floating_fd.bin", + "data/injections/floating_itemrots.bin", ], }, @@ -95,7 +122,11 @@ {}, // 18. Home Sweet Home - {}, + { + "injections": [ + "data/injections/house_itemrots.bin", + ], + }, // 19. Demo 1 {}, diff --git a/data/tr2/ship/data/injections/barkhang_itemrots.bin b/data/tr2/ship/data/injections/barkhang_itemrots.bin new file mode 100644 index 0000000000000000000000000000000000000000..262ef7b528edf336be85bd3862bf94f58917a39b GIT binary patch literal 100 zcmWGBitu7&U|?VeVh|0&EI{l5#PSRb2NumAu6 literal 0 HcmV?d00001 diff --git a/data/tr2/ship/data/injections/diving_itemrots.bin b/data/tr2/ship/data/injections/diving_itemrots.bin new file mode 100644 index 0000000000000000000000000000000000000000..abf48974fd91142e85206de6ddc5cd33f38fcb7b GIT binary patch literal 100 zcmWGBitu7&U|?VeVh|0&EI{l5#8wOp4Gmv_jF12SGw?Ao$T7qLMHr%h#4n(T5+j2N gLj?na14AEB%^jdf5F0rMM1HAZHfU&xJ)*zse~0UN<{9 literal 0 HcmV?d00001 diff --git a/data/tr2/ship/data/injections/opera_itemrots.bin b/data/tr2/ship/data/injections/opera_itemrots.bin new file mode 100644 index 0000000000000000000000000000000000000000..73ddb639528ac150b2673b8bd04f82da6b88a29c GIT binary patch literal 64 zcmWGBitu7&U|?VeVh|0&OhBvx#AOT&4h;8z3{4=O$H0)y5Cjqt1FDe+itJ)w2xb5P DuSf;- literal 0 HcmV?d00001 diff --git a/data/tr2/ship/data/injections/palace_itemrots.bin b/data/tr2/ship/data/injections/palace_itemrots.bin new file mode 100644 index 0000000000000000000000000000000000000000..204f68b98e09094eb956775b9ba20f4d6fcd94a6 GIT binary patch literal 82 zcmWGBitu7&U|?VeVh|0&%s^}g#8C_k4GdyH5iuY~kCDNSAr>TZ4#)$Ed}Cm6WSGvt SaDages74nkvWS79p8)_P3<#J2 literal 0 HcmV?d00001 diff --git a/data/tr2/ship/data/injections/rig_itemrots.bin b/data/tr2/ship/data/injections/rig_itemrots.bin new file mode 100644 index 0000000000000000000000000000000000000000..ca967a144770a8d7354c16a9fa65854b4c7aa4c6 GIT binary patch literal 46 ncmWGBitu7&U|?VeVh|0(LO`}01A_y@Djl)U1A`?)JOe`m!#*I- z6^QLXD4l`f0D}?GoEV_UG6n`mhE9;0I3Ujeh(9p^O<4dmrva!CEOLs0A&KE8$Ydd) Nhz}6!F)++w008v@621Tc literal 0 HcmV?d00001 diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index 51c074a5e..d4eac3f41 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -3,6 +3,7 @@ - added an option to fix inventory item usage duplication (#1586) - added optional automatic key/puzzle inventory item pre-selection (#1884) - added a search feature to the config tool (#1889) +- added an option to fix rotation on some pickup items to better suit 3D pickup mode (#1613) - fixed a crash relating to audio decoding (#1895) - fixed depth problems when drawing certain rooms (#1853, regression from 0.6) - fixed Lara getting stuck in her hit animation if she is hit while mounting the boat or skidoo (#1606) diff --git a/src/tr2/config.h b/src/tr2/config.h index 12020e1b1..decef0d95 100644 --- a/src/tr2/config.h +++ b/src/tr2/config.h @@ -15,6 +15,7 @@ typedef struct { struct { bool enable_3d_pickups; + bool fix_item_rots; } visuals; struct { diff --git a/src/tr2/config_map.def b/src/tr2/config_map.def index f3397d068..8839a6d13 100644 --- a/src/tr2/config_map.def +++ b/src/tr2/config_map.def @@ -4,6 +4,7 @@ CFG_BOOL(g_Config, gameplay.fix_item_duplication_glitch, false) CFG_BOOL(g_Config, gameplay.enable_auto_item_selection, true) CFG_BOOL(g_Config, gameplay.fix_floor_data_issues, true) CFG_BOOL(g_Config, visuals.enable_3d_pickups, true) +CFG_BOOL(g_Config, visuals.fix_item_rots, true) CFG_ENUM(g_Config, rendering.screenshot_format, SCREENSHOT_FORMAT_JPEG, SCREENSHOT_FORMAT) CFG_INT32(g_Config, rendering.turbo_speed, 0) CFG_INT32(g_Config, input.keyboard_layout, INPUT_LAYOUT_DEFAULT) diff --git a/src/tr2/game/inject.c b/src/tr2/game/inject.c index 02a5cb712..2ba305462 100644 --- a/src/tr2/game/inject.c +++ b/src/tr2/game/inject.c @@ -21,6 +21,7 @@ typedef enum { typedef enum { INJ_GENERAL = 0, INJ_FLOOR_DATA = 4, + INJ_ITEM_POSITION = 7, } INJECTION_TYPE; typedef enum { @@ -89,6 +90,9 @@ static void M_LoadFromFile(INJECTION *const injection, const char *filename) case INJ_FLOOR_DATA: injection->relevant = g_Config.gameplay.fix_floor_data_issues; break; + case INJ_ITEM_POSITION: + injection->relevant = g_Config.visuals.fix_item_rots; + break; default: LOG_WARNING("%s is of unknown type %d", filename, injection->type); break; diff --git a/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json b/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json index 01b5ff41b..a567aa392 100644 --- a/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json +++ b/tools/tr2/config/TR2X_ConfigTool/Resources/Lang/en.json @@ -33,6 +33,10 @@ "Title": "Fix floor data issues", "Description": "Fixes original issues with floor data/triggers." }, + "fix_item_rots": { + "Title": "Fix item rotation issues", + "Description": "Fixes original issues with some incorrectly rotated pickups when using the 3D pickups option." + }, "enable_auto_item_selection": { "Title": "Key item pre-selection", "Description": "When Lara presses action against a keyhole or puzzle slot, and she has the corresponding item in the inventory, that item will be pre-selected." diff --git a/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json b/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json index d20cacc5a..53c991675 100644 --- a/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json +++ b/tools/tr2/config/TR2X_ConfigTool/Resources/specification.json @@ -31,6 +31,11 @@ "Field": "fix_floor_data_issues", "DataType": "Bool", "DefaultValue": true + }, + { + "Field": "fix_item_rots", + "DataType": "Bool", + "DefaultValue": true } ] },