From bd9cb721d5bbfef5a74e10dd677afb8fed584f5c Mon Sep 17 00:00:00 2001 From: FlayaN Date: Sun, 27 Oct 2024 11:13:47 +0100 Subject: [PATCH] perf: make more relocations static --- include/RE/A/ActorValueList.h | 2 +- include/RE/A/AnimationFileManagerSingleton.h | 2 +- include/RE/A/AnimationObjects.h | 2 +- include/RE/B/BGSAddToPlayerInventoryEvent.h | 2 +- include/RE/B/BGSDecalManager.h | 2 +- include/RE/B/BGSGrassManager.h | 2 +- include/RE/B/BGSImpactManager.h | 2 +- include/RE/B/BGSSaveLoadGame.h | 2 +- include/RE/B/BSFaceGenManager.h | 2 +- include/RE/B/BSMusicManager.h | 2 +- include/RE/B/BSPointerHandleManager.h | 2 +- include/RE/B/BSShaderManager.h | 2 +- include/RE/B/BSTimer.h | 6 +++--- include/RE/B/BSTreeManager.h | 2 +- include/RE/B/BSUtilityShader.h | 2 +- include/RE/B/bhkCollisionFilter.h | 2 +- include/RE/B/bhkTelekinesisListener.h | 2 +- include/RE/B/bhkWorld.h | 4 ++-- include/RE/C/CombatManager.h | 2 +- include/RE/C/CrosshairPickData.h | 2 +- include/RE/F/FOCollisionListener.h | 2 +- include/RE/F/FORM_ENUM_STRING.h | 2 +- include/RE/G/GarbageCollector.h | 2 +- include/RE/H/hkContainerAllocators.h | 2 +- include/RE/I/ImageSpaceManager.h | 2 +- include/RE/M/MenuTopicManager.h | 2 +- include/RE/M/MistMenu.h | 2 +- include/RE/N/NiRTTI.h | 2 +- include/RE/P/Precipitation.h | 2 +- include/RE/R/RenderTargetManager.h | 2 +- include/RE/R/ReticuleController.h | 2 +- include/RE/RTTI.h | 4 ++-- include/RE/S/ScreenSplatter.h | 2 +- include/RE/S/State.h | 2 +- include/RE/S/SubtitleManager.h | 2 +- include/RE/T/TESForm.h | 8 ++++---- include/RE/T/TESWaterSystem.h | 2 +- include/RE/T/TLSData.h | 4 ++-- include/RE/V/VATS.h | 2 +- src/RE/A/Actor.cpp | 4 ++-- src/RE/A/ActorEquipManager.cpp | 2 +- src/RE/B/BGSCreatedObjectManager.cpp | 2 +- src/RE/B/BGSFootstepManager.cpp | 2 +- src/RE/B/BGSSaveLoadManager.cpp | 6 +++--- src/RE/B/BGSStoryTeller.cpp | 2 +- src/RE/B/BSDirectInputManager.cpp | 2 +- src/RE/B/BSInputDeviceManager.cpp | 2 +- src/RE/B/BSInputEventQueue.cpp | 2 +- src/RE/B/BSResponse.cpp | 2 +- src/RE/B/BSScaleformManager.cpp | 10 +++++----- src/RE/B/BarterMenu.cpp | 2 +- src/RE/B/BookMenu.cpp | 4 ++-- src/RE/C/Calendar.cpp | 4 ++-- src/RE/C/CommandTable.cpp | 4 ++-- src/RE/C/Console.cpp | 2 +- src/RE/C/ConsoleLog.cpp | 2 +- src/RE/C/ContainerMenu.cpp | 4 ++-- src/RE/C/ControlMap.cpp | 2 +- src/RE/G/GMemory.cpp | 2 +- src/RE/G/GameSettingCollection.cpp | 2 +- src/RE/G/GiftMenu.cpp | 2 +- src/RE/I/IFormFactory.cpp | 4 ++-- src/RE/I/IHandlerFunctor.cpp | 2 +- src/RE/I/INIPrefSettingCollection.cpp | 2 +- src/RE/I/INISettingCollection.cpp | 2 +- src/RE/I/InterfaceStrings.cpp | 2 +- src/RE/I/Inventory3DManager.cpp | 2 +- src/RE/L/LockpickingMenu.cpp | 2 +- src/RE/M/MagicFavorites.cpp | 2 +- src/RE/M/Main.cpp | 6 +++--- src/RE/M/MenuControls.cpp | 4 ++-- src/RE/M/MenuCursor.cpp | 2 +- src/RE/M/Misc.cpp | 4 ++-- src/RE/N/NiMemManager.cpp | 2 +- src/RE/N/NiObject.cpp | 2 +- src/RE/N/NiTimeController.cpp | 2 +- src/RE/P/PlayerCamera.cpp | 2 +- src/RE/P/PlayerCharacter.cpp | 4 ++-- src/RE/P/PlayerControls.cpp | 2 +- src/RE/P/ProcessLists.cpp | 2 +- src/RE/P/Projectile.cpp | 2 +- src/RE/R/Renderer.cpp | 8 ++++---- src/RE/S/SkyrimVM.cpp | 2 +- src/RE/T/TES.cpp | 2 +- src/RE/T/TESDataHandler.cpp | 2 +- src/RE/T/TESObjectREFR.cpp | 2 +- src/RE/T/TaskQueueInterface.cpp | 2 +- src/RE/U/UI.cpp | 2 +- src/RE/U/UI3DSceneManager.cpp | 2 +- src/RE/U/UIBlurManager.cpp | 2 +- src/RE/U/UIMessageQueue.cpp | 2 +- src/RE/U/UserEvents.cpp | 2 +- 92 files changed, 120 insertions(+), 120 deletions(-) diff --git a/include/RE/A/ActorValueList.h b/include/RE/A/ActorValueList.h index c8cd07c3f..0590f2c56 100644 --- a/include/RE/A/ActorValueList.h +++ b/include/RE/A/ActorValueList.h @@ -10,7 +10,7 @@ namespace RE public: [[nodiscard]] static ActorValueList* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514139, 400267) }; + static REL::Relocation singleton{ RELOCATION_ID(514139, 400267) }; return *singleton; } diff --git a/include/RE/A/AnimationFileManagerSingleton.h b/include/RE/A/AnimationFileManagerSingleton.h index a2fc71a7f..1fab59039 100644 --- a/include/RE/A/AnimationFileManagerSingleton.h +++ b/include/RE/A/AnimationFileManagerSingleton.h @@ -52,7 +52,7 @@ namespace RE [[nodiscard]] static AnimationFileManagerSingleton* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(520994, 407512) }; + static REL::Relocation singleton{ RELOCATION_ID(520994, 407512) }; return *singleton; } diff --git a/include/RE/A/AnimationObjects.h b/include/RE/A/AnimationObjects.h index 562d42b7f..cc0da7fce 100644 --- a/include/RE/A/AnimationObjects.h +++ b/include/RE/A/AnimationObjects.h @@ -32,7 +32,7 @@ namespace RE public: [[nodiscard]] static AnimationObjects* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514179, 400328) }; + static REL::Relocation singleton{ RELOCATION_ID(514179, 400328) }; return *singleton; } diff --git a/include/RE/B/BGSAddToPlayerInventoryEvent.h b/include/RE/B/BGSAddToPlayerInventoryEvent.h index 6e2a29a92..b06915096 100644 --- a/include/RE/B/BGSAddToPlayerInventoryEvent.h +++ b/include/RE/B/BGSAddToPlayerInventoryEvent.h @@ -23,7 +23,7 @@ namespace RE public: [[nodiscard]] static std::uint32_t& GetIndex() { - REL::Relocation index{ RELOCATION_ID(508412, 380074) }; + static REL::Relocation index{ RELOCATION_ID(508412, 380074) }; return *index; } diff --git a/include/RE/B/BGSDecalManager.h b/include/RE/B/BGSDecalManager.h index 2518093e8..df7aae609 100644 --- a/include/RE/B/BGSDecalManager.h +++ b/include/RE/B/BGSDecalManager.h @@ -16,7 +16,7 @@ namespace RE public: static BGSDecalManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514414, 400561) }; + static REL::Relocation singleton{ RELOCATION_ID(514414, 400561) }; return *singleton; } diff --git a/include/RE/B/BGSGrassManager.h b/include/RE/B/BGSGrassManager.h index 601b4c83b..aa2b354ee 100644 --- a/include/RE/B/BGSGrassManager.h +++ b/include/RE/B/BGSGrassManager.h @@ -14,7 +14,7 @@ namespace RE public: static BGSGrassManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514292, 400452) }; + static REL::Relocation singleton{ RELOCATION_ID(514292, 400452) }; return *singleton; } diff --git a/include/RE/B/BGSImpactManager.h b/include/RE/B/BGSImpactManager.h index 4b72a90c7..651cb54af 100644 --- a/include/RE/B/BGSImpactManager.h +++ b/include/RE/B/BGSImpactManager.h @@ -49,7 +49,7 @@ namespace RE static BGSImpactManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(515123, 401262) }; + static REL::Relocation singleton{ RELOCATION_ID(515123, 401262) }; return *singleton; } diff --git a/include/RE/B/BGSSaveLoadGame.h b/include/RE/B/BGSSaveLoadGame.h index 911f8afc2..b5e031a75 100644 --- a/include/RE/B/BGSSaveLoadGame.h +++ b/include/RE/B/BGSSaveLoadGame.h @@ -68,7 +68,7 @@ namespace RE static BGSSaveLoadGame* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(516851, 403330) }; + static REL::Relocation singleton{ RELOCATION_ID(516851, 403330) }; return *singleton; } diff --git a/include/RE/B/BSFaceGenManager.h b/include/RE/B/BSFaceGenManager.h index 13cac4877..7eff523ba 100644 --- a/include/RE/B/BSFaceGenManager.h +++ b/include/RE/B/BSFaceGenManager.h @@ -37,7 +37,7 @@ namespace RE public: [[nodiscard]] static BSFaceGenManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514182, 400331) }; + static REL::Relocation singleton{ RELOCATION_ID(514182, 400331) }; return *singleton; } diff --git a/include/RE/B/BSMusicManager.h b/include/RE/B/BSMusicManager.h index 23ac71a0f..759fc870a 100644 --- a/include/RE/B/BSMusicManager.h +++ b/include/RE/B/BSMusicManager.h @@ -24,7 +24,7 @@ namespace RE [[nodiscard]] static BSMusicManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514738, 400896) }; + static REL::Relocation singleton{ RELOCATION_ID(514738, 400896) }; return *singleton; } diff --git a/include/RE/B/BSPointerHandleManager.h b/include/RE/B/BSPointerHandleManager.h index 417da9c68..f751ba9cf 100644 --- a/include/RE/B/BSPointerHandleManager.h +++ b/include/RE/B/BSPointerHandleManager.h @@ -27,7 +27,7 @@ namespace RE [[nodiscard]] static auto GetHandleEntries() { - REL::Relocation entries{ RELOCATION_ID(514478, 400622) }; + static REL::Relocation entries{ RELOCATION_ID(514478, 400622) }; return std::span{ *entries }; } }; diff --git a/include/RE/B/BSShaderManager.h b/include/RE/B/BSShaderManager.h index 18be872e2..554dfdd12 100644 --- a/include/RE/B/BSShaderManager.h +++ b/include/RE/B/BSShaderManager.h @@ -29,7 +29,7 @@ namespace RE public: static BSShaderManager::State& GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(513211, 390951) }; + static REL::Relocation singleton{ RELOCATION_ID(513211, 390951) }; return *singleton; } diff --git a/include/RE/B/BSTimer.h b/include/RE/B/BSTimer.h index 2aaaf9b8b..95cca638b 100644 --- a/include/RE/B/BSTimer.h +++ b/include/RE/B/BSTimer.h @@ -7,19 +7,19 @@ namespace RE public: [[nodiscard]] static BSTimer* GetSingleton() noexcept { - REL::Relocation singleton{ RELOCATION_ID(523657, 410196) }; + static REL::Relocation singleton{ RELOCATION_ID(523657, 410196) }; return singleton.get(); } static float QGlobalTimeMultiplier() { - REL::Relocation value{ RELOCATION_ID(511882, 388442) }; + static REL::Relocation value{ RELOCATION_ID(511882, 388442) }; return *value; } static float QGlobalTimeMultiplierTarget() { - REL::Relocation value{ RELOCATION_ID(511883, 388443) }; + static REL::Relocation value{ RELOCATION_ID(511883, 388443) }; return *value; } diff --git a/include/RE/B/BSTreeManager.h b/include/RE/B/BSTreeManager.h index 542bb3df3..b6dccbf70 100644 --- a/include/RE/B/BSTreeManager.h +++ b/include/RE/B/BSTreeManager.h @@ -30,7 +30,7 @@ namespace RE static BSTreeManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514181, 400330) }; + static REL::Relocation singleton{ RELOCATION_ID(514181, 400330) }; return *singleton; } diff --git a/include/RE/B/BSUtilityShader.h b/include/RE/B/BSUtilityShader.h index ca7fe3cc6..b5f370c98 100644 --- a/include/RE/B/BSUtilityShader.h +++ b/include/RE/B/BSUtilityShader.h @@ -47,7 +47,7 @@ namespace RE static BSUtilityShader* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(528354, 415300) }; + static REL::Relocation singleton{ RELOCATION_ID(528354, 415300) }; return *singleton; } ~BSUtilityShader() override; // 00 diff --git a/include/RE/B/bhkCollisionFilter.h b/include/RE/B/bhkCollisionFilter.h index eb2824ca1..36b05e1e3 100644 --- a/include/RE/B/bhkCollisionFilter.h +++ b/include/RE/B/bhkCollisionFilter.h @@ -14,7 +14,7 @@ namespace RE [[nodiscard]] static bhkCollisionFilter* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514415, 400562) }; + static REL::Relocation singleton{ RELOCATION_ID(514415, 400562) }; return *singleton; } diff --git a/include/RE/B/bhkTelekinesisListener.h b/include/RE/B/bhkTelekinesisListener.h index d7ac951a0..c52c8e672 100644 --- a/include/RE/B/bhkTelekinesisListener.h +++ b/include/RE/B/bhkTelekinesisListener.h @@ -20,7 +20,7 @@ namespace RE static bhkTelekinesisListener* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(515445, 401584) }; + static REL::Relocation singleton{ RELOCATION_ID(515445, 401584) }; return *singleton; } }; diff --git a/include/RE/B/bhkWorld.h b/include/RE/B/bhkWorld.h index 63b6bb685..bf4bca39c 100644 --- a/include/RE/B/bhkWorld.h +++ b/include/RE/B/bhkWorld.h @@ -41,13 +41,13 @@ namespace RE static float GetWorldScale() { - REL::Relocation worldScale{ RELOCATION_ID(231896, 188105) }; + static REL::Relocation worldScale{ RELOCATION_ID(231896, 188105) }; return *worldScale; } static float GetWorldScaleInverse() { - REL::Relocation worldScaleInverse{ RELOCATION_ID(230692, 187407) }; + static REL::Relocation worldScaleInverse{ RELOCATION_ID(230692, 187407) }; return *worldScaleInverse; } diff --git a/include/RE/C/CombatManager.h b/include/RE/C/CombatManager.h index 3d23823a8..38c5acbd9 100644 --- a/include/RE/C/CombatManager.h +++ b/include/RE/C/CombatManager.h @@ -26,7 +26,7 @@ namespace RE public: [[nodiscard]] static CombatManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(518706, 405246) }; + static REL::Relocation singleton{ RELOCATION_ID(518706, 405246) }; return *singleton; } diff --git a/include/RE/C/CrosshairPickData.h b/include/RE/C/CrosshairPickData.h index c177975e8..1af3ac4e2 100644 --- a/include/RE/C/CrosshairPickData.h +++ b/include/RE/C/CrosshairPickData.h @@ -14,7 +14,7 @@ namespace RE public: static CrosshairPickData* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(515446, 401585) }; + static REL::Relocation singleton{ RELOCATION_ID(515446, 401585) }; return *singleton; } diff --git a/include/RE/F/FOCollisionListener.h b/include/RE/F/FOCollisionListener.h index 8813552b2..a71382450 100644 --- a/include/RE/F/FOCollisionListener.h +++ b/include/RE/F/FOCollisionListener.h @@ -36,7 +36,7 @@ namespace RE static FOCollisionListener* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514284, 400444) }; + static REL::Relocation singleton{ RELOCATION_ID(514284, 400444) }; return *singleton; } diff --git a/include/RE/F/FORM_ENUM_STRING.h b/include/RE/F/FORM_ENUM_STRING.h index 996639d81..5a238cd5b 100644 --- a/include/RE/F/FORM_ENUM_STRING.h +++ b/include/RE/F/FORM_ENUM_STRING.h @@ -9,7 +9,7 @@ namespace RE public: [[nodiscard]] static std::span GetFormEnumString() { - REL::Relocation formEnumString{ RELOCATION_ID(501008, 359120) }; + static REL::Relocation formEnumString{ RELOCATION_ID(501008, 359120) }; return { *formEnumString }; } diff --git a/include/RE/G/GarbageCollector.h b/include/RE/G/GarbageCollector.h index 7e327f62b..d929f1540 100644 --- a/include/RE/G/GarbageCollector.h +++ b/include/RE/G/GarbageCollector.h @@ -52,7 +52,7 @@ namespace RE static GarbageCollector* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514180, 400329) }; + static REL::Relocation singleton{ RELOCATION_ID(514180, 400329) }; return *singleton; } diff --git a/include/RE/H/hkContainerAllocators.h b/include/RE/H/hkContainerAllocators.h index 570219679..ea56ebe76 100644 --- a/include/RE/H/hkContainerAllocators.h +++ b/include/RE/H/hkContainerAllocators.h @@ -24,7 +24,7 @@ namespace RE [[nodiscard]] static Allocator* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(510713, 383828) }; + static REL::Relocation singleton{ RELOCATION_ID(510713, 383828) }; return singleton.get(); } }; diff --git a/include/RE/I/ImageSpaceManager.h b/include/RE/I/ImageSpaceManager.h index 173dad27a..46a26d3bd 100644 --- a/include/RE/I/ImageSpaceManager.h +++ b/include/RE/I/ImageSpaceManager.h @@ -179,7 +179,7 @@ namespace RE static ImageSpaceManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(527731, 414660) }; + static REL::Relocation singleton{ RELOCATION_ID(527731, 414660) }; return *singleton; } diff --git a/include/RE/M/MenuTopicManager.h b/include/RE/M/MenuTopicManager.h index 6a1e87248..45a0ff21d 100644 --- a/include/RE/M/MenuTopicManager.h +++ b/include/RE/M/MenuTopicManager.h @@ -61,7 +61,7 @@ namespace RE static MenuTopicManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514959, 401099) }; + static REL::Relocation singleton{ RELOCATION_ID(514959, 401099) }; return *singleton; } diff --git a/include/RE/M/MistMenu.h b/include/RE/M/MistMenu.h index 843b89f35..71459249b 100644 --- a/include/RE/M/MistMenu.h +++ b/include/RE/M/MistMenu.h @@ -60,7 +60,7 @@ namespace RE static MistMenu* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(519827, 406370) }; + static REL::Relocation singleton{ RELOCATION_ID(519827, 406370) }; return *singleton; } diff --git a/include/RE/N/NiRTTI.h b/include/RE/N/NiRTTI.h index 08e693668..cba9daa2b 100644 --- a/include/RE/N/NiRTTI.h +++ b/include/RE/N/NiRTTI.h @@ -100,7 +100,7 @@ To netimmerse_cast(const From* a_from) return nullptr; } - REL::Relocation to{ RE::Ni_Impl::remove_cvpr_t::Ni_RTTI }; + static REL::Relocation to{ RE::Ni_Impl::remove_cvpr_t::Ni_RTTI }; const RE::NiRTTI* toRTTI = to.get(); const RE::NiRTTI* fromRTTI = a_from->GetRTTI(); diff --git a/include/RE/P/Precipitation.h b/include/RE/P/Precipitation.h index 1aa5e2814..8402fd461 100644 --- a/include/RE/P/Precipitation.h +++ b/include/RE/P/Precipitation.h @@ -35,7 +35,7 @@ namespace RE static NiPoint3 GetDirection() { - REL::Relocation precipDirection{ RELOCATION_ID(515509, 401648) }; + static REL::Relocation precipDirection{ RELOCATION_ID(515509, 401648) }; return *precipDirection; } diff --git a/include/RE/R/RenderTargetManager.h b/include/RE/R/RenderTargetManager.h index 1ccfd9bb5..165972201 100644 --- a/include/RE/R/RenderTargetManager.h +++ b/include/RE/R/RenderTargetManager.h @@ -12,7 +12,7 @@ namespace RE public: [[nodiscard]] static RenderTargetManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(524970, 411451) }; + static REL::Relocation singleton{ RELOCATION_ID(524970, 411451) }; return *singleton; } diff --git a/include/RE/R/ReticuleController.h b/include/RE/R/ReticuleController.h index fadb0ea19..1c127e0fd 100644 --- a/include/RE/R/ReticuleController.h +++ b/include/RE/R/ReticuleController.h @@ -10,7 +10,7 @@ namespace RE public: static ReticuleController& GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(508607, 380335) }; + static REL::Relocation singleton{ RELOCATION_ID(508607, 380335) }; return *singleton; } diff --git a/include/RE/RTTI.h b/include/RE/RTTI.h index 13fde40fd..e6c97c554 100644 --- a/include/RE/RTTI.h +++ b/include/RE/RTTI.h @@ -225,8 +225,8 @@ template < int> = 0> To skyrim_cast(From* a_from) { - REL::Relocation from{ RE::detail::remove_cvpr_t::RTTI }; - REL::Relocation to{ RE::detail::remove_cvpr_t::RTTI }; + static REL::Relocation from{ RE::detail::remove_cvpr_t::RTTI }; + static REL::Relocation to{ RE::detail::remove_cvpr_t::RTTI }; return static_cast( RE::RTDynamicCast( const_cast( diff --git a/include/RE/S/ScreenSplatter.h b/include/RE/S/ScreenSplatter.h index 7662c1736..b5160b582 100644 --- a/include/RE/S/ScreenSplatter.h +++ b/include/RE/S/ScreenSplatter.h @@ -15,7 +15,7 @@ namespace RE public: static ScreenSplatter* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514512, 400672) }; + static REL::Relocation singleton{ RELOCATION_ID(514512, 400672) }; return *singleton; } diff --git a/include/RE/S/State.h b/include/RE/S/State.h index f59ad8aa1..78c9423b1 100644 --- a/include/RE/S/State.h +++ b/include/RE/S/State.h @@ -13,7 +13,7 @@ namespace RE public: [[nodiscard]] static State* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(524998, 411479) }; + static REL::Relocation singleton{ RELOCATION_ID(524998, 411479) }; return singleton.get(); } diff --git a/include/RE/S/SubtitleManager.h b/include/RE/S/SubtitleManager.h index 91003a506..6eeb4c953 100644 --- a/include/RE/S/SubtitleManager.h +++ b/include/RE/S/SubtitleManager.h @@ -23,7 +23,7 @@ namespace RE public: static SubtitleManager* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514283, 400443) }; + static REL::Relocation singleton{ RELOCATION_ID(514283, 400443) }; return *singleton; } diff --git a/include/RE/T/TESForm.h b/include/RE/T/TESForm.h index 21ef1a782..e4bd83cd6 100644 --- a/include/RE/T/TESForm.h +++ b/include/RE/T/TESForm.h @@ -193,8 +193,8 @@ namespace RE BSTHashMap*, std::reference_wrapper> { - REL::Relocation**> allForms{ RELOCATION_ID(514351, 400507) }; - REL::Relocation allFormsMapLock{ RELOCATION_ID(514360, 400517) }; + static REL::Relocation**> allForms{ RELOCATION_ID(514351, 400507) }; + static REL::Relocation allFormsMapLock{ RELOCATION_ID(514360, 400517) }; return { *allForms, std::ref(*allFormsMapLock) }; } @@ -203,8 +203,8 @@ namespace RE BSTHashMap*, std::reference_wrapper> { - REL::Relocation**> allFormsByEditorID{ RELOCATION_ID(514352, 400509) }; - REL::Relocation allFormsEditorIDMapLock{ RELOCATION_ID(514361, 400518) }; + static REL::Relocation**> allFormsByEditorID{ RELOCATION_ID(514352, 400509) }; + static REL::Relocation allFormsEditorIDMapLock{ RELOCATION_ID(514361, 400518) }; return { *allFormsByEditorID, std::ref(*allFormsEditorIDMapLock) }; } diff --git a/include/RE/T/TESWaterSystem.h b/include/RE/T/TESWaterSystem.h index d93288d62..1c76cd227 100644 --- a/include/RE/T/TESWaterSystem.h +++ b/include/RE/T/TESWaterSystem.h @@ -28,7 +28,7 @@ namespace RE public: [[nodiscard]] static TESWaterSystem* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514290, 400450) }; + static REL::Relocation singleton{ RELOCATION_ID(514290, 400450) }; return *singleton; } diff --git a/include/RE/T/TLSData.h b/include/RE/T/TLSData.h index 0b5748e3a..99801ae88 100644 --- a/include/RE/T/TLSData.h +++ b/include/RE/T/TLSData.h @@ -25,8 +25,8 @@ namespace RE inline static TLSData* GetStaticTLSData() { - REL::Relocation tlsIndex{ Offset::TlsIndex }; - auto tlsDataArray = reinterpret_cast(__readgsqword(0x58)); + static REL::Relocation tlsIndex{ Offset::TlsIndex }; + auto tlsDataArray = reinterpret_cast(__readgsqword(0x58)); return tlsDataArray[*tlsIndex]; } } diff --git a/include/RE/V/VATS.h b/include/RE/V/VATS.h index ed758a77b..36c7bd2dc 100644 --- a/include/RE/V/VATS.h +++ b/include/RE/V/VATS.h @@ -47,7 +47,7 @@ namespace RE [[nodiscard]] static VATS* GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514725, 400883) }; + static REL::Relocation singleton{ RELOCATION_ID(514725, 400883) }; return *singleton; } diff --git a/src/RE/A/Actor.cpp b/src/RE/A/Actor.cpp index 9e8499a9e..f18584f38 100644 --- a/src/RE/A/Actor.cpp +++ b/src/RE/A/Actor.cpp @@ -438,7 +438,7 @@ namespace RE FIGHT_REACTION Actor::GetFactionReaction(Actor* a_other) const { using func_t = decltype(&Actor::GetFactionReaction); - REL::Relocation func{ RELOCATION_ID(36658, 37666) }; + static REL::Relocation func{ RELOCATION_ID(36658, 37666) }; return func(this, a_other); } @@ -800,7 +800,7 @@ namespace RE bool Actor::IsCombatTarget(Actor* a_other) const { using func_t = decltype(&Actor::IsCombatTarget); - REL::Relocation func{ RELOCATION_ID(37618, 38571) }; + static REL::Relocation func{ RELOCATION_ID(37618, 38571) }; return func(this, a_other); } diff --git a/src/RE/A/ActorEquipManager.cpp b/src/RE/A/ActorEquipManager.cpp index 16edd79f0..b77acff68 100644 --- a/src/RE/A/ActorEquipManager.cpp +++ b/src/RE/A/ActorEquipManager.cpp @@ -4,7 +4,7 @@ namespace RE { ActorEquipManager* ActorEquipManager::GetSingleton() { - REL::Relocation singleton{ Offset::ActorEquipManager::Singleton }; + static REL::Relocation singleton{ Offset::ActorEquipManager::Singleton }; return *singleton; } diff --git a/src/RE/B/BGSCreatedObjectManager.cpp b/src/RE/B/BGSCreatedObjectManager.cpp index 2ba829a13..a8b196a68 100644 --- a/src/RE/B/BGSCreatedObjectManager.cpp +++ b/src/RE/B/BGSCreatedObjectManager.cpp @@ -4,7 +4,7 @@ namespace RE { BGSCreatedObjectManager* BGSCreatedObjectManager::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514172, 400320) }; + static REL::Relocation singleton{ RELOCATION_ID(514172, 400320) }; return *singleton; } diff --git a/src/RE/B/BGSFootstepManager.cpp b/src/RE/B/BGSFootstepManager.cpp index a8584a21d..6928ea732 100644 --- a/src/RE/B/BGSFootstepManager.cpp +++ b/src/RE/B/BGSFootstepManager.cpp @@ -4,7 +4,7 @@ namespace RE { BGSFootstepManager* BGSFootstepManager::GetSingleton() { - REL::Relocation singleton{ Offset::BGSFootstepManager::Singleton }; + static REL::Relocation singleton{ Offset::BGSFootstepManager::Singleton }; return *singleton; } } diff --git a/src/RE/B/BGSSaveLoadManager.cpp b/src/RE/B/BGSSaveLoadManager.cpp index b826d9e61..98f2deab2 100644 --- a/src/RE/B/BGSSaveLoadManager.cpp +++ b/src/RE/B/BGSSaveLoadManager.cpp @@ -4,21 +4,21 @@ namespace RE { BGSSaveLoadManager* BGSSaveLoadManager::GetSingleton() { - REL::Relocation singleton{ Offset::BGSSaveLoadManager::Singleton }; + static REL::Relocation singleton{ Offset::BGSSaveLoadManager::Singleton }; return *singleton; } bool BGSSaveLoadFileEntry::PopulateFileEntryData() { using func_t = decltype(&BGSSaveLoadFileEntry::PopulateFileEntryData); - REL::Relocation func{ RELOCATION_ID(34627, 35547) }; + static REL::Relocation func{ RELOCATION_ID(34627, 35547) }; return func(this); } void BGSSaveLoadManager::GenerateCharacterID() { using func_t = decltype(&BGSSaveLoadManager::GenerateCharacterID); - REL::Relocation func{ RELOCATION_ID(34847, 35757) }; + static REL::Relocation func{ RELOCATION_ID(34847, 35757) }; return func(this); } diff --git a/src/RE/B/BGSStoryTeller.cpp b/src/RE/B/BGSStoryTeller.cpp index 416de01ec..92a3c4f7c 100644 --- a/src/RE/B/BGSStoryTeller.cpp +++ b/src/RE/B/BGSStoryTeller.cpp @@ -4,7 +4,7 @@ namespace RE { BGSStoryTeller* BGSStoryTeller::GetSingleton() { - REL::Relocation singleton{ Offset::BGSStoryTeller::Singleton }; + static REL::Relocation singleton{ Offset::BGSStoryTeller::Singleton }; return *singleton; } diff --git a/src/RE/B/BSDirectInputManager.cpp b/src/RE/B/BSDirectInputManager.cpp index 5029082f3..2fa656904 100644 --- a/src/RE/B/BSDirectInputManager.cpp +++ b/src/RE/B/BSDirectInputManager.cpp @@ -4,7 +4,7 @@ namespace RE { BSDirectInputManager* BSDirectInputManager::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(517046, 403554) }; + static REL::Relocation singleton{ RELOCATION_ID(517046, 403554) }; return *singleton; } diff --git a/src/RE/B/BSInputDeviceManager.cpp b/src/RE/B/BSInputDeviceManager.cpp index eea7de55a..a3a3047cf 100644 --- a/src/RE/B/BSInputDeviceManager.cpp +++ b/src/RE/B/BSInputDeviceManager.cpp @@ -11,7 +11,7 @@ namespace RE { BSInputDeviceManager* BSInputDeviceManager::GetSingleton() { - REL::Relocation singleton{ Offset::BSInputDeviceManager::Singleton }; + static REL::Relocation singleton{ Offset::BSInputDeviceManager::Singleton }; return *singleton; } diff --git a/src/RE/B/BSInputEventQueue.cpp b/src/RE/B/BSInputEventQueue.cpp index fdcfd2aeb..83f9dd514 100644 --- a/src/RE/B/BSInputEventQueue.cpp +++ b/src/RE/B/BSInputEventQueue.cpp @@ -4,7 +4,7 @@ namespace RE { BSInputEventQueue* BSInputEventQueue::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(520856, 407374) }; + static REL::Relocation singleton{ RELOCATION_ID(520856, 407374) }; return *singleton; } diff --git a/src/RE/B/BSResponse.cpp b/src/RE/B/BSResponse.cpp index 58e472b6d..3ecff2252 100644 --- a/src/RE/B/BSResponse.cpp +++ b/src/RE/B/BSResponse.cpp @@ -4,7 +4,7 @@ namespace RE { ResponseDictionary* ResponseDictionary::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(517372, 403902) }; + static REL::Relocation singleton{ RELOCATION_ID(517372, 403902) }; return *singleton; } } diff --git a/src/RE/B/BSScaleformManager.cpp b/src/RE/B/BSScaleformManager.cpp index 97f324dd1..1d89bf6c6 100644 --- a/src/RE/B/BSScaleformManager.cpp +++ b/src/RE/B/BSScaleformManager.cpp @@ -11,7 +11,7 @@ namespace RE { BSScaleformManager* BSScaleformManager::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(516573, 402775) }; + static REL::Relocation singleton{ RELOCATION_ID(516573, 402775) }; return *singleton; } @@ -195,13 +195,13 @@ namespace RE static_cast(state->screenWidth) / static_cast(state->screenHeight); if (aspectRatio > 4.0 / 3.0) { - REL::Relocation fSafeZoneXWide{ RELOCATION_ID(512509, 389569) }; - REL::Relocation fSafeZoneYWide{ RELOCATION_ID(512511, 389572) }; + static REL::Relocation fSafeZoneXWide{ RELOCATION_ID(512509, 389569) }; + static REL::Relocation fSafeZoneYWide{ RELOCATION_ID(512511, 389572) }; return std::make_pair(fSafeZoneXWide->GetFloat(), fSafeZoneYWide->GetFloat()); } else { - REL::Relocation fSafeZoneX{ RELOCATION_ID(512513, 389575) }; - REL::Relocation fSafeZoneY{ RELOCATION_ID(512515, 389578) }; + static REL::Relocation fSafeZoneX{ RELOCATION_ID(512513, 389575) }; + static REL::Relocation fSafeZoneY{ RELOCATION_ID(512515, 389578) }; return std::make_pair(fSafeZoneX->GetFloat(), fSafeZoneY->GetFloat()); } diff --git a/src/RE/B/BarterMenu.cpp b/src/RE/B/BarterMenu.cpp index 103bb6839..9edc3edf2 100644 --- a/src/RE/B/BarterMenu.cpp +++ b/src/RE/B/BarterMenu.cpp @@ -4,7 +4,7 @@ namespace RE { RefHandle BarterMenu::GetTargetRefHandle() { - REL::Relocation handle{ RELOCATION_ID(519283, 403520) }; + static REL::Relocation handle{ RELOCATION_ID(519283, 403520) }; return *handle; } } diff --git a/src/RE/B/BookMenu.cpp b/src/RE/B/BookMenu.cpp index 2507f3036..ab05a8885 100644 --- a/src/RE/B/BookMenu.cpp +++ b/src/RE/B/BookMenu.cpp @@ -7,13 +7,13 @@ namespace RE { TESObjectBOOK* BookMenu::GetTargetForm() { - REL::Relocation book{ RELOCATION_ID(519295, 405835) }; + static REL::Relocation book{ RELOCATION_ID(519295, 405835) }; return *book; } TESObjectREFR* BookMenu::GetTargetReference() { - REL::Relocation refptr{ RELOCATION_ID(519300, 405840) }; + static REL::Relocation refptr{ RELOCATION_ID(519300, 405840) }; return refptr->get(); } diff --git a/src/RE/C/Calendar.cpp b/src/RE/C/Calendar.cpp index beb41df75..393ad9205 100644 --- a/src/RE/C/Calendar.cpp +++ b/src/RE/C/Calendar.cpp @@ -8,7 +8,7 @@ namespace RE { Calendar* Calendar::GetSingleton() { - REL::Relocation singleton{ Offset::Calendar::Singleton }; + static REL::Relocation singleton{ Offset::Calendar::Singleton }; return *singleton; } @@ -88,7 +88,7 @@ namespace RE float Calendar::GetHoursPerDay() { - REL::Relocation hours{ RELOCATION_ID(241610, 195681) }; + static REL::Relocation hours{ RELOCATION_ID(241610, 195681) }; return *hours; } diff --git a/src/RE/C/CommandTable.cpp b/src/RE/C/CommandTable.cpp index c2607c03d..a157da465 100644 --- a/src/RE/C/CommandTable.cpp +++ b/src/RE/C/CommandTable.cpp @@ -56,7 +56,7 @@ namespace RE SCRIPT_FUNCTION* SCRIPT_FUNCTION::GetFirstScriptCommand() { - REL::Relocation ptr{ Offset::SCRIPT_FUNCTION::FirstScriptCommand }; + static REL::Relocation ptr{ Offset::SCRIPT_FUNCTION::FirstScriptCommand }; return ptr.get(); } @@ -74,7 +74,7 @@ namespace RE SCRIPT_FUNCTION* SCRIPT_FUNCTION::GetFirstConsoleCommand() { - REL::Relocation ptr{ Offset::SCRIPT_FUNCTION::FirstConsoleCommand }; + static REL::Relocation ptr{ Offset::SCRIPT_FUNCTION::FirstConsoleCommand }; return ptr.get(); } diff --git a/src/RE/C/Console.cpp b/src/RE/C/Console.cpp index 1121d9b5a..5799bba21 100644 --- a/src/RE/C/Console.cpp +++ b/src/RE/C/Console.cpp @@ -12,7 +12,7 @@ namespace RE ObjectRefHandle Console::GetSelectedRefHandle() { - REL::Relocation selectedRef{ Offset::Console::SelectedRef }; + static REL::Relocation selectedRef{ Offset::Console::SelectedRef }; return *selectedRef; } diff --git a/src/RE/C/ConsoleLog.cpp b/src/RE/C/ConsoleLog.cpp index b90801401..60c2bc711 100644 --- a/src/RE/C/ConsoleLog.cpp +++ b/src/RE/C/ConsoleLog.cpp @@ -5,7 +5,7 @@ namespace RE { ConsoleLog* ConsoleLog::GetSingleton() { - REL::Relocation singleton{ Offset::ConsoleLog::Singleton }; + static REL::Relocation singleton{ Offset::ConsoleLog::Singleton }; return *singleton; } diff --git a/src/RE/C/ContainerMenu.cpp b/src/RE/C/ContainerMenu.cpp index dde5447a4..808e08fb1 100644 --- a/src/RE/C/ContainerMenu.cpp +++ b/src/RE/C/ContainerMenu.cpp @@ -4,13 +4,13 @@ namespace RE { ContainerMenu::ContainerMode ContainerMenu::GetContainerMode() { - REL::Relocation mode{ RELOCATION_ID(519396, 405937) }; + static REL::Relocation mode{ RELOCATION_ID(519396, 405937) }; return *mode; } RefHandle ContainerMenu::GetTargetRefHandle() { - REL::Relocation handle{ RELOCATION_ID(519421, 405962) }; + static REL::Relocation handle{ RELOCATION_ID(519421, 405962) }; return *handle; } } diff --git a/src/RE/C/ControlMap.cpp b/src/RE/C/ControlMap.cpp index ea3d81cd4..c2723f08f 100644 --- a/src/RE/C/ControlMap.cpp +++ b/src/RE/C/ControlMap.cpp @@ -6,7 +6,7 @@ namespace RE { ControlMap* ControlMap::GetSingleton() { - REL::Relocation singleton{ Offset::ControlMap::Singleton }; + static REL::Relocation singleton{ Offset::ControlMap::Singleton }; return *singleton; } diff --git a/src/RE/G/GMemory.cpp b/src/RE/G/GMemory.cpp index 7cc246253..7749ef0b1 100644 --- a/src/RE/G/GMemory.cpp +++ b/src/RE/G/GMemory.cpp @@ -93,7 +93,7 @@ namespace RE GMemoryHeap*& GMemory::GetGlobalHeapRef() { - REL::Relocation globalHeap{ Offset::GMemory::GlobalHeap }; + static REL::Relocation globalHeap{ Offset::GMemory::GlobalHeap }; return *globalHeap; } } diff --git a/src/RE/G/GameSettingCollection.cpp b/src/RE/G/GameSettingCollection.cpp index f914de56f..4b84b2a7e 100644 --- a/src/RE/G/GameSettingCollection.cpp +++ b/src/RE/G/GameSettingCollection.cpp @@ -4,7 +4,7 @@ namespace RE { GameSettingCollection* GameSettingCollection::GetSingleton() { - REL::Relocation singleton{ Offset::GameSettingCollection::Singleton }; + static REL::Relocation singleton{ Offset::GameSettingCollection::Singleton }; return *singleton; } diff --git a/src/RE/G/GiftMenu.cpp b/src/RE/G/GiftMenu.cpp index 76378ed12..9c6306a35 100644 --- a/src/RE/G/GiftMenu.cpp +++ b/src/RE/G/GiftMenu.cpp @@ -4,7 +4,7 @@ namespace RE { RefHandle GiftMenu::GetTargetRefHandle() { - REL::Relocation handle{ RELOCATION_ID(519570, 406111) }; + static REL::Relocation handle{ RELOCATION_ID(519570, 406111) }; return *handle; } } diff --git a/src/RE/I/IFormFactory.cpp b/src/RE/I/IFormFactory.cpp index eb986c89a..4c8b4321c 100644 --- a/src/RE/I/IFormFactory.cpp +++ b/src/RE/I/IFormFactory.cpp @@ -9,8 +9,8 @@ namespace RE IFormFactory* data[std::to_underlying(FormType::Max)]; }; - REL::Relocation formFactories{ RELOCATION_ID(514355, 400508) }; - REL::Relocation formFactoriesInitialized{ RELOCATION_ID(514349, 400503) }; + static REL::Relocation formFactories{ RELOCATION_ID(514355, 400508) }; + static REL::Relocation formFactoriesInitialized{ RELOCATION_ID(514349, 400503) }; return std::make_pair(formFactories->data, *formFactoriesInitialized); } diff --git a/src/RE/I/IHandlerFunctor.cpp b/src/RE/I/IHandlerFunctor.cpp index 0f479bb51..3c8456366 100644 --- a/src/RE/I/IHandlerFunctor.cpp +++ b/src/RE/I/IHandlerFunctor.cpp @@ -4,7 +4,7 @@ namespace RE { HandlerDictionary* HandlerDictionary::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(518086, 404607) }; + static REL::Relocation singleton{ RELOCATION_ID(518086, 404607) }; return *singleton; } } diff --git a/src/RE/I/INIPrefSettingCollection.cpp b/src/RE/I/INIPrefSettingCollection.cpp index 5286519db..3e6e0046d 100644 --- a/src/RE/I/INIPrefSettingCollection.cpp +++ b/src/RE/I/INIPrefSettingCollection.cpp @@ -4,7 +4,7 @@ namespace RE { INIPrefSettingCollection* INIPrefSettingCollection::GetSingleton() { - REL::Relocation singleton{ Offset::INIPrefSettingCollection::Singleton }; + static REL::Relocation singleton{ Offset::INIPrefSettingCollection::Singleton }; return *singleton; } } diff --git a/src/RE/I/INISettingCollection.cpp b/src/RE/I/INISettingCollection.cpp index 3efd291ea..ffabd8101 100644 --- a/src/RE/I/INISettingCollection.cpp +++ b/src/RE/I/INISettingCollection.cpp @@ -4,7 +4,7 @@ namespace RE { INISettingCollection* INISettingCollection::GetSingleton() { - REL::Relocation singleton{ Offset::INISettingCollection::Singleton }; + static REL::Relocation singleton{ Offset::INISettingCollection::Singleton }; return *singleton; } diff --git a/src/RE/I/InterfaceStrings.cpp b/src/RE/I/InterfaceStrings.cpp index ccaf3604b..c711dee90 100644 --- a/src/RE/I/InterfaceStrings.cpp +++ b/src/RE/I/InterfaceStrings.cpp @@ -4,7 +4,7 @@ namespace RE { InterfaceStrings* InterfaceStrings::GetSingleton() { - REL::Relocation singleton{ Offset::InterfaceStrings::Singleton }; + static REL::Relocation singleton{ Offset::InterfaceStrings::Singleton }; return *singleton; } } diff --git a/src/RE/I/Inventory3DManager.cpp b/src/RE/I/Inventory3DManager.cpp index 2c998536e..abd65a3a6 100644 --- a/src/RE/I/Inventory3DManager.cpp +++ b/src/RE/I/Inventory3DManager.cpp @@ -4,7 +4,7 @@ namespace RE { Inventory3DManager* Inventory3DManager::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(517051, 403559) }; + static REL::Relocation singleton{ RELOCATION_ID(517051, 403559) }; return *singleton; } diff --git a/src/RE/L/LockpickingMenu.cpp b/src/RE/L/LockpickingMenu.cpp index 0af8425ba..ea711b3ac 100644 --- a/src/RE/L/LockpickingMenu.cpp +++ b/src/RE/L/LockpickingMenu.cpp @@ -6,7 +6,7 @@ namespace RE { TESObjectREFR* LockpickingMenu::GetTargetReference() { - REL::Relocation refptr{ RELOCATION_ID(519716, 406271) }; + static REL::Relocation refptr{ RELOCATION_ID(519716, 406271) }; return refptr->get(); } } diff --git a/src/RE/M/MagicFavorites.cpp b/src/RE/M/MagicFavorites.cpp index 75866f04e..f809ed6ea 100644 --- a/src/RE/M/MagicFavorites.cpp +++ b/src/RE/M/MagicFavorites.cpp @@ -4,7 +4,7 @@ namespace RE { MagicFavorites* MagicFavorites::GetSingleton() { - REL::Relocation singleton{ Offset::MagicFavorites::Singleton }; + static REL::Relocation singleton{ Offset::MagicFavorites::Singleton }; return *singleton; } diff --git a/src/RE/M/Main.cpp b/src/RE/M/Main.cpp index 1b10733d4..517ef5fb0 100644 --- a/src/RE/M/Main.cpp +++ b/src/RE/M/Main.cpp @@ -7,7 +7,7 @@ namespace RE { Main* Main::GetSingleton() { - REL::Relocation singleton{ Offset::Main::Singleton }; + static REL::Relocation singleton{ Offset::Main::Singleton }; return *singleton; } @@ -20,7 +20,7 @@ namespace RE float Main::QFrameAnimTime() { - REL::Relocation data{ RELOCATION_ID(516940, 403447) }; + static REL::Relocation data{ RELOCATION_ID(516940, 403447) }; return *data; } @@ -33,7 +33,7 @@ namespace RE Scenegraph* Main::WorldRootNode() { - REL::Relocation*> nodePtr{ RELOCATION_ID(517006, 403513) }; + static REL::Relocation*> nodePtr{ RELOCATION_ID(517006, 403513) }; return nodePtr->get(); } diff --git a/src/RE/M/MenuControls.cpp b/src/RE/M/MenuControls.cpp index c4ee5c611..80f7edd2f 100644 --- a/src/RE/M/MenuControls.cpp +++ b/src/RE/M/MenuControls.cpp @@ -15,8 +15,8 @@ namespace RE MenuControls* MenuControls::GetSingleton() { - REL::Relocation singelton{ Offset::MenuControls::Singleton }; - return *singelton; + static REL::Relocation singleton{ Offset::MenuControls::Singleton }; + return *singleton; } void MenuControls::AddHandler(MenuEventHandler* a_handler) diff --git a/src/RE/M/MenuCursor.cpp b/src/RE/M/MenuCursor.cpp index 72b8b5125..7211c41a7 100644 --- a/src/RE/M/MenuCursor.cpp +++ b/src/RE/M/MenuCursor.cpp @@ -5,7 +5,7 @@ namespace RE { MenuCursor* MenuCursor::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(517043, 403551) }; + static REL::Relocation singleton{ RELOCATION_ID(517043, 403551) }; return *singleton; } diff --git a/src/RE/M/Misc.cpp b/src/RE/M/Misc.cpp index cf2eb058d..46ad95953 100644 --- a/src/RE/M/Misc.cpp +++ b/src/RE/M/Misc.cpp @@ -62,7 +62,7 @@ namespace RE std::uint32_t GetDurationOfApplicationRunTime() { - REL::Relocation runtime{ RELOCATION_ID(523662, 410201) }; + static REL::Relocation runtime{ RELOCATION_ID(523662, 410201) }; return *runtime; } @@ -81,7 +81,7 @@ namespace RE float GetSecondsSinceLastFrame() { - REL::Relocation seconds{ RELOCATION_ID(523660, 410199) }; + static REL::Relocation seconds{ RELOCATION_ID(523660, 410199) }; return *seconds; } diff --git a/src/RE/N/NiMemManager.cpp b/src/RE/N/NiMemManager.cpp index b077e98d7..8551bab75 100644 --- a/src/RE/N/NiMemManager.cpp +++ b/src/RE/N/NiMemManager.cpp @@ -4,7 +4,7 @@ namespace RE { NiMemManager* NiMemManager::GetSingleton() { - REL::Relocation singleton{ Offset::NiMemManager::Singleton }; + static REL::Relocation singleton{ Offset::NiMemManager::Singleton }; return *singleton; } diff --git a/src/RE/N/NiObject.cpp b/src/RE/N/NiObject.cpp index b8d1ac856..4483c06c0 100644 --- a/src/RE/N/NiObject.cpp +++ b/src/RE/N/NiObject.cpp @@ -7,7 +7,7 @@ namespace RE { const NiRTTI* NiObject::GetRTTI() const { - REL::Relocation rtti{ NiObject::Ni_RTTI }; + static REL::Relocation rtti{ NiObject::Ni_RTTI }; return rtti.get(); } diff --git a/src/RE/N/NiTimeController.cpp b/src/RE/N/NiTimeController.cpp index 1a37f4dd2..7bd731af4 100644 --- a/src/RE/N/NiTimeController.cpp +++ b/src/RE/N/NiTimeController.cpp @@ -4,7 +4,7 @@ namespace RE { const NiRTTI* NiTimeController::GetRTTI() const { - REL::Relocation rtti{ NiTimeController::Ni_RTTI }; + static REL::Relocation rtti{ NiTimeController::Ni_RTTI }; return rtti.get(); } diff --git a/src/RE/P/PlayerCamera.cpp b/src/RE/P/PlayerCamera.cpp index e54915c56..f419e3b5b 100644 --- a/src/RE/P/PlayerCamera.cpp +++ b/src/RE/P/PlayerCamera.cpp @@ -4,7 +4,7 @@ namespace RE { PlayerCamera* PlayerCamera::GetSingleton() { - REL::Relocation singleton{ Offset::PlayerCamera::Singleton }; + static REL::Relocation singleton{ Offset::PlayerCamera::Singleton }; return *singleton; } diff --git a/src/RE/P/PlayerCharacter.cpp b/src/RE/P/PlayerCharacter.cpp index 4cdcb80e3..d016c2d04 100644 --- a/src/RE/P/PlayerCharacter.cpp +++ b/src/RE/P/PlayerCharacter.cpp @@ -13,13 +13,13 @@ namespace RE PlayerCharacter* PlayerCharacter::GetSingleton() { - REL::Relocation*> singleton{ Offset::PlayerCharacter::Singleton }; + static REL::Relocation*> singleton{ Offset::PlayerCharacter::Singleton }; return singleton->get(); } bool PlayerCharacter::IsGodMode() { - REL::Relocation singleton{ RELOCATION_ID(517711, 404238) }; + static REL::Relocation singleton{ RELOCATION_ID(517711, 404238) }; return *singleton; } diff --git a/src/RE/P/PlayerControls.cpp b/src/RE/P/PlayerControls.cpp index 2aa949ba4..c6bfe26d0 100644 --- a/src/RE/P/PlayerControls.cpp +++ b/src/RE/P/PlayerControls.cpp @@ -12,7 +12,7 @@ namespace RE PlayerControls* PlayerControls::GetSingleton() { - REL::Relocation singleton{ Offset::PlayerControls::Singleton }; + static REL::Relocation singleton{ Offset::PlayerControls::Singleton }; return *singleton; } diff --git a/src/RE/P/ProcessLists.cpp b/src/RE/P/ProcessLists.cpp index 72f43d371..65097b9ad 100644 --- a/src/RE/P/ProcessLists.cpp +++ b/src/RE/P/ProcessLists.cpp @@ -10,7 +10,7 @@ namespace RE { ProcessLists* ProcessLists::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514167, 400315) }; + static REL::Relocation singleton{ RELOCATION_ID(514167, 400315) }; return *singleton; } diff --git a/src/RE/P/Projectile.cpp b/src/RE/P/Projectile.cpp index c35a8d7e4..9fbb24ed4 100644 --- a/src/RE/P/Projectile.cpp +++ b/src/RE/P/Projectile.cpp @@ -8,7 +8,7 @@ namespace RE { Projectile::Manager* Projectile::Manager::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(514313, 400473) }; + static REL::Relocation singleton{ RELOCATION_ID(514313, 400473) }; return *singleton; } diff --git a/src/RE/R/Renderer.cpp b/src/RE/R/Renderer.cpp index 49b9ec316..f982f1f61 100644 --- a/src/RE/R/Renderer.cpp +++ b/src/RE/R/Renderer.cpp @@ -8,7 +8,7 @@ namespace RE { Renderer* Renderer::GetSingleton() noexcept { - REL::Relocation singleton{ RELOCATION_ID(524907, 411393) }; + static REL::Relocation singleton{ RELOCATION_ID(524907, 411393) }; return singleton.get(); } @@ -134,7 +134,7 @@ namespace RE [[nodiscard]] RendererData* Renderer::GetRendererData() { // Location is a global pointer to the RendererData in the Renderer singleton - REL::Relocation singleton{ RELOCATION_ID(524728, 411347) }; + static REL::Relocation singleton{ RELOCATION_ID(524728, 411347) }; return *singleton; } @@ -147,14 +147,14 @@ namespace RE [[nodiscard]] REX::W32::ID3D11Device* Renderer::GetDevice() { // Location is a global pointer to the device in the Renderer Data - REL::Relocation device{ RELOCATION_ID(524729, 411348) }; + static REL::Relocation device{ RELOCATION_ID(524729, 411348) }; return *device; } [[nodiscard]] RendererWindow* Renderer::GetCurrentRenderWindow() { // Location is a global pointer to the current renderWindow (which is not necessarily at index 0 in the renderWindows array) - REL::Relocation renderWindow{ RELOCATION_ID(524730, 411349) }; + static REL::Relocation renderWindow{ RELOCATION_ID(524730, 411349) }; return *renderWindow; } } diff --git a/src/RE/S/SkyrimVM.cpp b/src/RE/S/SkyrimVM.cpp index 823722b97..36e26a9d0 100644 --- a/src/RE/S/SkyrimVM.cpp +++ b/src/RE/S/SkyrimVM.cpp @@ -5,7 +5,7 @@ namespace RE { SkyrimVM* SkyrimVM::GetSingleton() { - REL::Relocation singleton{ Offset::SkyrimVM::Singleton }; + static REL::Relocation singleton{ Offset::SkyrimVM::Singleton }; return *singleton; } diff --git a/src/RE/T/TES.cpp b/src/RE/T/TES.cpp index 3d2ebb0ab..5efef8828 100644 --- a/src/RE/T/TES.cpp +++ b/src/RE/T/TES.cpp @@ -11,7 +11,7 @@ namespace RE { TES* TES::GetSingleton() { - REL::Relocation singleton{ Offset::TES::Singleton }; + static REL::Relocation singleton{ Offset::TES::Singleton }; return *singleton; } diff --git a/src/RE/T/TESDataHandler.cpp b/src/RE/T/TESDataHandler.cpp index 09e237981..3b0e1f9d7 100644 --- a/src/RE/T/TESDataHandler.cpp +++ b/src/RE/T/TESDataHandler.cpp @@ -7,7 +7,7 @@ namespace RE { TESDataHandler* TESDataHandler::GetSingleton() { - REL::Relocation singleton{ Offset::TESDataHandler::Singleton }; + static REL::Relocation singleton{ Offset::TESDataHandler::Singleton }; return *singleton; } diff --git a/src/RE/T/TESObjectREFR.cpp b/src/RE/T/TESObjectREFR.cpp index 7dc7e2cb3..267476715 100644 --- a/src/RE/T/TESObjectREFR.cpp +++ b/src/RE/T/TESObjectREFR.cpp @@ -207,7 +207,7 @@ namespace RE float TESObjectREFR::GetDistance(TESObjectREFR* a_other, bool a_disabledRefs, bool a_ignoreWorldspace) const { using func_t = decltype(&TESObjectREFR::GetDistance); - REL::Relocation func{ RELOCATION_ID(19396, 19823) }; + static REL::Relocation func{ RELOCATION_ID(19396, 19823) }; return func(this, a_other, a_disabledRefs, a_ignoreWorldspace); } diff --git a/src/RE/T/TaskQueueInterface.cpp b/src/RE/T/TaskQueueInterface.cpp index 99e9a6407..1e6fa08ae 100644 --- a/src/RE/T/TaskQueueInterface.cpp +++ b/src/RE/T/TaskQueueInterface.cpp @@ -4,7 +4,7 @@ namespace RE { TaskQueueInterface* TaskQueueInterface::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(517228, 403759) }; + static REL::Relocation singleton{ RELOCATION_ID(517228, 403759) }; return *singleton; } diff --git a/src/RE/U/UI.cpp b/src/RE/U/UI.cpp index 648219356..2d5c5117a 100644 --- a/src/RE/U/UI.cpp +++ b/src/RE/U/UI.cpp @@ -6,7 +6,7 @@ namespace RE { UI* UI::GetSingleton() { - REL::Relocation singleton{ Offset::UI::Singleton }; + static REL::Relocation singleton{ Offset::UI::Singleton }; return *singleton; } diff --git a/src/RE/U/UI3DSceneManager.cpp b/src/RE/U/UI3DSceneManager.cpp index 2fe2b3584..fde005d4b 100644 --- a/src/RE/U/UI3DSceneManager.cpp +++ b/src/RE/U/UI3DSceneManager.cpp @@ -4,7 +4,7 @@ namespace RE { UI3DSceneManager* UI3DSceneManager::GetSingleton() { - REL::Relocation singleton{ RELOCATION_ID(517052, 403560) }; + static REL::Relocation singleton{ RELOCATION_ID(517052, 403560) }; return *singleton; } diff --git a/src/RE/U/UIBlurManager.cpp b/src/RE/U/UIBlurManager.cpp index a769a1846..fc05b08e3 100644 --- a/src/RE/U/UIBlurManager.cpp +++ b/src/RE/U/UIBlurManager.cpp @@ -4,7 +4,7 @@ namespace RE { UIBlurManager* UIBlurManager::GetSingleton() { - REL::Relocation singleton{ Offset::UIBlurManager::Singleton }; + static REL::Relocation singleton{ Offset::UIBlurManager::Singleton }; return *singleton; } diff --git a/src/RE/U/UIMessageQueue.cpp b/src/RE/U/UIMessageQueue.cpp index 64314ee8c..8d2d38eea 100644 --- a/src/RE/U/UIMessageQueue.cpp +++ b/src/RE/U/UIMessageQueue.cpp @@ -7,7 +7,7 @@ namespace RE { UIMessageQueue* UIMessageQueue::GetSingleton() { - REL::Relocation singleton{ Offset::UIMessageQueue::Singleton }; + static REL::Relocation singleton{ Offset::UIMessageQueue::Singleton }; return *singleton; } diff --git a/src/RE/U/UserEvents.cpp b/src/RE/U/UserEvents.cpp index 526aad314..412b4f8a5 100644 --- a/src/RE/U/UserEvents.cpp +++ b/src/RE/U/UserEvents.cpp @@ -4,7 +4,7 @@ namespace RE { UserEvents* UserEvents::GetSingleton() { - REL::Relocation singleton{ Offset::UserEvents::Singleton }; + static REL::Relocation singleton{ Offset::UserEvents::Singleton }; return *singleton; } }