diff --git a/data/plugins/GTAIV.EFLC.FusionFix.ini b/data/plugins/GTAIV.EFLC.FusionFix.ini index b7285cdf..9ec8b78f 100644 --- a/data/plugins/GTAIV.EFLC.FusionFix.ini +++ b/data/plugins/GTAIV.EFLC.FusionFix.ini @@ -47,6 +47,7 @@ TreeAlphaConsole = 4.0 CoronaReflectionIntensity = 1.0 // controls intensity of coronas in reflections ConsoleCarReflectionsAndDirt = 1 AlwaysDisplayHealthOnReticle = 1 +SmoothShorelines = 1 // improves water transparency [BudgetedIV] VehicleBudget = 0 // may cause issues, set to e.g. 260000000 to increase budget limit diff --git a/premake5.lua b/premake5.lua index 7dcb20c8..d720d4d7 100644 --- a/premake5.lua +++ b/premake5.lua @@ -21,8 +21,8 @@ workspace "GTAIV.EFLC.FusionFix" defines { "rsc_CompanyName=\"GTAIV.EFLC.FusionFix\"" } defines { "rsc_LegalCopyright=\"GTAIV.EFLC.FusionFix\""} defines { "rsc_InternalName=\"%{prj.name}\"", "rsc_ProductName=\"%{prj.name}\"", "rsc_OriginalFilename=\"%{prj.name}.dll\"" } - defines { "rsc_FileDescription=\"GTAIV.EFLC.FusionFix\"" } - defines { "rsc_UpdateUrl=\"https://github.com/ThirteenAG/GTAIV.EFLC.FusionFix\"" } + defines { "rsc_FileDescription=\"GTAIV.EFLC.FusionFix (GFWLMin ver.)\"" } + defines { "rsc_UpdateUrl=\"https://github.com/gillian-guide/GTAIV.EFLC.FusionFix-GFWLMin\"" } local major = 1 local minor = 0 diff --git a/source/fixes.ixx b/source/fixes.ixx index 7d17c0aa..f8eba032 100644 --- a/source/fixes.ixx +++ b/source/fixes.ixx @@ -382,11 +382,11 @@ public: } // Water Foam Height Weirdness - { - auto pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 83 EC 08 F3 0F 59 05"); - if (!pattern.empty()) - injector::MakeNOP(pattern.get_first(0), 8, true); - } + //{ + // auto pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 83 EC 08 F3 0F 59 05"); + // if (!pattern.empty()) + // injector::MakeNOP(pattern.get_first(0), 8, true); + //} // Render LOD lights during cutscenes (console behavior) { @@ -463,18 +463,6 @@ public: } } - // Enable the "first person" reticle (Annihilator, Buzzard) on gamepads as well, this used to be a keyboard & mouse feature only. - { - auto pattern = hook::pattern("85 F6 0F 84 ? ? ? ? 80 BE ? ? ? ? ? 0F 84 ? ? ? ? 85 C9 0F 84"); - if (!pattern.empty()) - injector::MakeNOP(pattern.get_first(0), 21, true); - else - { - pattern = hook::pattern("8B 4C 24 24 85 C9 0F 84 ? ? ? ? 80 B9 ? ? ? ? ? 0F 84"); - injector::MakeNOP(pattern.get_first(0), 25, true); - } - } - // Always display the ped health on the reticle with free-aim while on foot, used to be a gamepad + multiplayer only feature (PC is always free-aim unless it's melee combat). if (bAlwaysDisplayHealthOnReticle) { diff --git a/source/frameratevigilante.ixx b/source/frameratevigilante.ixx index b01c4312..a56f71cc 100644 --- a/source/frameratevigilante.ixx +++ b/source/frameratevigilante.ixx @@ -24,31 +24,27 @@ public: auto pattern = find_pattern("E8 ? ? ? ? D9 5C 24 7C F3 0F 10 4C 24", "E8 ? ? ? ? D9 5C 24 70 F3 0F 10 44 24 ? F3 0F 58 86"); hbsub_A18510.fun = injector::MakeCALL(pattern.get_first(0), sub_A18510).get(); - // By Sergeanur - pattern = hook::pattern("F3 0F 10 45 ? 51 8B CF F3 0F 11 04 24 E8 ? ? ? ? 8A 8F"); + pattern = hook::pattern("F3 0F 58 05 ? ? ? ? F3 0F 2A 0D"); if (!pattern.empty()) { - struct FramerateVigilanteHook1 + struct LoadingTextSparks { void operator()(injector::reg_pack& regs) { - float f = std::clamp(*(float*)(regs.ebp + 0x08), 1.0f / 150.0f, FLT_MAX); - *(float*)(regs.ebp + 0x08) = f; - regs.xmm0.f32[0] = f; + regs.xmm1.f32[0] += 0.085f * *CTimer::fTimeStep; } - }; injector::MakeInline(pattern.get_first(0)); + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } else { - pattern = hook::pattern("8B BE ? ? ? ? 33 C9 85 FF 7E 47 8A 5D 0C 33 D2 8D A4 24 ? ? ? ? 3B CF 7D 0A 8B 86 ? ? ? ? 03 C2 EB 02 33 C0 F6 80 ? ? ? ? ? 74 11 83 B8 ? ? ? ? ? 74 08 84 DB 0F 85 ? ? ? ? 83 C1 01 81 C2 ? ? ? ? 3B 8E ? ? ? ? 7C C5 D9 45 08 51 8B CE D9 1C 24 E8 ? ? ? ? 8A 86"); - struct FramerateVigilanteHook1 + pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 0F 5B C0 F3 0F 11 0D"); + struct LoadingTextSparks { void operator()(injector::reg_pack& regs) { - regs.edi = *(uint32_t*)(regs.esi + 0xFD4); - *(float*)(regs.ebp + 0x08) = std::clamp(*(float*)(regs.ebp + 0x08), 1.0f / 150.0f, FLT_MAX); + regs.xmm0.f32[0] += 0.085f * *CTimer::fTimeStep; } - }; injector::MakeInline(pattern.get_first(0), pattern.get_first(6)); + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } }; } diff --git a/source/modupdater.ixx b/source/modupdater.ixx index 391a7dc3..88358f30 100644 --- a/source/modupdater.ixx +++ b/source/modupdater.ixx @@ -32,7 +32,13 @@ public: { FusionFix::onInitEventAsync() += []() { - return; + if (FusionFixSettings.Get("PREF_UPDATE")) + Initialize(); + + FusionFixSettings.SetCallback("PREF_UPDATE", [](int32_t value) { + if (value) + Initialize(); + }); }; } } ModUpdater; \ No newline at end of file diff --git a/source/settings.ixx b/source/settings.ixx index 9b5161c9..66e8dc0e 100644 --- a/source/settings.ixx +++ b/source/settings.ixx @@ -422,7 +422,7 @@ public: enum eShadowFilterText { eRadio, eSequential, eShuffle, eSharp, eSoft, eCHSS }; - std::vector data = { "Radio", "Sequential", "Shuffle", "Sharp", "Soft", "CHSS",}; + std::vector data = { "Radio", "Sequential", "Shuffle", "Sharp", "Soft", "CHSS" }; } ShadowFilterText; struct @@ -430,7 +430,7 @@ public: enum eDofText { eAuto, e43, e54, e159, e169, eOff, eCutscenesOnly, eLow, eMedium, eHigh, eVeryHigh }; - std::vector data = { "Auto", "4:3", "5:4", "15:9", "16:9", "Off", "Cutscenes Only", "Low", "Medium", "High", "Very High"}; + std::vector data = { "Auto", "4:3", "5:4", "15:9", "16:9", "Off", "Cutscenes Only", "Low", "Medium", "High", "Very High" }; } DofText; struct diff --git a/source/shaders.ixx b/source/shaders.ixx index 84f90077..c4ae3916 100644 --- a/source/shaders.ixx +++ b/source/shaders.ixx @@ -68,6 +68,8 @@ public: static int nForceShadowFilter = 0; + static bool bSmoothShorelines = true; + FusionFix::onInitEvent() += []() { CIniReader iniReader(""); @@ -90,6 +92,7 @@ public: fShadowBiasBlendRange = std::clamp(iniReader.ReadFloat("SHADOWS", "ShadowBiasBlendRange", 0.3f), 0.0f, 1.0f); nForceShadowFilter = std::clamp(iniReader.ReadInteger("SHADOWS", "ForceShadowFilter", 0), 0, 2); bool bConsoleCarReflectionsAndDirt = iniReader.ReadInteger("MISC", "ConsoleCarReflectionsAndDirt", 1) != 0; + bSmoothShorelines = iniReader.ReadInteger("MISC", "SmoothShorelines", 1) != 0; // Redirect path to one unified folder auto pattern = hook::pattern("8B 04 8D ? ? ? ? A3 ? ? ? ? 8B 44 24 04"); @@ -310,7 +313,7 @@ public: static auto mblur = FusionFixSettings.GetRef("PREF_MOTIONBLUR"); static float arr3[4]; arr3[0] = (bFixAutoExposure ? 1.0f : 0.0f); - arr3[1] = 0.0f; + arr3[1] = (bSmoothShorelines ? 1.0f : 0.0f); arr3[2] = static_cast(gamma->get()); arr3[3] = static_cast(mblur->get()); pDevice->SetPixelShaderConstantF(222, &arr3[0], 1);