diff --git a/.Build/F4SE/Plugins/Addictol.toml b/.Build/F4SE/Plugins/Addictol.toml index d9eee5d..6192afa 100644 --- a/.Build/F4SE/Plugins/Addictol.toml +++ b/.Build/F4SE/Plugins/Addictol.toml @@ -171,9 +171,6 @@ bAltTabFullscreen = true # Fixes a CTD when scrapping or wiring after a settlement mod has been removed, by cleaning up orphan power-grid entries left behind by deleted references. bPowerGridScrap = true -# Fixes animated statics (fans, signs, generators) that stop animating after save/load until cell unload+reload. -bAnimatedStaticReload = true - # Fixes wrong specular lighting on the first-person viewmodel caused by the eye-position vector missing the engine's per-frame light offset. bViewmodelShading = true diff --git a/Addictol/Include/Modules/AdModuleAnimatedStaticReload.h b/Addictol/Include/Modules/AdModuleAnimatedStaticReload.h deleted file mode 100644 index cefaaab..0000000 --- a/Addictol/Include/Modules/AdModuleAnimatedStaticReload.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include - -namespace Addictol -{ - class ModuleAnimatedStaticReload : - public Module - { - public: - ModuleAnimatedStaticReload(); - virtual ~ModuleAnimatedStaticReload() = default; - - [[nodiscard]] virtual bool DoQuery() const noexcept override; - [[nodiscard]] virtual bool DoInstall([[maybe_unused]] F4SE::MessagingInterface::Message* a_msg = nullptr) noexcept override; - [[nodiscard]] virtual bool DoListener([[maybe_unused]] F4SE::MessagingInterface::Message* a_msg = nullptr) noexcept override; - [[nodiscard]] virtual bool DoPapyrusListener([[maybe_unused]] RE::BSScript::IVirtualMachine* a_vm) noexcept override; - }; -} diff --git a/Addictol/Source/AdConfigValidation.cpp b/Addictol/Source/AdConfigValidation.cpp index c6d60c8..520c95c 100644 --- a/Addictol/Source/AdConfigValidation.cpp +++ b/Addictol/Source/AdConfigValidation.cpp @@ -31,7 +31,7 @@ namespace Addictol "bCombatMusic", "bWorkbenchSound", "bActorCauseSaveBloat", "bAnimSignedCrash", "bBethesdaNetCrash", "bMuzzleFlashLight", "bAltTabFullscreen", "bPowerGridScrap", - "bAnimatedStaticReload", "bViewmodelShading", "bDofFix", + "bViewmodelShading", "bDofFix", "bUtilityShader", "bPipBoyCursorConstraints" }}, { "Warnings", { diff --git a/Addictol/Source/AdRegisterModules.cpp b/Addictol/Source/AdRegisterModules.cpp index 5fa7079..2dd8278 100644 --- a/Addictol/Source/AdRegisterModules.cpp +++ b/Addictol/Source/AdRegisterModules.cpp @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -122,7 +121,6 @@ static auto sModuleHighResBloom = std::make_shared(); static auto sModulePowerGridScrap = std::make_shared(); static auto sModuleDpiScaling = std::make_shared(); -static auto sModuleAnimatedStaticReload = std::make_shared(); static auto sModuleViewmodelShading = std::make_shared(); static auto sModuleDofFix = std::make_shared(); static auto sModuleUtilityShader = std::make_shared(); @@ -201,7 +199,6 @@ void AdRegisterModules() modules.Register(sModuleHighResBloom); modules.Register(sModuleAltTabFullscreen); modules.Register(sModulePowerGridScrap); - modules.Register(sModuleAnimatedStaticReload); modules.Register(sModuleViewmodelShading); modules.Register(sModuleDofFix); modules.Register(sModuleReferenceHandleLimitWarning); diff --git a/Addictol/Source/Modules/AdModuleAnimatedStaticReload.cpp b/Addictol/Source/Modules/AdModuleAnimatedStaticReload.cpp deleted file mode 100644 index 064b5fa..0000000 --- a/Addictol/Source/Modules/AdModuleAnimatedStaticReload.cpp +++ /dev/null @@ -1,118 +0,0 @@ -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace Addictol -{ - static REX::TOML::Bool<> bFixesAnimatedStaticReload{ "Fixes"sv, "bAnimatedStaticReload"sv, true }; - - namespace animatedStaticReloadDetail - { - // NiTimeController::CycleType isn't exposed by commonlibf4; mirror the NetImmerse enum order. - enum CycleType : std::uint32_t - { - kLoop = 0, - kReverse = 1, - kClamp = 2, - }; - - static constexpr std::uint32_t kVfuncIndex = 0x9D; - - using TShouldSave = bool(__fastcall*)(const RE::TESObjectREFR*); - static TShouldSave OriginalShouldSave = nullptr; - - [[nodiscard]] static CycleType GetCycleType(const RE::NiControllerSequence* a_seq) noexcept - { - return *reinterpret_cast(a_seq->cycleType); - } - - // activeSequences gets stomped by the anim thread every frame. Walk sequenceArray instead. - [[nodiscard]] static bool HasLoopingSequence(const RE::NiAVObject* a_root) noexcept - { - if (!a_root) - return false; - auto* mgr = RE::NiControllerManager::GetNiControllerManager(a_root); - if (!mgr) - return false; - const auto count = mgr->sequenceArray.size(); - const auto capacity = mgr->sequenceArray.capacity(); - if (count == 0 || count > capacity || capacity > 1024 || !mgr->sequenceArray.data()) - return false; - for (std::uint32_t i = 0; i < count; ++i) { - const auto* raw = mgr->sequenceArray[i].get(); - if (!raw) - continue; - if (raw->state == RE::NiControllerSequence::AnimState::kAnimating && - GetCycleType(raw) == kLoop) - return true; - } - return false; - } - - static bool DoCheck(const RE::TESObjectREFR* a_ref) noexcept - { - const auto* base = a_ref->GetObjectReference(); - if (!base || !base->As()) - return false; - return HasLoopingSequence(a_ref->Get3D()); - } - - // DoCheck has GFx/Ni locals, so the __try has to live up here (C2712). - static bool SafeCheck(const RE::TESObjectREFR* a_ref) noexcept - { - __try { - return DoCheck(a_ref); - } - __except (1) { - return false; - } - } - - static bool __fastcall HookShouldSaveAnimationOnSaving(const RE::TESObjectREFR* a_ref) noexcept - { - const bool original = OriginalShouldSave ? OriginalShouldSave(a_ref) : false; - if (original || !a_ref) - return original; - - return SafeCheck(a_ref); - } - } - - ModuleAnimatedStaticReload::ModuleAnimatedStaticReload() : - Module("Animated Static Reload", &bFixesAnimatedStaticReload) - {} - - bool ModuleAnimatedStaticReload::DoQuery() const noexcept - { - return true; - } - - bool ModuleAnimatedStaticReload::DoInstall([[maybe_unused]] F4SE::MessagingInterface::Message* a_msg) noexcept - { - using namespace animatedStaticReloadDetail; - - // Index 0 is the primary vtable; entries 1-7 are short sub-object vtables that have no method at slot 0x9D. - const auto vtable = RE::VTABLE::TESObjectREFR[0].address(); - *reinterpret_cast(&OriginalShouldSave) = - RELEX::DetourVTable(vtable, reinterpret_cast(&HookShouldSaveAnimationOnSaving), kVfuncIndex); - - return OriginalShouldSave != nullptr; - } - - bool ModuleAnimatedStaticReload::DoListener([[maybe_unused]] F4SE::MessagingInterface::Message* a_msg) noexcept - { - return true; - } - - bool ModuleAnimatedStaticReload::DoPapyrusListener([[maybe_unused]] RE::BSScript::IVirtualMachine* a_vm) noexcept - { - return true; - } -} diff --git a/VC/Addictol.vcxproj b/VC/Addictol.vcxproj index cdf515f..8f2206a 100644 --- a/VC/Addictol.vcxproj +++ b/VC/Addictol.vcxproj @@ -27,7 +27,6 @@ - @@ -107,7 +106,6 @@ - diff --git a/VC/Addictol.vcxproj.filters b/VC/Addictol.vcxproj.filters index 0b25f23..fac1f0f 100644 --- a/VC/Addictol.vcxproj.filters +++ b/VC/Addictol.vcxproj.filters @@ -229,9 +229,6 @@ Source\Modules - - Source\Modules - Source\Modules @@ -466,9 +463,6 @@ Include\Modules - - Include\Modules - Include\Modules diff --git a/Version/build_version.txt b/Version/build_version.txt index a0f28c6..c360dfb 100644 Binary files a/Version/build_version.txt and b/Version/build_version.txt differ diff --git a/Version/resource_version2.h b/Version/resource_version2.h index 4bea23c..1a9dab8 100644 Binary files a/Version/resource_version2.h and b/Version/resource_version2.h differ