Skip to content

Commit

Permalink
perf: make more relocations static
Browse files Browse the repository at this point in the history
  • Loading branch information
FlayaN committed Oct 27, 2024
1 parent 4ebed42 commit bd9cb72
Show file tree
Hide file tree
Showing 92 changed files with 120 additions and 120 deletions.
2 changes: 1 addition & 1 deletion include/RE/A/ActorValueList.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RE
public:
[[nodiscard]] static ActorValueList* GetSingleton()
{
REL::Relocation<ActorValueList**> singleton{ RELOCATION_ID(514139, 400267) };
static REL::Relocation<ActorValueList**> singleton{ RELOCATION_ID(514139, 400267) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/A/AnimationFileManagerSingleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace RE

[[nodiscard]] static AnimationFileManagerSingleton* GetSingleton()
{
REL::Relocation<AnimationFileManagerSingleton**> singleton{ RELOCATION_ID(520994, 407512) };
static REL::Relocation<AnimationFileManagerSingleton**> singleton{ RELOCATION_ID(520994, 407512) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/A/AnimationObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace RE
public:
[[nodiscard]] static AnimationObjects* GetSingleton()
{
REL::Relocation<AnimationObjects**> singleton{ RELOCATION_ID(514179, 400328) };
static REL::Relocation<AnimationObjects**> singleton{ RELOCATION_ID(514179, 400328) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BGSAddToPlayerInventoryEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace RE
public:
[[nodiscard]] static std::uint32_t& GetIndex()
{
REL::Relocation<std::uint32_t*> index{ RELOCATION_ID(508412, 380074) };
static REL::Relocation<std::uint32_t*> index{ RELOCATION_ID(508412, 380074) };
return *index;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BGSDecalManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace RE
public:
static BGSDecalManager* GetSingleton()
{
REL::Relocation<BGSDecalManager**> singleton{ RELOCATION_ID(514414, 400561) };
static REL::Relocation<BGSDecalManager**> singleton{ RELOCATION_ID(514414, 400561) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BGSGrassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace RE
public:
static BGSGrassManager* GetSingleton()
{
REL::Relocation<BGSGrassManager**> singleton{ RELOCATION_ID(514292, 400452) };
static REL::Relocation<BGSGrassManager**> singleton{ RELOCATION_ID(514292, 400452) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BGSImpactManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace RE

static BGSImpactManager* GetSingleton()
{
REL::Relocation<BGSImpactManager**> singleton{ RELOCATION_ID(515123, 401262) };
static REL::Relocation<BGSImpactManager**> singleton{ RELOCATION_ID(515123, 401262) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BGSSaveLoadGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace RE

static BGSSaveLoadGame* GetSingleton()
{
REL::Relocation<BGSSaveLoadGame**> singleton{ RELOCATION_ID(516851, 403330) };
static REL::Relocation<BGSSaveLoadGame**> singleton{ RELOCATION_ID(516851, 403330) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BSFaceGenManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace RE
public:
[[nodiscard]] static BSFaceGenManager* GetSingleton()
{
REL::Relocation<BSFaceGenManager**> singleton{ RELOCATION_ID(514182, 400331) };
static REL::Relocation<BSFaceGenManager**> singleton{ RELOCATION_ID(514182, 400331) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BSMusicManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace RE

[[nodiscard]] static BSMusicManager* GetSingleton()
{
REL::Relocation<BSMusicManager**> singleton{ RELOCATION_ID(514738, 400896) };
static REL::Relocation<BSMusicManager**> singleton{ RELOCATION_ID(514738, 400896) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BSPointerHandleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace RE

[[nodiscard]] static auto GetHandleEntries()
{
REL::Relocation<Entry(*)[0x100000]> entries{ RELOCATION_ID(514478, 400622) };
static REL::Relocation<Entry(*)[0x100000]> entries{ RELOCATION_ID(514478, 400622) };
return std::span<Entry, 0x100000>{ *entries };
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BSShaderManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace RE
public:
static BSShaderManager::State& GetSingleton()
{
REL::Relocation<BSShaderManager::State*> singleton{ RELOCATION_ID(513211, 390951) };
static REL::Relocation<BSShaderManager::State*> singleton{ RELOCATION_ID(513211, 390951) };
return *singleton;
}

Expand Down
6 changes: 3 additions & 3 deletions include/RE/B/BSTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ namespace RE
public:
[[nodiscard]] static BSTimer* GetSingleton() noexcept
{
REL::Relocation<BSTimer*> singleton{ RELOCATION_ID(523657, 410196) };
static REL::Relocation<BSTimer*> singleton{ RELOCATION_ID(523657, 410196) };
return singleton.get();
}

static float QGlobalTimeMultiplier()
{
REL::Relocation<float*> value{ RELOCATION_ID(511882, 388442) };
static REL::Relocation<float*> value{ RELOCATION_ID(511882, 388442) };
return *value;
}

static float QGlobalTimeMultiplierTarget()
{
REL::Relocation<float*> value{ RELOCATION_ID(511883, 388443) };
static REL::Relocation<float*> value{ RELOCATION_ID(511883, 388443) };
return *value;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BSTreeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace RE

static BSTreeManager* GetSingleton()
{
REL::Relocation<BSTreeManager**> singleton{ RELOCATION_ID(514181, 400330) };
static REL::Relocation<BSTreeManager**> singleton{ RELOCATION_ID(514181, 400330) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BSUtilityShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace RE

static BSUtilityShader* GetSingleton()
{
REL::Relocation<BSUtilityShader**> singleton{ RELOCATION_ID(528354, 415300) };
static REL::Relocation<BSUtilityShader**> singleton{ RELOCATION_ID(528354, 415300) };
return *singleton;
}
~BSUtilityShader() override; // 00
Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/bhkCollisionFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace RE

[[nodiscard]] static bhkCollisionFilter* GetSingleton()
{
REL::Relocation<bhkCollisionFilter**> singleton{ RELOCATION_ID(514415, 400562) };
static REL::Relocation<bhkCollisionFilter**> singleton{ RELOCATION_ID(514415, 400562) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/bhkTelekinesisListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace RE

static bhkTelekinesisListener* GetSingleton()
{
REL::Relocation<bhkTelekinesisListener**> singleton{ RELOCATION_ID(515445, 401584) };
static REL::Relocation<bhkTelekinesisListener**> singleton{ RELOCATION_ID(515445, 401584) };
return *singleton;
}
};
Expand Down
4 changes: 2 additions & 2 deletions include/RE/B/bhkWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ namespace RE

static float GetWorldScale()
{
REL::Relocation<float*> worldScale{ RELOCATION_ID(231896, 188105) };
static REL::Relocation<float*> worldScale{ RELOCATION_ID(231896, 188105) };
return *worldScale;
}

static float GetWorldScaleInverse()
{
REL::Relocation<float*> worldScaleInverse{ RELOCATION_ID(230692, 187407) };
static REL::Relocation<float*> worldScaleInverse{ RELOCATION_ID(230692, 187407) };
return *worldScaleInverse;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/C/CombatManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace RE
public:
[[nodiscard]] static CombatManager* GetSingleton()
{
REL::Relocation<CombatManager**> singleton{ RELOCATION_ID(518706, 405246) };
static REL::Relocation<CombatManager**> singleton{ RELOCATION_ID(518706, 405246) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/C/CrosshairPickData.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace RE
public:
static CrosshairPickData* GetSingleton()
{
REL::Relocation<CrosshairPickData**> singleton{ RELOCATION_ID(515446, 401585) };
static REL::Relocation<CrosshairPickData**> singleton{ RELOCATION_ID(515446, 401585) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/F/FOCollisionListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace RE

static FOCollisionListener* GetSingleton()
{
REL::Relocation<FOCollisionListener**> singleton{ RELOCATION_ID(514284, 400444) };
static REL::Relocation<FOCollisionListener**> singleton{ RELOCATION_ID(514284, 400444) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/F/FORM_ENUM_STRING.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace RE
public:
[[nodiscard]] static std::span<FORM_ENUM_STRING, 138> GetFormEnumString()
{
REL::Relocation<FORM_ENUM_STRING(*)[138]> formEnumString{ RELOCATION_ID(501008, 359120) };
static REL::Relocation<FORM_ENUM_STRING(*)[138]> formEnumString{ RELOCATION_ID(501008, 359120) };
return { *formEnumString };
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/G/GarbageCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace RE

static GarbageCollector* GetSingleton()
{
REL::Relocation<GarbageCollector**> singleton{ RELOCATION_ID(514180, 400329) };
static REL::Relocation<GarbageCollector**> singleton{ RELOCATION_ID(514180, 400329) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/H/hkContainerAllocators.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace RE

[[nodiscard]] static Allocator* GetSingleton()
{
REL::Relocation<hkContainerHeapAllocator::Allocator*> singleton{ RELOCATION_ID(510713, 383828) };
static REL::Relocation<hkContainerHeapAllocator::Allocator*> singleton{ RELOCATION_ID(510713, 383828) };
return singleton.get();
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/RE/I/ImageSpaceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ namespace RE

static ImageSpaceManager* GetSingleton()
{
REL::Relocation<ImageSpaceManager**> singleton{ RELOCATION_ID(527731, 414660) };
static REL::Relocation<ImageSpaceManager**> singleton{ RELOCATION_ID(527731, 414660) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/M/MenuTopicManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace RE

static MenuTopicManager* GetSingleton()
{
REL::Relocation<MenuTopicManager**> singleton{ RELOCATION_ID(514959, 401099) };
static REL::Relocation<MenuTopicManager**> singleton{ RELOCATION_ID(514959, 401099) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/M/MistMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace RE

static MistMenu* GetSingleton()
{
REL::Relocation<MistMenu**> singleton{ RELOCATION_ID(519827, 406370) };
static REL::Relocation<MistMenu**> singleton{ RELOCATION_ID(519827, 406370) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/N/NiRTTI.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ To netimmerse_cast(const From* a_from)
return nullptr;
}

REL::Relocation<const RE::NiRTTI*> to{ RE::Ni_Impl::remove_cvpr_t<To>::Ni_RTTI };
static REL::Relocation<const RE::NiRTTI*> to{ RE::Ni_Impl::remove_cvpr_t<To>::Ni_RTTI };

const RE::NiRTTI* toRTTI = to.get();
const RE::NiRTTI* fromRTTI = a_from->GetRTTI();
Expand Down
2 changes: 1 addition & 1 deletion include/RE/P/Precipitation.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace RE

static NiPoint3 GetDirection()
{
REL::Relocation<NiPoint3*> precipDirection{ RELOCATION_ID(515509, 401648) };
static REL::Relocation<NiPoint3*> precipDirection{ RELOCATION_ID(515509, 401648) };
return *precipDirection;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/R/RenderTargetManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace RE
public:
[[nodiscard]] static RenderTargetManager* GetSingleton()
{
REL::Relocation<RenderTargetManager**> singleton{ RELOCATION_ID(524970, 411451) };
static REL::Relocation<RenderTargetManager**> singleton{ RELOCATION_ID(524970, 411451) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/R/ReticuleController.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RE
public:
static ReticuleController& GetSingleton()
{
REL::Relocation<ReticuleController*> singleton{ RELOCATION_ID(508607, 380335) };
static REL::Relocation<ReticuleController*> singleton{ RELOCATION_ID(508607, 380335) };
return *singleton;
}

Expand Down
4 changes: 2 additions & 2 deletions include/RE/RTTI.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ template <
int> = 0>
To skyrim_cast(From* a_from)
{
REL::Relocation<void*> from{ RE::detail::remove_cvpr_t<From>::RTTI };
REL::Relocation<void*> to{ RE::detail::remove_cvpr_t<To>::RTTI };
static REL::Relocation<void*> from{ RE::detail::remove_cvpr_t<From>::RTTI };
static REL::Relocation<void*> to{ RE::detail::remove_cvpr_t<To>::RTTI };
return static_cast<To>(
RE::RTDynamicCast(
const_cast<void*>(
Expand Down
2 changes: 1 addition & 1 deletion include/RE/S/ScreenSplatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace RE
public:
static ScreenSplatter* GetSingleton()
{
REL::Relocation<ScreenSplatter**> singleton{ RELOCATION_ID(514512, 400672) };
static REL::Relocation<ScreenSplatter**> singleton{ RELOCATION_ID(514512, 400672) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/S/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace RE
public:
[[nodiscard]] static State* GetSingleton()
{
REL::Relocation<State*> singleton{ RELOCATION_ID(524998, 411479) };
static REL::Relocation<State*> singleton{ RELOCATION_ID(524998, 411479) };
return singleton.get();
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/S/SubtitleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace RE
public:
static SubtitleManager* GetSingleton()
{
REL::Relocation<SubtitleManager**> singleton{ RELOCATION_ID(514283, 400443) };
static REL::Relocation<SubtitleManager**> singleton{ RELOCATION_ID(514283, 400443) };
return *singleton;
}

Expand Down
8 changes: 4 additions & 4 deletions include/RE/T/TESForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ namespace RE
BSTHashMap<FormID, TESForm*>*,
std::reference_wrapper<BSReadWriteLock>>
{
REL::Relocation<BSTHashMap<FormID, TESForm*>**> allForms{ RELOCATION_ID(514351, 400507) };
REL::Relocation<BSReadWriteLock*> allFormsMapLock{ RELOCATION_ID(514360, 400517) };
static REL::Relocation<BSTHashMap<FormID, TESForm*>**> allForms{ RELOCATION_ID(514351, 400507) };
static REL::Relocation<BSReadWriteLock*> allFormsMapLock{ RELOCATION_ID(514360, 400517) };
return { *allForms, std::ref(*allFormsMapLock) };
}

Expand All @@ -203,8 +203,8 @@ namespace RE
BSTHashMap<BSFixedString, TESForm*>*,
std::reference_wrapper<BSReadWriteLock>>
{
REL::Relocation<BSTHashMap<BSFixedString, TESForm*>**> allFormsByEditorID{ RELOCATION_ID(514352, 400509) };
REL::Relocation<BSReadWriteLock*> allFormsEditorIDMapLock{ RELOCATION_ID(514361, 400518) };
static REL::Relocation<BSTHashMap<BSFixedString, TESForm*>**> allFormsByEditorID{ RELOCATION_ID(514352, 400509) };
static REL::Relocation<BSReadWriteLock*> allFormsEditorIDMapLock{ RELOCATION_ID(514361, 400518) };
return { *allFormsByEditorID, std::ref(*allFormsEditorIDMapLock) };
}

Expand Down
2 changes: 1 addition & 1 deletion include/RE/T/TESWaterSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace RE
public:
[[nodiscard]] static TESWaterSystem* GetSingleton()
{
REL::Relocation<TESWaterSystem**> singleton{ RELOCATION_ID(514290, 400450) };
static REL::Relocation<TESWaterSystem**> singleton{ RELOCATION_ID(514290, 400450) };
return *singleton;
}

Expand Down
4 changes: 2 additions & 2 deletions include/RE/T/TLSData.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace RE

inline static TLSData* GetStaticTLSData()
{
REL::Relocation<std::uint32_t*> tlsIndex{ Offset::TlsIndex };
auto tlsDataArray = reinterpret_cast<TLSData**>(__readgsqword(0x58));
static REL::Relocation<std::uint32_t*> tlsIndex{ Offset::TlsIndex };
auto tlsDataArray = reinterpret_cast<TLSData**>(__readgsqword(0x58));
return tlsDataArray[*tlsIndex];
}
}
2 changes: 1 addition & 1 deletion include/RE/V/VATS.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace RE

[[nodiscard]] static VATS* GetSingleton()
{
REL::Relocation<VATS**> singleton{ RELOCATION_ID(514725, 400883) };
static REL::Relocation<VATS**> singleton{ RELOCATION_ID(514725, 400883) };
return *singleton;
}

Expand Down
Loading

0 comments on commit bd9cb72

Please sign in to comment.