From 870f1903635c7139f1450ce1063a36a24961c70b Mon Sep 17 00:00:00 2001 From: praydog Date: Wed, 18 Sep 2024 21:48:43 -0700 Subject: [PATCH] Dead Rising: Tentative crash fix + Ultrawide (DD2 build) --- src/mods/Graphics.cpp | 12 ++++++++++++ src/mods/Graphics.hpp | 8 ++++++++ src/mods/IntegrityCheckBypass.cpp | 5 +++++ 3 files changed, 25 insertions(+) diff --git a/src/mods/Graphics.cpp b/src/mods/Graphics.cpp index 3504c320..e9237e93 100644 --- a/src/mods/Graphics.cpp +++ b/src/mods/Graphics.cpp @@ -396,8 +396,20 @@ bool Graphics::on_pre_gui_draw_element(REComponent* gui_element, void* primitive auto game_object = utility::re_component::get_game_object(gui_element); static auto letter_box_behavior_t = sdk::find_type_definition("app.LetterBoxBehavior"); static auto letter_box_behavior_retype = letter_box_behavior_t != nullptr ? letter_box_behavior_t->get_type() : nullptr; + static auto csmaskui_t = sdk::find_type_definition("app.solid.gui.CSMaskUI"); + static auto csmaskui_retype = csmaskui_t != nullptr ? csmaskui_t->get_type() : nullptr; if (game_object != nullptr && game_object->transform != nullptr) { + // Ultrawide for Dead Rising Deluxe Remaster + if (csmaskui_retype != nullptr) { + auto csmaskui = utility::re_component::find(game_object->transform, csmaskui_retype); + + if (csmaskui != nullptr) { + game_object->shouldDraw = false; + return false; + } + } + const auto name = utility::re_string::get_string(game_object->name); const auto name_hash = utility::hash(name); diff --git a/src/mods/Graphics.hpp b/src/mods/Graphics.hpp index 3c425f40..ee14bb3c 100644 --- a/src/mods/Graphics.hpp +++ b/src/mods/Graphics.hpp @@ -165,7 +165,15 @@ class Graphics : public Mod { const ModToggle::Ptr m_ultrawide_fix{ ModToggle::create(generate_name("UltrawideFix"), false) }; const ModToggle::Ptr m_ultrawide_vertical_fov{ ModToggle::create(generate_name("UltrawideFixVerticalFOV_V2"), false) }; + + // There is a trend with newer games where there actually is Ultrawide support, so we don't want to actually touch the FOV by default + // And sometimes messing with the FOV causes permanent issues with the UI, so don't touch it by default +#if TDB_VER >= 73 + const ModToggle::Ptr m_ultrawide_custom_fov{ModToggle::create(generate_name("UltrawideCustomFOV"), true)}; +#else const ModToggle::Ptr m_ultrawide_custom_fov{ModToggle::create(generate_name("UltrawideCustomFOV"), false)}; +#endif + const ModToggle::Ptr m_ultrawide_constrain_ui{ModToggle::create(generate_name("UltrawideConstrainUI"), false)}; const ModToggle::Ptr m_ultrawide_constrain_child_ui{ModToggle::create(generate_name("UltrawideConstrainChildUI"), false)}; const ModSlider::Ptr m_ultrawide_fov_multiplier{ ModSlider::create(generate_name("UltrawideFOVMultiplier_V2"), 0.01f, 3.0f, 1.0f) }; diff --git a/src/mods/IntegrityCheckBypass.cpp b/src/mods/IntegrityCheckBypass.cpp index c0f55095..9ac33761 100644 --- a/src/mods/IntegrityCheckBypass.cpp +++ b/src/mods/IntegrityCheckBypass.cpp @@ -302,6 +302,11 @@ void IntegrityCheckBypass::disable_update_timers(std::string_view name) const { void IntegrityCheckBypass::ignore_application_entries() { Hooks::get()->ignore_application_entry(0x76b8100bec7c12c3); Hooks::get()->ignore_application_entry(0x9f63c0fc4eea6626); + +#if TDB_VER >= 73 + Hooks::get()->ignore_application_entry(0x00c0ab9309584734); + Hooks::get()->ignore_application_entry(0xa474f1d3a294e6a4); +#endif } void IntegrityCheckBypass::immediate_patch_re8() {