diff --git a/resource/NewVegasReloaded.dll.defaults.toml b/resource/NewVegasReloaded.dll.defaults.toml index e43b65440..7ce0d1e93 100644 --- a/resource/NewVegasReloaded.dll.defaults.toml +++ b/resource/NewVegasReloaded.dll.defaults.toml @@ -57,6 +57,7 @@ RenderPreTonemapping = true # Toggle rendering of some effects in HDR before the ReplaceIntro = false # Controls rendering of the main menu custom video. ScreenshotKey = 87 # Keycode for custom screenshot hotkey (removes HUD and saves as jpg). HDRScreenshot = false # Save screenshots in fbx (use with DXVK HDR) +DisableShadowManagement = false [_Main.Main.Precipitations] RemovePrecipitations = false # Disables vanilla rain and other precipitations. diff --git a/src/NewVegas/Hooks/Hooks.cpp b/src/NewVegas/Hooks/Hooks.cpp index 628e55a07..b291ca3f2 100644 --- a/src/NewVegas/Hooks/Hooks.cpp +++ b/src/NewVegas/Hooks/Hooks.cpp @@ -57,10 +57,13 @@ void AttachHooks() { SafeWriteJump(Jumpers::RenderInterface::Hook, (UInt32)RenderInterfaceHook); SafeWriteJump(Jumpers::SetRegionEditorName::Hook, (UInt32)SetRegionEditorNameHook); SafeWriteJump(Jumpers::SetWeatherEditorName::Hook, (UInt32)SetWeatherEditorNameHook); - SafeWriteJump(Jumpers::Shadows::RenderShadowMapHook, (UInt32)RenderShadowMapHook); - // SafeWriteJump(Jumpers::Shadows::RenderShadowMap1Hook, (UInt32)RenderShadowMap1Hook); - SafeWriteJump(Jumpers::Shadows::AddCastShadowFlagHook, (UInt32)AddCastShadowFlagHook); - SafeWriteJump(Jumpers::Shadows::LeavesNodeNameHook, (UInt32)LeavesNodeNameHook); + if (!(SettingsMain->Main.DisableShadowManagement) ) { + SafeWriteJump(Jumpers::Shadows::RenderShadowMapHook, (UInt32)RenderShadowMapHook); + // SafeWriteJump(Jumpers::Shadows::RenderShadowMap1Hook, (UInt32)RenderShadowMap1Hook); + SafeWriteJump(Jumpers::Shadows::AddCastShadowFlagHook, (UInt32)AddCastShadowFlagHook); + SafeWriteJump(Jumpers::Shadows::LeavesNodeNameHook, (UInt32)LeavesNodeNameHook); + } + SafeWriteCall(Jumpers::MainMenuMusic::Fix1, (UInt32)MainMenuMusicFix); SafeWriteCall(Jumpers::MainMenuMusic::Fix2, (UInt32)MainMenuMusicFix); diff --git a/src/NewVegas/Hooks/Settings.cpp b/src/NewVegas/Hooks/Settings.cpp index ed402843e..f2171dee4 100644 --- a/src/NewVegas/Hooks/Settings.cpp +++ b/src/NewVegas/Hooks/Settings.cpp @@ -15,7 +15,7 @@ bool __fastcall ReadSettingHook(INISettingCollection* This, UInt32 edx, GameSett Setting->pValue = (char*)MainMenuMovie; else if ((!strcmp(Setting->Name, "SMainMenuMusic:General") || !strcmp(Setting->Name, "STitleMusic:Loading")) && TheSettingManager->SettingsMain.Main.ReplaceIntro) Setting->pValue = (char*)MainMenuMusic; - else if (!strcmp(Setting->Name, "bDoCanopyShadowPass:Display") || !strcmp(Setting->Name, "bDoActorShadows:Display") || !strcmp(Setting->Name, "iActorShadowCountExt:Display") || !strcmp(Setting->Name, "iActorShadowCountInt:Display")) + else if ( (!strcmp(Setting->Name, "bDoCanopyShadowPass:Display") || !strcmp(Setting->Name, "bDoActorShadows:Display") || !strcmp(Setting->Name, "iActorShadowCountExt:Display") || !strcmp(Setting->Name, "iActorShadowCountInt:Display") ) && !(TheSettingManager->SettingsMain.Main.DisableShadowManagement)) Setting->iValue = 0; else if (!strcmp(Setting->Name, "iMultiSample:Display") && Setting->iValue < 2 && TheSettingManager->SettingsMain.Main.ForceMSAA) Setting->iValue = 2; diff --git a/src/Oblivion/Hooks/Hooks.cpp b/src/Oblivion/Hooks/Hooks.cpp index fdae99040..64418d64c 100644 --- a/src/Oblivion/Hooks/Hooks.cpp +++ b/src/Oblivion/Hooks/Hooks.cpp @@ -134,8 +134,10 @@ void AttachHooks() { SafeWriteJump(Jumpers::HitEvent::Hook, (UInt32)HitEventHook); SafeWriteJump(Jumpers::NewAnimSequenceSingle::Hook, (UInt32)NewAnimSequenceSingleHook); SafeWriteJump(Jumpers::RemoveSequence::Hook, (UInt32)RemoveSequenceHook); - SafeWriteJump(Jumpers::Shadows::RenderShadowMapHook, (UInt32)RenderShadowMapHook); - SafeWriteJump(Jumpers::Shadows::AddCastShadowFlagHook, (UInt32)AddCastShadowFlagHook); + if (!SettingsMain->Main.DisableShadowManagement) { + SafeWriteJump(Jumpers::Shadows::RenderShadowMapHook, (UInt32)RenderShadowMapHook); + SafeWriteJump(Jumpers::Shadows::AddCastShadowFlagHook, (UInt32)AddCastShadowFlagHook); + } // SafeWriteJump(Jumpers::WaterHeightMap::Hook, (UInt32)WaterHeightMapHook); SafeWriteJump(Jumpers::EndProcess::Hook, (UInt32)EndProcessHook); diff --git a/src/core/SettingManager.cpp b/src/core/SettingManager.cpp index 6bc0b6b08..3545d54de 100644 --- a/src/core/SettingManager.cpp +++ b/src/core/SettingManager.cpp @@ -370,6 +370,7 @@ void SettingManager::LoadSettings() { SettingsMain.Main.ForceReflections = GetSettingI("Main.Main.Water", "ForceReflections"); SettingsMain.Main.MemoryHeapManagement = GetSettingI("Main.Main.Memory", "HeapManagement"); SettingsMain.Main.MemoryTextureManagement = GetSettingI("Main.Main.Memory", "TextureManagement"); + SettingsMain.Main.DisableShadowManagement = GetSettingI("Main.Main.Misc", "DisableShadowManagement"); SettingsMain.Main.AnisotropicFilter = GetSettingI("Main.Main.Misc", "AnisotropicFilter"); SettingsMain.Main.FarPlaneDistance = GetSettingF("Main.Main.Misc", "FarPlaneDistance"); SettingsMain.Main.ScreenshotKey = GetSettingI("Main.Main.Misc", "ScreenshotKey"); diff --git a/src/core/SettingManager.h b/src/core/SettingManager.h index 1a82f0043..509350214 100644 --- a/src/core/SettingManager.h +++ b/src/core/SettingManager.h @@ -13,6 +13,7 @@ struct SettingsMainStruct { bool RemovePrecipitations; bool MemoryHeapManagement; bool MemoryTextureManagement; + bool DisableShadowManagement; bool ReplaceIntro; bool SkipFog; bool RenderEffects;