diff --git a/src/Options.cpp b/src/Options.cpp index 87819e91..39a311d9 100644 --- a/src/Options.cpp +++ b/src/Options.cpp @@ -6,22 +6,19 @@ void PatchesSettings::Load(const nlohmann::json& aConfig) { - SkipStartMenu = aConfig.value("skip_start_menu", SkipStartMenu); AsyncCompute = aConfig.value("disable_async_compute", AsyncCompute); Antialiasing = aConfig.value("disable_antialiasing", Antialiasing); - DisableIntroMovies = aConfig.value("disable_intro_movies", DisableIntroMovies); DisableVignette = aConfig.value("disable_vignette", DisableVignette); DisableBoundaryTeleport = aConfig.value("disable_boundary_teleport", DisableBoundaryTeleport); DisableWin7Vsync = aConfig.value("disable_win7_vsync", DisableWin7Vsync); - MinimapFlicker = aConfig.value("minimap_flicker", MinimapFlicker); } nlohmann::json PatchesSettings::Save() const { return { - {"disable_async_compute", AsyncCompute}, {"disable_antialiasing", Antialiasing}, {"skip_start_menu", SkipStartMenu}, - {"disable_intro_movies", DisableIntroMovies}, {"disable_vignette", DisableVignette}, {"disable_boundary_teleport", DisableBoundaryTeleport}, - {"disable_win7_vsync", DisableWin7Vsync}, {"minimap_flicker", MinimapFlicker}, + {"disable_async_compute", AsyncCompute}, {"disable_antialiasing", Antialiasing}, + {"disable_vignette", DisableVignette}, {"disable_boundary_teleport", DisableBoundaryTeleport}, + {"disable_win7_vsync", DisableWin7Vsync}, }; } diff --git a/src/Options.h b/src/Options.h index 97c870f7..9a6ad4c7 100644 --- a/src/Options.h +++ b/src/Options.h @@ -14,12 +14,9 @@ struct PatchesSettings bool AsyncCompute{false}; bool Antialiasing{false}; - bool SkipStartMenu{false}; - bool DisableIntroMovies{false}; bool DisableVignette{false}; bool DisableBoundaryTeleport{false}; bool DisableWin7Vsync{false}; - bool MinimapFlicker{false}; }; struct FontSettings diff --git a/src/dllmain.cpp b/src/dllmain.cpp index e3b1c325..97b45bc7 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -4,11 +4,7 @@ #include "Options.h" -#include "scripting/GameHooks.h" - -void StartScreenPatch(); void OptionsInitHook(); -void DisableIntroMoviesPatch(); void DisableVignettePatch(); void DisableBoundaryTeleportPatch(); @@ -33,12 +29,6 @@ static void Initialize() // initialize patches - // if (options.Patches.SkipStartMenu) - // StartScreenPatch(); - - if (options.Patches.DisableIntroMovies) - DisableIntroMoviesPatch(); - if (options.Patches.DisableVignette) DisableVignettePatch(); diff --git a/src/overlay/widgets/Settings.cpp b/src/overlay/widgets/Settings.cpp index 06d8335f..24e01dd7 100644 --- a/src/overlay/widgets/Settings.cpp +++ b/src/overlay/widgets/Settings.cpp @@ -64,14 +64,6 @@ void Settings::OnUpdate() m_patches.AsyncCompute, patchesSettings.AsyncCompute); UpdateAndDrawSetting( "Disable Anti-aliasing", "Completely disables anti-aliasing (requires restart to take effect).", m_patches.Antialiasing, patchesSettings.Antialiasing); - UpdateAndDrawSetting( - "Skip Start Menu", - "Skips the 'Breaching...' menu asking you to press space bar to continue (requires restart to take " - "effect).", - m_patches.SkipStartMenu, patchesSettings.SkipStartMenu); - UpdateAndDrawSetting( - "Suppress Intro Movies", "Disables logos played at the beginning (requires restart to take effect).", m_patches.DisableIntroMovies, - patchesSettings.DisableIntroMovies); UpdateAndDrawSetting( "Disable Vignette", "Disables vignetting along screen borders (requires restart to take effect).", m_patches.DisableVignette, patchesSettings.DisableVignette); UpdateAndDrawSetting( @@ -80,10 +72,7 @@ void Settings::OnUpdate() UpdateAndDrawSetting( "Disable V-Sync (Windows 7 only)", "Disables VSync on Windows 7 to bypass the 60 FPS limit (requires restart to take effect).", m_patches.DisableWin7Vsync, patchesSettings.DisableWin7Vsync); - UpdateAndDrawSetting( - "Fix Minimap Flicker", "Fixes Minimap flicker caused by some mods (requires restart to take effect).", m_patches.MinimapFlicker, - patchesSettings.MinimapFlicker); - + ImGui::EndTable(); } ImGui::TreePop(); diff --git a/src/patches/DisableIntroMovies.cpp b/src/patches/DisableIntroMovies.cpp deleted file mode 100644 index 15a1282e..00000000 --- a/src/patches/DisableIntroMovies.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include - -using TInitScriptMemberVariable = void*(void* a1, void* a2, uint64_t a3, uint64_t nameHash, void* a5, void* a6, void* a7); -TInitScriptMemberVariable* RealInitScriptMemberVariable = nullptr; - -void* HookInitScriptMemberVariable(void* a1, void* a2, uint64_t a3, uint64_t nameHash, void* a5, void* a6, void* a7) -{ - // Break the nameHash of some SplashScreenLoadingScreenLogicController variables - // Should prevent the intro screen scripts from finding the intro bink, which makes it show a loading screen instead - // (intro movie audio still plays though - this can be stopped by disabling more script vars, but unfortunately - // that'll also make it load infinitely) For me the loading screen takes almost as much time as the intro movie - // itself did, but the audio shows that a few seconds are saved with this, maybe faster machines can save even more - // time. - - // Ideally I think the real solution is to change GameFramework/InitialState INI variable from "Initialization" to - // "PreGameSession" or "MainMenu" instead Unfortunately that causes a black screen on launch though, likely only - // works properly on non-shipping builds - - switch (nameHash) - { - case RED4ext::FNV1a64("logoTrainWBBink"): - case RED4ext::FNV1a64("logoTrainNamcoBink"): - case RED4ext::FNV1a64("logoTrainStadiaBink"): - case RED4ext::FNV1a64("logoTrainNoRTXBink"): - case RED4ext::FNV1a64("logoTrainRTXBink"): - case RED4ext::FNV1a64("introMessageBink"): - case RED4ext::FNV1a64("trailerBink"): // after startup logo - { - nameHash = ~nameHash; - break; - } - default: - { - break; - } - } - - return RealInitScriptMemberVariable(a1, a2, a3, nameHash, a5, a6, a7); -} - -void DisableIntroMoviesPatch() -{ - const RED4ext::UniversalRelocPtr func(CyberEngineTweaks::AddressHashes::CPatches_IntroMovie); - RealInitScriptMemberVariable = reinterpret_cast(func.GetAddr()); - - if (RealInitScriptMemberVariable == nullptr) - { - Log::Warn("Disable intro movies patch: failed, could not be found"); - return; - } - - MH_CreateHook( - reinterpret_cast(RealInitScriptMemberVariable), reinterpret_cast(&HookInitScriptMemberVariable), reinterpret_cast(&RealInitScriptMemberVariable)); - Log::Info("Disable intro movies patch: success"); -} diff --git a/src/patches/MinimapFlicker.cpp b/src/patches/MinimapFlicker.cpp deleted file mode 100644 index 1b6a6e2e..00000000 --- a/src/patches/MinimapFlicker.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include - -/** - -Does not seem to be needed since 2.0, keeping in case we need it again - -void MinimapFlickerPatch() -{ - const RED4ext::RelocPtr func(CyberEngineTweaks::Addresses::CPatches_MinimapFlicker); - uint8_t* pLocation = func.GetAddr(); - - if (pLocation == nullptr) - { - Log::Warn("Minimap Flicker Patch: failed"); - return; - } - - pLocation += 0xEC; - - DWORD oldProtect = 0; - VirtualProtect(pLocation, 32, PAGE_EXECUTE_WRITECOPY, &oldProtect); - pLocation[0] = 0x01; - VirtualProtect(pLocation, 32, oldProtect, nullptr); - - Log::Info("Minimap Flicker Patch: success"); -} -*/ diff --git a/src/patches/SkipStartScreen.cpp b/src/patches/SkipStartScreen.cpp deleted file mode 100644 index 845365e6..00000000 --- a/src/patches/SkipStartScreen.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -/* -void StartScreenPatch() -{ - const RED4ext::RelocPtr func(CyberEngineTweaks::Addresses::CPatches_SkipStartScreen); - uint8_t* pLocation = func.GetAddr(); - - if (pLocation == nullptr) - { - Log::Warn("Start screen patch: failed, could not be found"); - return; - } - - DWORD oldProtect = 0; - VirtualProtect(pLocation, 32, PAGE_EXECUTE_WRITECOPY, &oldProtect); - pLocation[0] = 0xE9; - pLocation[1] = 0x08; - pLocation[2] = 0x01; - pLocation[3] = 0x00; - pLocation[4] = 0x00; - pLocation[5] = 0x00; - pLocation[6] = 0x00; - VirtualProtect(pLocation, 32, oldProtect, nullptr); - - Log::Info("Start screen patch: success"); -} -*/