From 2a11cdf783dadaa62b7f963d55c1efa01665801d Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:38:15 -0500 Subject: [PATCH 1/9] feat: `GetPrivateProfileInt` --- CommonLibF4/include/REX/W32/KERNEL32.h | 2 ++ CommonLibF4/src/REX/W32.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CommonLibF4/include/REX/W32/KERNEL32.h b/CommonLibF4/include/REX/W32/KERNEL32.h index ce6cb50f..84141142 100644 --- a/CommonLibF4/include/REX/W32/KERNEL32.h +++ b/CommonLibF4/include/REX/W32/KERNEL32.h @@ -488,6 +488,8 @@ namespace REX::W32 std::uint32_t GetModuleFileNameW(HMODULE a_module, wchar_t* a_name, std::uint32_t a_nameLen) noexcept; HMODULE GetModuleHandleA(const char* a_name) noexcept; HMODULE GetModuleHandleW(const wchar_t* a_name) noexcept; + std::uint32_t GetPrivateProfileIntA(const char* a_app, const char* a_key, std::int32_t a_default, const char* a_name) noexcept; + std::uint32_t GetPrivateProfileIntW(const wchar_t* a_app, const wchar_t* a_key, std::int32_t a_default, const wchar_t* a_name) noexcept; std::uint32_t GetPrivateProfileStringA(const char* a_app, const char* a_key, const char* a_default, char* a_buf, std::uint32_t a_bufLen, const char* a_name) noexcept; std::uint32_t GetPrivateProfileStringW(const wchar_t* a_app, const wchar_t* a_key, const wchar_t* a_default, wchar_t* a_buf, std::uint32_t a_bufLen, const wchar_t* a_name) noexcept; void* GetProcAddress(HMODULE a_module, const char* a_name) noexcept; diff --git a/CommonLibF4/src/REX/W32.cpp b/CommonLibF4/src/REX/W32.cpp index 82572f3c..3b98e7fb 100644 --- a/CommonLibF4/src/REX/W32.cpp +++ b/CommonLibF4/src/REX/W32.cpp @@ -321,6 +321,8 @@ REX_W32_IMPORT(std::uint32_t, GetModuleFileNameA, REX::W32::HMODULE, char*, std: REX_W32_IMPORT(std::uint32_t, GetModuleFileNameW, REX::W32::HMODULE, wchar_t*, std::uint32_t); REX_W32_IMPORT(REX::W32::HMODULE, GetModuleHandleA, const char*); REX_W32_IMPORT(REX::W32::HMODULE, GetModuleHandleW, const wchar_t*); +REX_W32_IMPORT(std::uint32_t, GetPrivateProfileIntA, const char*, const char*, std::int32_t, const char*); +REX_W32_IMPORT(std::uint32_t, GetPrivateProfileIntW, const wchar_t*, const wchar_t*, std::int32_t, const wchar_t*); REX_W32_IMPORT(std::uint32_t, GetPrivateProfileStringA, const char*, const char*, const char*, char*, std::uint32_t, const char*); REX_W32_IMPORT(std::uint32_t, GetPrivateProfileStringW, const wchar_t*, const wchar_t*, const wchar_t*, wchar_t*, std::uint32_t, const wchar_t*); REX_W32_IMPORT(void*, GetProcAddress, REX::W32::HMODULE, const char*); @@ -535,6 +537,16 @@ namespace REX::W32 return ::W32_IMPL_GetModuleHandleW(a_name); } + std::uint32_t GetPrivateProfileIntA(const char* a_app, const char* a_key, std::int32_t a_default, const char* a_name) noexcept + { + return ::W32_IMPL_GetPrivateProfileIntA(a_app, a_key, a_default, a_name); + } + + std::uint32_t GetPrivateProfileIntW(const wchar_t* a_app, const wchar_t* a_key, std::int32_t a_default, const wchar_t* a_name) noexcept + { + return ::W32_IMPL_GetPrivateProfileIntW(a_app, a_key, a_default, a_name); + } + std::uint32_t GetPrivateProfileStringA(const char* a_app, const char* a_key, const char* a_default, char* a_buf, std::uint32_t a_bufLen, const char* a_name) noexcept { return ::W32_IMPL_GetPrivateProfileStringA(a_app, a_key, a_default, a_buf, a_bufLen, a_name); From b2fb0bb26d6cd269c76dc83a5f4bda7816de4690 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:39:58 -0500 Subject: [PATCH 2/9] feat: improve `BSTimer` --- CommonLibF4/include/RE/Bethesda/BSTimer.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/BSTimer.h b/CommonLibF4/include/RE/Bethesda/BSTimer.h index 13743bd6..93045806 100644 --- a/CommonLibF4/include/RE/Bethesda/BSTimer.h +++ b/CommonLibF4/include/RE/Bethesda/BSTimer.h @@ -5,28 +5,28 @@ namespace RE class BSTimer { public: - [[nodiscard]] static BSTimer GetSingleton() + [[nodiscard]] static BSTimer* GetSingleton() { - REL::Relocation singleton{ REL::ID(2703179) }; - return *singleton; + static REL::Relocation singleton{ REL::ID(2703179) }; + return singleton.get(); } - static float QGlobalTimeMultiplier() + [[nodiscard]] static float QGlobalTimeMultiplier() { - REL::Relocation value{ REL::ID(365546) }; + static REL::Relocation value{ REL::ID(2666307) }; return *value; } - static float QGlobalTimeMultiplierTarget() + [[nodiscard]] static float QGlobalTimeMultiplierTarget() { - REL::Relocation value{ REL::ID(1266509) }; + static REL::Relocation value{ REL::ID(2666308) }; return *value; } void SetGlobalTimeMultiplier(float a_mult, bool a_now) { using func_t = decltype(&BSTimer::SetGlobalTimeMultiplier); - REL::Relocation func{ REL::ID(2267970) }; + static REL::Relocation func{ REL::ID(2267970) }; return func(this, a_mult, a_now); } From a78075e9f64406722da87b3db408ee5bb7222cba Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:40:44 -0500 Subject: [PATCH 3/9] feat: improve `Main` --- CommonLibF4/include/RE/Bethesda/Main.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/Main.h b/CommonLibF4/include/RE/Bethesda/Main.h index a6a3cdc0..a7b53467 100644 --- a/CommonLibF4/include/RE/Bethesda/Main.h +++ b/CommonLibF4/include/RE/Bethesda/Main.h @@ -29,22 +29,34 @@ namespace RE public: virtual ~Main(); // 00 - // override - virtual BSEventNotifyControl ProcessEvent(const PositionPlayerEvent& a_event, BSTEventSource* a_source) override; // 01 - [[nodiscard]] static Main* GetSingleton() { - REL::Relocation singleton{ REL::ID(2698043) }; + static REL::Relocation singleton{ REL::ID(2698043) }; return *singleton; } + // override + virtual BSEventNotifyControl ProcessEvent(const PositionPlayerEvent& a_event, BSTEventSource* a_source) override; // 01 + [[nodiscard]] static NiCamera* WorldRootCamera() { using func_t = decltype(&Main::WorldRootCamera); - REL::Relocation func{ REL::ID(2228956) }; + static REL::Relocation func{ REL::ID(2228956) }; return func(); } + [[nodiscard]] static bool QGameSystemsShouldUpdate() + { + static REL::Relocation singleton{ REL::ID(2698031) }; + return *singleton; + } + + [[nodiscard]] static bool QGameDataLoaded() + { + static REL::Relocation singleton{ REL::ID(2698032) }; + return *singleton; + } + // members BSTArray>> sortedVisibleHighActors; // 08 std::uint32_t localMapRenderDelay; // 20 From 5a1915ccab8221151520bd26ca4caf716b27b738 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:43:07 -0500 Subject: [PATCH 4/9] feat: improve `Actor` --- CommonLibF4/include/RE/Bethesda/Actor.h | 122 +++++++++++++----------- 1 file changed, 68 insertions(+), 54 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/Actor.h b/CommonLibF4/include/RE/Bethesda/Actor.h index f471e56b..892e06cb 100644 --- a/CommonLibF4/include/RE/Bethesda/Actor.h +++ b/CommonLibF4/include/RE/Bethesda/Actor.h @@ -259,7 +259,7 @@ namespace RE void SetupFireSounds(Actor& a_actor, BGSObjectInstanceT& a_weapon) { using func_t = decltype(&EquippedWeaponData::SetupFireSounds); - REL::Relocation func{ REL::ID(2232275) }; + static REL::Relocation func{ REL::ID(2232275) }; return func(this, a_actor, a_weapon); } @@ -491,35 +491,35 @@ namespace RE [[nodiscard]] TESAmmo* GetCurrentAmmo(BGSEquipIndex a_equipIndex) const { using func_t = decltype(&AIProcess::GetCurrentAmmo); - REL::Relocation func{ REL::ID(2232300) }; + static REL::Relocation func{ REL::ID(2232300) }; return func(this, a_equipIndex); } COMMAND_TYPE GetCommandType() { using func_t = decltype(&AIProcess::GetCommandType); - REL::Relocation func{ REL::ID(2231825) }; + static REL::Relocation func{ REL::ID(2231825) }; return func(this); } [[nodiscard]] ObjectRefHandle GetOccupiedFurniture() { using func_t = decltype(&AIProcess::GetOccupiedFurniture); - REL::Relocation func{ REL::ID(2232401) }; + static REL::Relocation func{ REL::ID(2232401) }; return func(this); } bool IsWeaponSubgraphFinishedLoading(const Actor& a_actor) { using func_t = decltype(&AIProcess::IsWeaponSubgraphFinishedLoading); - REL::Relocation func{ REL::ID(2231757) }; + static REL::Relocation func{ REL::ID(2231757) }; return func(this, a_actor); } void KnockExplosion(Actor* a_actor, const NiPoint3& a_location, float a_magnitude) { using func_t = decltype(&AIProcess::KnockExplosion); - REL::Relocation func{ REL::ID(533106) }; + static REL::Relocation func{ REL::ID(533106) }; return func(this, a_actor, a_location, a_magnitude); } @@ -531,63 +531,63 @@ namespace RE bool ProcessGreet(Actor* a_actor, DIALOGUE_TYPE a_type, DIALOGUE_SUBTYPE a_subType, TESObjectREFR* a_target, BGSDialogueBranch* a_branch, bool a_forceSub, bool a_stop, bool a_que, bool a_sayCallback) { using func_t = decltype(&AIProcess::ProcessGreet); - REL::Relocation func{ REL::ID(2231808) }; + static REL::Relocation func{ REL::ID(2231808) }; return func(this, a_actor, a_type, a_subType, a_target, a_branch, a_forceSub, a_stop, a_que, a_sayCallback); } bool RequestLoadAnimationsForWeaponChange(Actor& a_actor) { using func_t = decltype(&AIProcess::RequestLoadAnimationsForWeaponChange); - REL::Relocation func{ REL::ID(666002) }; + static REL::Relocation func{ REL::ID(666002) }; return func(this, a_actor); } void SetActorsDetectionEvent(Actor* a_actor, const NiPoint3& a_location, std::int32_t a_soundLevel, TESObjectREFR* a_refr) { using func_t = decltype(&AIProcess::SetActorsDetectionEvent); - REL::Relocation func{ REL::ID(2231738) }; + static REL::Relocation func{ REL::ID(2231738) }; return func(this, a_actor, a_location, a_soundLevel, a_refr); } void SetCurrentAmmo(BGSEquipIndex a_equipIndex, TESAmmo* a_ammo) { using func_t = decltype(&AIProcess::SetCurrentAmmo); - REL::Relocation func{ REL::ID(2232302) }; + static REL::Relocation func{ REL::ID(2232302) }; return func(this, a_equipIndex, a_ammo); } void SetCommandType(COMMAND_TYPE a_type) { using func_t = decltype(&AIProcess::SetCommandType); - REL::Relocation func{ REL::ID(1555789) }; + static REL::Relocation func{ REL::ID(1555789) }; return func(this, a_type); } void SetEquippedItem(Actor* a_actor, const BGSObjectInstance& a_instance, const BGSEquipSlot* a_slot) { using func_t = decltype(&AIProcess::SetEquippedItem); - REL::Relocation func{ REL::ID(1200276) }; + static REL::Relocation func{ REL::ID(1200276) }; return func(this, a_actor, a_instance, a_slot); } bool SetupSpecialIdle(Actor& a_actor, RE::DEFAULT_OBJECT a_defaultObject, TESIdleForm* a_idle, bool a_testConditions, TESObjectREFR* a_targetOverride) { using func_t = decltype(&AIProcess::SetupSpecialIdle); - REL::Relocation func{ REL::ID(1446774) }; + static REL::Relocation func{ REL::ID(1446774) }; return func(this, a_actor, a_defaultObject, a_idle, a_testConditions, a_targetOverride); } bool SetWeaponBonesCulled(const Actor& a_actor, bool a_stateToSet, WEAPON_CULL_TYPE a_weaponCullType) { using func_t = decltype(&AIProcess::SetWeaponBonesCulled); - REL::Relocation func{ REL::ID(2232535) }; + static REL::Relocation func{ REL::ID(2232535) }; return func(this, a_actor, a_stateToSet, a_weaponCullType); } void StopCurrentIdle(Actor* a_actor, bool a_instant, bool a_killFlavor) { using func_t = decltype(&AIProcess::StopCurrentIdle); - REL::Relocation func{ REL::ID(2231705) }; + static REL::Relocation func{ REL::ID(2231705) }; return func(this, a_actor, a_instant, a_killFlavor); } @@ -660,14 +660,14 @@ namespace RE [[nodiscard]] bool IsTakingHealthDamageFromActiveEffect() { using func_t = decltype(&MagicTarget::IsTakingHealthDamageFromActiveEffect); - REL::Relocation func{ REL::ID(2226397) }; + static REL::Relocation func{ REL::ID(2226397) }; return func(this); } [[nodiscard]] bool IsTakingRadDamageFromActiveEffect() { using func_t = decltype(&MagicTarget::IsTakingRadDamageFromActiveEffect); - REL::Relocation func{ REL::ID(2226398) }; + static REL::Relocation func{ REL::ID(2226398) }; return func(this); } @@ -795,6 +795,14 @@ namespace RE }; static_assert(sizeof(ActorValueStorage) == 0x38); + enum class ACTOR_VISIBILITY_MASK : std::uint32_t + { + kFrustrum = 1 << 0, + kOcclusion = 1 << 1, + kFaded = 1 << 2, + kAll = kFrustrum | kOcclusion | kFaded, + }; + class __declspec(novtable) Actor : public TESObjectREFR, // 000 public MagicTarget, // 110 @@ -977,63 +985,63 @@ namespace RE void AddPerk(BGSPerk* a_perk, std::uint8_t a_rank = 0) { using func_t = decltype(&Actor::AddPerk); - REL::Relocation func{ REL::ID(2230121) }; + static REL::Relocation func{ REL::ID(2230121) }; return func(this, a_perk, a_rank); } bool CanUseIdle(TESIdleForm* a_idle) const { using func_t = decltype(&Actor::CanUseIdle); - REL::Relocation func{ REL::ID(2229592) }; + static REL::Relocation func{ REL::ID(2229592) }; return func(this, a_idle); } void ClearAttackStates() { using func_t = decltype(&Actor::ClearAttackStates); - REL::Relocation func{ REL::ID(2229773) }; + static REL::Relocation func{ REL::ID(2229773) }; return func(this); } void EndInterruptPackage(bool a_notRunOnceDialogue) { using func_t = decltype(&Actor::EndInterruptPackage); - REL::Relocation func{ REL::ID(2229892) }; + static REL::Relocation func{ REL::ID(2229892) }; return func(this, a_notRunOnceDialogue); } void ExitCover() { using func_t = decltype(&Actor::ExitCover); - REL::Relocation func{ REL::ID(770035) }; + static REL::Relocation func{ REL::ID(770035) }; return func(this); } void GetAimVector(NiPoint3& a_aimVector) { using func_t = decltype(&Actor::GetAimVector); - REL::Relocation func{ REL::ID(554863) }; + static REL::Relocation func{ REL::ID(554863) }; return func(this, a_aimVector); } NiAVObject* GetClosestBone(NiPoint3 a_impactLocation, NiPoint3 a_movementDirection) { using func_t = decltype(&Actor::GetClosestBone); - REL::Relocation func{ REL::ID(1180004) }; + static REL::Relocation func{ REL::ID(1180004) }; return func(this, a_impactLocation, a_movementDirection); } CFilter GetCollisionFilter() { using func_t = decltype(&Actor::GetCollisionFilter); - REL::Relocation func{ REL::ID(1474995) }; + static REL::Relocation func{ REL::ID(1474995) }; return func(this); } TESCombatStyle* GetCombatStyle() { using func_t = decltype(&Actor::GetCombatStyle); - REL::Relocation func{ REL::ID(2231053) }; + static REL::Relocation func{ REL::ID(2231053) }; return func(this); } @@ -1045,42 +1053,42 @@ namespace RE std::uint32_t GetCurrentCollisionGroup() { using func_t = decltype(&Actor::GetCurrentCollisionGroup); - REL::Relocation func{ REL::ID(410500) }; + static REL::Relocation func{ REL::ID(410500) }; return func(this); } bool GetCurrentFireLocation(BGSEquipIndex a_index, NiPoint3& a_fireLocation) { using func_t = decltype(&Actor::GetCurrentFireLocation); - REL::Relocation func{ REL::ID(663107) }; + static REL::Relocation func{ REL::ID(663107) }; return func(this, a_index, a_fireLocation); } float GetDesiredSpeed() { using func_t = decltype(&Actor::GetDesiredSpeed); - REL::Relocation func{ REL::ID(2230410) }; + static REL::Relocation func{ REL::ID(2230410) }; return func(this); } [[nodiscard]] bool GetHostileToActor(Actor* a_actor) { using func_t = decltype(&Actor::GetHostileToActor); - REL::Relocation func{ REL::ID(2229968) }; + static REL::Relocation func{ REL::ID(2229968) }; return func(this, a_actor); } [[nodiscard]] ActorHandle GetMountHandle() { using func_t = decltype(&Actor::GetMountHandle); - REL::Relocation func{ REL::ID(2231230) }; + static REL::Relocation func{ REL::ID(2231230) }; return func(this); } [[nodiscard]] std::int16_t GetLevel() { using func_t = decltype(&Actor::GetLevel); - REL::Relocation func{ REL::ID(2229734) }; + static REL::Relocation func{ REL::ID(2229734) }; return func(this); } @@ -1089,112 +1097,118 @@ namespace RE [[nodiscard]] std::uint8_t GetPerkRank(BGSPerk* a_perk) { using func_t = decltype(&Actor::GetPerkRank); - REL::Relocation func{ REL::ID(2230125) }; + static REL::Relocation func{ REL::ID(2230125) }; return func(this, a_perk); } void HandleDefaultAnimationSwitch() { using func_t = decltype(&Actor::HandleDefaultAnimationSwitch); - REL::Relocation func{ REL::ID(2229780) }; + static REL::Relocation func{ REL::ID(2229780) }; return func(this); } void HandleItemEquip(bool bCullBone) { using func_t = decltype(&Actor::HandleItemEquip); - REL::Relocation func{ REL::ID(2229781) }; + static REL::Relocation func{ REL::ID(2229781) }; return func(this, bCullBone); } void InitiateDoNothingPackage() { using func_t = decltype(&Actor::InitiateDoNothingPackage); - REL::Relocation func{ REL::ID(2229807) }; + static REL::Relocation func{ REL::ID(2229807) }; return func(this); } bool IsCrippled() { using func_t = decltype(&Actor::IsCrippled); - REL::Relocation func{ REL::ID(1238666) }; + static REL::Relocation func{ REL::ID(1238666) }; return func(this); } bool IsFollowing() { using func_t = decltype(&Actor::IsFollowing); - REL::Relocation func{ REL::ID(2230013) }; + static REL::Relocation func{ REL::ID(2230013) }; return func(this); } [[nodiscard]] bool IsJumping() { using func_t = decltype(&Actor::IsJumping); - REL::Relocation func{ REL::ID(2229640) }; + static REL::Relocation func{ REL::ID(2229640) }; return func(this); } bool IsPathValid() { using func_t = decltype(&Actor::IsPathValid); - REL::Relocation func{ REL::ID(2230279) }; + static REL::Relocation func{ REL::ID(2230279) }; return func(this); } bool IsPathing() { using func_t = decltype(&Actor::IsPathing); - REL::Relocation func{ REL::ID(2234312) }; + static REL::Relocation func{ REL::ID(2234312) }; return func(this); } bool IsPathingComplete() { using func_t = decltype(&Actor::IsPathingComplete); - REL::Relocation func{ REL::ID(817283) }; + static REL::Relocation func{ REL::ID(817283) }; return func(this); } bool IsQuadruped() { using func_t = decltype(&Actor::IsQuadruped); - REL::Relocation func{ REL::ID(1552322) }; + static REL::Relocation func{ REL::ID(1552322) }; return func(this); } + bool IsVisible() const + { + constexpr auto all = std::to_underlying(ACTOR_VISIBILITY_MASK::kAll); + return ((visFlags & all) & 0xF) == all; + } + bhkCharacterController* Move(float a_deltaTime, NiPoint3 a_deltaPos, bool a_defer) { using func_t = decltype(&Actor::Move); - REL::Relocation func{ REL::ID(737625) }; + static REL::Relocation func{ REL::ID(737625) }; return func(this, a_deltaTime, a_deltaPos, a_defer); } bool PerformAction(BGSAction* a_action, TESObjectREFR* a_target) { using func_t = decltype(&Actor::PerformAction); - REL::Relocation func{ REL::ID(1057231) }; + static REL::Relocation func{ REL::ID(1057231) }; return func(this, a_action, a_target); } void RemovePerk(BGSPerk* a_perk) { using func_t = decltype(&Actor::RemovePerk); - REL::Relocation func{ REL::ID(1316475) }; + static REL::Relocation func{ REL::ID(1316475) }; return func(this, a_perk); } void Reset3D(bool a_reloadAll, std::uint32_t a_additionalFlags, bool a_queueReset, std::uint32_t a_excludeFlags) { using func_t = decltype(&Actor::Reset3D); - REL::Relocation func{ REL::ID(302888) }; + static REL::Relocation func{ REL::ID(302888) }; return func(this, a_reloadAll, a_additionalFlags, a_queueReset, a_excludeFlags); } void RewardExperience(float a_amount, bool a_direct, TESObjectREFR* a_actionTarget, TESObjectREFR* a_killWeapon) { using func_t = decltype(&Actor::RewardExperience); - REL::Relocation func{ REL::ID(2230428) }; + static REL::Relocation func{ REL::ID(2230428) }; return func(this, a_amount, a_direct, a_actionTarget, a_killWeapon); } @@ -1208,21 +1222,21 @@ namespace RE void SetGunState(GUN_STATE a_gunState, bool a_val = true) { using func_t = decltype(&Actor::SetGunState); - REL::Relocation func{ REL::ID(2231175) }; + static REL::Relocation func{ REL::ID(2231175) }; return func(this, a_gunState, a_val); } void SetHeading(float a_angle) { using func_t = decltype(&Actor::SetHeading); - REL::Relocation func{ REL::ID(2229625) }; + static REL::Relocation func{ REL::ID(2229625) }; return func(this, a_angle); } void TrespassAlarm(TESObjectREFR* a_refr, TESForm* a_owner, std::int32_t a_crime) { using func_t = decltype(&Actor::TrespassAlarm); - REL::Relocation func{ REL::ID(2229834) }; + static REL::Relocation func{ REL::ID(2229834) }; return func(this, a_refr, a_owner, a_crime); } @@ -1290,7 +1304,7 @@ namespace RE public: [[nodiscard]] static ActorEquipManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(2690994) }; + static REL::Relocation singleton{ REL::ID(2690994) }; return *singleton; } @@ -1307,7 +1321,7 @@ namespace RE bool a_locked) { using func_t = decltype(&ActorEquipManager::EquipObject); - REL::Relocation func{ REL::ID(2231392) }; + static REL::Relocation func{ REL::ID(2231392) }; return func(this, a_actor, a_object, a_stackID, a_number, a_slot, a_queueEquip, a_forceEquip, a_playSounds, a_applyNow, a_locked); } @@ -1324,7 +1338,7 @@ namespace RE const BGSEquipSlot* a_slotBeingReplaced) { using func_t = decltype(&ActorEquipManager::UnequipObject); - REL::Relocation func{ REL::ID(2231395) }; + static REL::Relocation func{ REL::ID(2231395) }; return func(this, a_actor, a_object, a_number, a_slot, a_stackID, a_queueEquip, a_forceEquip, a_playSounds, a_applyNow, a_slotBeingReplaced); } }; From 475de714a8d8f5d14e3a1cb47c75a4b19efc444e Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:45:09 -0500 Subject: [PATCH 5/9] feat: improve `NiPoint` & `NiMatrix` --- CommonLibF4/include/RE/NetImmerse/NiMatrix3.h | 128 +++++------ CommonLibF4/include/RE/NetImmerse/NiPoint2.h | 47 +++- CommonLibF4/include/RE/NetImmerse/NiPoint3.h | 97 +++++---- CommonLibF4/include/RE/NetImmerse/NiPoint4.h | 70 ++++-- CommonLibF4/src/RE/NetImmerse/NiMatrix3.cpp | 203 ++++++++++++++++++ CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp | 133 ++++++++++++ CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp | 135 ++++++++---- CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp | 161 ++++++++++++++ 8 files changed, 800 insertions(+), 174 deletions(-) create mode 100644 CommonLibF4/src/RE/NetImmerse/NiMatrix3.cpp create mode 100644 CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp create mode 100644 CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp diff --git a/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h b/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h index 9b06df0f..0839191e 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h +++ b/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h @@ -1,5 +1,6 @@ #pragma once +#include "RE/NetImmerse/NiPoint3.h" #include "RE/NetImmerse/NiPoint4.h" namespace RE @@ -7,87 +8,62 @@ namespace RE class alignas(0x10) NiMatrix3 { public: - void MakeIdentity() noexcept - { - entry[0].v = { 1.0F, 0.0F, 0.0F, 0.0F }; - entry[1].v = { 0.0F, 1.0F, 0.0F, 0.0F }; - entry[2].v = { 0.0F, 0.0F, 1.0F, 0.0F }; - } + static const NiMatrix3 ZERO; + static const NiMatrix3 IDENTITY; - // members - NiPoint4 entry[3]; // 00 + NiMatrix3() noexcept = default; + NiMatrix3(const NiPoint4& a_point0, const NiPoint4& a_point1, const NiPoint4& a_point2) noexcept; + NiMatrix3( + float a_x0, float a_y0, float a_z0, float a_w0, + float a_x1, float a_y1, float a_z1, float a_w1, + float a_x2, float a_y2, float a_z2, float a_w2) noexcept; + + NiPoint4& operator[](std::size_t a_pos) noexcept; + const NiPoint4& operator[](std::size_t a_pos) const noexcept; + bool operator==(const NiMatrix3& a_rhs) const noexcept; + bool operator!=(const NiMatrix3& a_rhs) const noexcept; - NiMatrix3 operator*(const NiMatrix3& rhs) const - { - NiMatrix3 tmp; - tmp.entry[0].pt[0] = - entry[0].pt[0] * rhs.entry[0].pt[0] + - entry[0].pt[1] * rhs.entry[1].pt[0] + - entry[0].pt[2] * rhs.entry[2].pt[0]; - tmp.entry[1].pt[0] = - entry[1].pt[0] * rhs.entry[0].pt[0] + - entry[1].pt[1] * rhs.entry[1].pt[0] + - entry[1].pt[2] * rhs.entry[2].pt[0]; - tmp.entry[2].pt[0] = - entry[2].pt[0] * rhs.entry[0].pt[0] + - entry[2].pt[1] * rhs.entry[1].pt[0] + - entry[2].pt[2] * rhs.entry[2].pt[0]; - tmp.entry[0].pt[1] = - entry[0].pt[0] * rhs.entry[0].pt[1] + - entry[0].pt[1] * rhs.entry[1].pt[1] + - entry[0].pt[2] * rhs.entry[2].pt[1]; - tmp.entry[1].pt[1] = - entry[1].pt[0] * rhs.entry[0].pt[1] + - entry[1].pt[1] * rhs.entry[1].pt[1] + - entry[1].pt[2] * rhs.entry[2].pt[1]; - tmp.entry[2].pt[1] = - entry[2].pt[0] * rhs.entry[0].pt[1] + - entry[2].pt[1] * rhs.entry[1].pt[1] + - entry[2].pt[2] * rhs.entry[2].pt[1]; - tmp.entry[0].pt[2] = - entry[0].pt[0] * rhs.entry[0].pt[2] + - entry[0].pt[1] * rhs.entry[1].pt[2] + - entry[0].pt[2] * rhs.entry[2].pt[2]; - tmp.entry[1].pt[2] = - entry[1].pt[0] * rhs.entry[0].pt[2] + - entry[1].pt[1] * rhs.entry[1].pt[2] + - entry[1].pt[2] * rhs.entry[2].pt[2]; - tmp.entry[2].pt[2] = - entry[2].pt[0] * rhs.entry[0].pt[2] + - entry[2].pt[1] * rhs.entry[1].pt[2] + - entry[2].pt[2] * rhs.entry[2].pt[2]; - return tmp; - } + NiMatrix3 operator*(const NiMatrix3& a_rhs) const noexcept; + NiMatrix3 operator*(float a_scalar) const noexcept; + NiPoint3 operator*(const NiPoint3& a_rhs) const noexcept; - NiMatrix3 operator*(float scalar) const - { - NiMatrix3 result; - result.entry[0].pt[0] = entry[0].pt[0] * scalar; - result.entry[0].pt[1] = entry[0].pt[1] * scalar; - result.entry[0].pt[2] = entry[0].pt[2] * scalar; - result.entry[1].pt[0] = entry[1].pt[0] * scalar; - result.entry[1].pt[1] = entry[1].pt[1] * scalar; - result.entry[1].pt[2] = entry[1].pt[2] * scalar; - result.entry[2].pt[0] = entry[2].pt[0] * scalar; - result.entry[2].pt[1] = entry[2].pt[1] * scalar; - result.entry[2].pt[2] = entry[2].pt[2] * scalar; - return result; - } + void MakeIdentity() noexcept; + NiMatrix3 Transpose() const noexcept; - NiPoint3 operator*(const NiPoint3& p) const - { - return NiPoint3( - entry[0].pt[0] * p.x + entry[0].pt[1] * p.y + entry[0].pt[2] * p.z, - entry[1].pt[0] * p.x + entry[1].pt[1] * p.y + entry[1].pt[2] * p.z, - entry[2].pt[0] * p.x + entry[2].pt[1] * p.y + entry[2].pt[2] * p.z); - } + bool ToEulerAnglesXYZ(NiPoint3& a_point) const; + bool ToEulerAnglesXYZ(float& a_x, float& a_y, float& a_z) const; + bool ToEulerAnglesXZY(float& a_x, float& a_z, float& a_y) const; + bool ToEulerAnglesYXZ(float& a_y, float& a_x, float& a_z) const; + bool ToEulerAnglesYZX(float& a_y, float& a_z, float& a_x) const; + bool ToEulerAnglesZYX(float& a_z, float& a_y, float& a_x) const; + bool ToEulerAnglesZXY(float& a_z, float& a_y, float& a_x) const; - bool ToEulerAnglesXYZ(float& x, float& y, float& z) - { - using func_t = decltype(&NiMatrix3::ToEulerAnglesXYZ); - REL::Relocation func{ REL::ID(2269806) }; - return func(this, x, y, z); - } + void FromEulerAnglesXYZ(const NiPoint3& a_point); + void FromEulerAnglesXYZ(float a_x, float a_y, float a_z); + void FromEulerAnglesXZY(float a_x, float a_z, float a_y); + void FromEulerAnglesYXZ(float a_y, float a_x, float a_z); + void FromEulerAnglesYZX(float a_y, float a_z, float a_x); + void FromEulerAnglesZYX(float a_z, float a_y, float a_x); + void FromEulerAnglesZXY(float a_z, float a_x, float a_y); + + // members + NiPoint4 entry[3]; // 00 }; static_assert(sizeof(NiMatrix3) == 0x30); } + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::NiMatrix3& a_matrix, FormatContext& a_ctx) const + { + return format_to(a_ctx.out(), "[{}, {}, {}]", a_matrix[0], a_matrix[1], a_matrix[2]); + } +}; diff --git a/CommonLibF4/include/RE/NetImmerse/NiPoint2.h b/CommonLibF4/include/RE/NetImmerse/NiPoint2.h index 80a74814..b0f5d065 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiPoint2.h +++ b/CommonLibF4/include/RE/NetImmerse/NiPoint2.h @@ -5,9 +5,52 @@ namespace RE class NiPoint2 { public: + static const NiPoint2 ZERO; + + NiPoint2() noexcept = default; + NiPoint2(float a_x, float a_y) noexcept; + + float& operator[](std::size_t a_pos) noexcept; + const float& operator[](std::size_t a_pos) const noexcept; + bool operator==(const NiPoint2& a_rhs) const noexcept; + bool operator!=(const NiPoint2& a_rhs) const noexcept; + bool operator<(const NiPoint2& a_rhs) const noexcept; + bool operator>(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator+(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator-(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator*(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator/(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator*(float a_scalar) const noexcept; + NiPoint2 operator/(float a_scalar) const noexcept; + NiPoint2 operator-() const noexcept; + NiPoint2& operator+=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator-=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator*=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator/=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator+=(float a_scalar) noexcept; + NiPoint2& operator-=(float a_scalar) noexcept; + NiPoint2& operator*=(float a_scalar) noexcept; + NiPoint2& operator/=(float a_scalar) noexcept; + // members - float x; - float y; + float x{ 0.0F }; // 00 + float y{ 0.0F }; // 04 }; static_assert(sizeof(NiPoint2) == 0x8); } + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::NiPoint2& a_point, FormatContext& a_ctx) const + { + return format_to(a_ctx.out(), "({}, {})", a_point.x, a_point.y); + } +}; diff --git a/CommonLibF4/include/RE/NetImmerse/NiPoint3.h b/CommonLibF4/include/RE/NetImmerse/NiPoint3.h index e8e541e2..62cca0eb 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiPoint3.h +++ b/CommonLibF4/include/RE/NetImmerse/NiPoint3.h @@ -1,48 +1,54 @@ #pragma once +#include "RE/NetImmerse/NiPoint2.h" + namespace RE { class NiPoint3 { public: - using value_type = float; - using size_type = std::size_t; - using reference = value_type&; - using const_reference = const value_type&; - using pointer = value_type*; - using const_pointer = const value_type*; - - reference operator[](size_type a_pos) noexcept; - const_reference operator[](size_type a_pos) const noexcept; - bool operator==(const NiPoint3& a_rhs) const; - bool operator!=(const NiPoint3& a_rhs) const; - NiPoint3 operator+(const NiPoint3& a_rhs) const; - NiPoint3 operator-(const NiPoint3& a_rhs) const; - float operator*(const NiPoint3& a_rhs) const; - NiPoint3 operator*(float a_scalar) const; - NiPoint3 operator/(float a_scalar) const; - NiPoint3 operator-() const; - NiPoint3& operator+=(const NiPoint3& a_rhs); - NiPoint3& operator-=(const NiPoint3& a_rhs); - NiPoint3& operator*=(const NiPoint3& a_rhs); - NiPoint3& operator/=(const NiPoint3& a_rhs); - NiPoint3& operator*=(float a_scalar); - NiPoint3& operator/=(float a_scalar); - - [[nodiscard]] NiPoint3 Cross(const NiPoint3& pt) const; - [[nodiscard]] float Dot(const NiPoint3& pt) const; - [[nodiscard]] float GetDistance(const NiPoint3& a_pt) const noexcept; - [[nodiscard]] float GetSquaredDistance(const NiPoint3& a_pt) const noexcept; - [[nodiscard]] float Length() const; - [[nodiscard]] float SqrLength() const; - [[nodiscard]] NiPoint3 UnitCross(const NiPoint3& a_pt) const; - [[nodiscard]] float GetZAngleFromVector(); - float Unitize(); + static const NiPoint3 ZERO; + + NiPoint3() noexcept = default; + NiPoint3(const NiPoint2& a_point) noexcept; + NiPoint3(float a_x, float a_y, float a_z) noexcept; + + float& operator[](std::size_t a_pos) noexcept; + const float& operator[](std::size_t a_pos) const noexcept; + bool operator==(const NiPoint3& a_rhs) const noexcept; + bool operator!=(const NiPoint3& a_rhs) const noexcept; + bool operator<(const NiPoint3& a_rhs) const noexcept; + bool operator>(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator+(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator-(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator*(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator/(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator*(float a_scalar) const noexcept; + NiPoint3 operator/(float a_scalar) const noexcept; + NiPoint3 operator-() const noexcept; + NiPoint3& operator+=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator-=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator*=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator/=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator+=(float a_scalar) noexcept; + NiPoint3& operator-=(float a_scalar) noexcept; + NiPoint3& operator*=(float a_scalar) noexcept; + NiPoint3& operator/=(float a_scalar) noexcept; + + [[nodiscard]] NiPoint3 Cross(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float Dot(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float GetDistance(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float GetSquaredDistance(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float GetZAngleFromVector() const; + [[nodiscard]] float Length() const noexcept; + [[nodiscard]] float SqrLength() const noexcept; + [[nodiscard]] NiPoint3 UnitCross(const NiPoint3& a_point) const noexcept; + float Unitize() noexcept; // members - value_type x{ 0.0F }; // 0 - value_type y{ 0.0F }; // 4 - value_type z{ 0.0F }; // 8 + float x{ 0.0F }; // 00 + float y{ 0.0F }; // 04 + float z{ 0.0F }; // 08 }; static_assert(sizeof(NiPoint3) == 0xC); @@ -50,6 +56,25 @@ namespace RE public NiPoint3 { public: + static const NiPoint3A ZERO; + + using NiPoint3::NiPoint3; }; static_assert(sizeof(NiPoint3A) == 0x10); } + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::NiPoint3& a_point, FormatContext& a_ctx) const + { + return format_to(a_ctx.out(), "({}, {}, {})", a_point.x, a_point.y, a_point.z); + } +}; diff --git a/CommonLibF4/include/RE/NetImmerse/NiPoint4.h b/CommonLibF4/include/RE/NetImmerse/NiPoint4.h index 1a82cae4..3e93ec61 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiPoint4.h +++ b/CommonLibF4/include/RE/NetImmerse/NiPoint4.h @@ -1,27 +1,67 @@ #pragma once +#include "RE/NetImmerse/NiPoint2.h" +#include "RE/NetImmerse/NiPoint3.h" + namespace RE { class NiPoint4 { public: - struct NiPoint4Struct - { - public: - // members - float x; // 00 - float y; // 04 - float z; // 08 - float w; // 0C - }; - static_assert(sizeof(NiPoint4Struct) == 0x10); + static const NiPoint4 ZERO; + static const NiPoint4 IDENTITY0; + static const NiPoint4 IDENTITY1; + static const NiPoint4 IDENTITY2; + static const NiPoint4 IDENTITY3; + + NiPoint4() noexcept = default; + NiPoint4(const NiPoint2& a_point) noexcept; + NiPoint4(const NiPoint3& a_point) noexcept; + NiPoint4(float a_x, float a_y, float a_z, float a_w) noexcept; + + float& operator[](std::size_t a_pos) noexcept; + const float& operator[](std::size_t a_pos) const noexcept; + bool operator==(const NiPoint4& a_rhs) const noexcept; + bool operator!=(const NiPoint4& a_rhs) const noexcept; + bool operator<(const NiPoint4& a_rhs) const noexcept; + bool operator>(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator+(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator-(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator*(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator/(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator*(float a_scalar) const noexcept; + NiPoint4 operator/(float a_scalar) const noexcept; + NiPoint4 operator-() const noexcept; + NiPoint4& operator+=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator-=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator*=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator/=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator+=(float a_scalar) noexcept; + NiPoint4& operator-=(float a_scalar) noexcept; + NiPoint4& operator*=(float a_scalar) noexcept; + NiPoint4& operator/=(float a_scalar) noexcept; // members - union - { - NiPoint4Struct v; - float pt[4]{ 0.0F }; - }; // 00 + float x{ 0.0F }; // 00 + float y{ 0.0F }; // 04 + float z{ 0.0F }; // 08 + float w{ 0.0F }; // 0C }; static_assert(sizeof(NiPoint4) == 0x10); } + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::NiPoint4& a_point, FormatContext& a_ctx) const + { + return format_to(a_ctx.out(), "({}, {}, {}, {})", a_point.x, a_point.y, a_point.z, a_point.w); + } +}; diff --git a/CommonLibF4/src/RE/NetImmerse/NiMatrix3.cpp b/CommonLibF4/src/RE/NetImmerse/NiMatrix3.cpp new file mode 100644 index 00000000..5f6bb41b --- /dev/null +++ b/CommonLibF4/src/RE/NetImmerse/NiMatrix3.cpp @@ -0,0 +1,203 @@ +#include "RE/NetImmerse/NiMatrix3.h" + +namespace RE +{ + const NiMatrix3 NiMatrix3::ZERO = { 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }; + const NiMatrix3 NiMatrix3::IDENTITY = { NiPoint4::IDENTITY0, NiPoint4::IDENTITY0, NiPoint4::IDENTITY0 }; + + NiMatrix3::NiMatrix3(const NiPoint4& a_point0, const NiPoint4& a_point1, const NiPoint4& a_point2) noexcept + { + entry[0] = a_point0; + entry[1] = a_point1; + entry[2] = a_point2; + } + + NiMatrix3::NiMatrix3( + float a_x0, float a_y0, float a_z0, float a_w0, + float a_x1, float a_y1, float a_z1, float a_w1, + float a_x2, float a_y2, float a_z2, float a_w2) noexcept + { + entry[0] = { a_x0, a_y0, a_z0, a_w0 }; + entry[1] = { a_x1, a_y1, a_z1, a_w1 }; + entry[2] = { a_x2, a_y2, a_z2, a_w2 }; + } + + NiPoint4& NiMatrix3::operator[](std::size_t a_pos) noexcept + { + assert(a_pos < 3); + return entry[a_pos]; + } + + const NiPoint4& NiMatrix3::operator[](std::size_t a_pos) const noexcept + { + assert(a_pos < 3); + return entry[a_pos]; + } + + bool NiMatrix3::operator==(const NiMatrix3& a_rhs) const noexcept + { + return (entry[0] == a_rhs[0]) && (entry[1] == a_rhs[1]) && (entry[2] == a_rhs[2]); + } + + bool NiMatrix3::operator!=(const NiMatrix3& a_rhs) const noexcept + { + return !operator==(a_rhs); + } + + NiMatrix3 NiMatrix3::operator*(const NiMatrix3& a_rhs) const noexcept + { + NiMatrix3 result; + result[0][0] = entry[0][0] * a_rhs[0][0] + entry[0][1] * a_rhs[1][0] + entry[0][2] * a_rhs[2][0]; + result[1][0] = entry[1][0] * a_rhs[0][0] + entry[1][1] * a_rhs[1][0] + entry[1][2] * a_rhs[2][0]; + result[2][0] = entry[2][0] * a_rhs[0][0] + entry[2][1] * a_rhs[1][0] + entry[2][2] * a_rhs[2][0]; + result[0][1] = entry[0][0] * a_rhs[0][1] + entry[0][1] * a_rhs[1][1] + entry[0][2] * a_rhs[2][1]; + result[1][1] = entry[1][0] * a_rhs[0][1] + entry[1][1] * a_rhs[1][1] + entry[1][2] * a_rhs[2][1]; + result[2][1] = entry[2][0] * a_rhs[0][1] + entry[2][1] * a_rhs[1][1] + entry[2][2] * a_rhs[2][1]; + result[0][2] = entry[0][0] * a_rhs[0][2] + entry[0][1] * a_rhs[1][2] + entry[0][2] * a_rhs[2][2]; + result[1][2] = entry[1][0] * a_rhs[0][2] + entry[1][1] * a_rhs[1][2] + entry[1][2] * a_rhs[2][2]; + result[2][2] = entry[2][0] * a_rhs[0][2] + entry[2][1] * a_rhs[1][2] + entry[2][2] * a_rhs[2][2]; + return result; + } + + NiMatrix3 NiMatrix3::operator*(float a_scalar) const noexcept + { + NiMatrix3 result; + result[0][0] = entry[0][0] * a_scalar; + result[0][1] = entry[0][1] * a_scalar; + result[0][2] = entry[0][2] * a_scalar; + result[1][0] = entry[1][0] * a_scalar; + result[1][1] = entry[1][1] * a_scalar; + result[1][2] = entry[1][2] * a_scalar; + result[2][0] = entry[2][0] * a_scalar; + result[2][1] = entry[2][1] * a_scalar; + result[2][2] = entry[2][2] * a_scalar; + return result; + } + + NiPoint3 NiMatrix3::operator*(const NiPoint3& a_rhs) const noexcept + { + return NiPoint3( + entry[0][0] * a_rhs.x + entry[0][1] * a_rhs.y + entry[0][2] * a_rhs.z, + entry[1][0] * a_rhs.x + entry[1][1] * a_rhs.y + entry[1][2] * a_rhs.z, + entry[2][0] * a_rhs.x + entry[2][1] * a_rhs.y + entry[2][2] * a_rhs.z); + } + + void NiMatrix3::MakeIdentity() noexcept + { + entry[0] = NiPoint4::IDENTITY0; + entry[1] = NiPoint4::IDENTITY1; + entry[2] = NiPoint4::IDENTITY2; + } + + NiMatrix3 NiMatrix3::Transpose() const noexcept + { + NiMatrix3 result; + result[0][0] = entry[0][0]; + result[0][1] = entry[1][0]; + result[0][2] = entry[2][0]; + result[0][3] = entry[0][3]; + result[1][0] = entry[0][1]; + result[1][1] = entry[1][1]; + result[1][2] = entry[2][1]; + result[1][3] = entry[1][3]; + result[2][0] = entry[0][2]; + result[2][1] = entry[1][2]; + result[2][2] = entry[2][2]; + result[2][3] = entry[2][3]; + return result; + } + + bool NiMatrix3::ToEulerAnglesXYZ(NiPoint3& a_point) const + { + return ToEulerAnglesXYZ(a_point.x, a_point.y, a_point.z); + } + + bool NiMatrix3::ToEulerAnglesXYZ(float& a_x, float& a_y, float& a_z) const + { + using func_t = bool(*)(const NiMatrix3*, float&, float&, float&); + static REL::Relocation func{ REL::ID(2269806) }; + return func(this, a_x, a_y, a_z); + } + + bool NiMatrix3::ToEulerAnglesXZY(float& a_x, float& a_z, float& a_y) const + { + using func_t = bool(*)(const NiMatrix3*, float&, float&, float&); + static REL::Relocation func{ REL::ID(2269807) }; + return func(this, a_x, a_z, a_y); + } + + bool NiMatrix3::ToEulerAnglesYXZ(float& a_y, float& a_x, float& a_z) const + { + using func_t = bool(*)(const NiMatrix3*, float&, float&, float&); + static REL::Relocation func{ REL::ID(2269808) }; + return func(this, a_y, a_x, a_z); + } + + bool NiMatrix3::ToEulerAnglesYZX(float& a_y, float& a_z, float& a_x) const + { + using func_t = bool(*)(const NiMatrix3*, float&, float&, float&); + static REL::Relocation func{ REL::ID(2269809) }; + return func(this, a_y, a_z, a_x); + } + + bool NiMatrix3::ToEulerAnglesZYX(float& a_z, float& a_y, float& a_x) const + { + using func_t = bool(*)(const NiMatrix3*, float&, float&, float&); + static REL::Relocation func{ REL::ID(2269810) }; + return func(this, a_z, a_y, a_x); + } + + bool NiMatrix3::ToEulerAnglesZXY(float& a_z, float& a_x, float& a_y) const + { + using func_t = bool (*)(const NiMatrix3*, float&, float&, float&); + static REL::Relocation func{ REL::ID(2269824) }; + return func(this, a_z, a_x, a_y); + } + + void NiMatrix3::FromEulerAnglesXYZ(const NiPoint3& a_point) + { + FromEulerAnglesXYZ(a_point.x, a_point.y, a_point.z); + } + + void NiMatrix3::FromEulerAnglesXYZ(float a_x, float a_y, float a_z) + { + using func_t = void(*)(NiMatrix3*, float, float, float); + static REL::Relocation func{ REL::ID(2269813) }; + return func(this, a_x, a_y, a_z); + } + + void NiMatrix3::FromEulerAnglesXZY(float a_x, float a_z, float a_y) + { + using func_t = void(*)(NiMatrix3*, float, float, float); + static REL::Relocation func{ REL::ID(2269814) }; + return func(this, a_x, a_z, a_y); + } + + void NiMatrix3::FromEulerAnglesYXZ(float a_y, float a_x, float a_z) + { + using func_t = void(*)(NiMatrix3*, float, float, float); + static REL::Relocation func{ REL::ID(2269815) }; + return func(this, a_y, a_x, a_z); + } + + void NiMatrix3::FromEulerAnglesYZX(float a_y, float a_z, float a_x) + { + using func_t = void(*)(NiMatrix3*, float, float, float); + static REL::Relocation func{ REL::ID(2269816) }; + return func(this, a_y, a_z, a_x); + } + + void NiMatrix3::FromEulerAnglesZYX(float a_z, float a_y, float a_x) + { + using func_t = void(*)(NiMatrix3*, float, float, float); + static REL::Relocation func{ REL::ID(2269817) }; + return func(this, a_z, a_y, a_x); + } + + void NiMatrix3::FromEulerAnglesZXY(float a_z, float a_x, float a_y) + { + using func_t = void (*)(NiMatrix3*, float, float, float); + static REL::Relocation func{ REL::ID(2269825) }; + return func(this, a_z, a_x, a_y); + } +} diff --git a/CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp b/CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp new file mode 100644 index 00000000..4711d416 --- /dev/null +++ b/CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp @@ -0,0 +1,133 @@ +#include "RE/NetImmerse/NiPoint2.h" + +namespace RE +{ + const NiPoint2 NiPoint2::ZERO = { 0.0F, 0.0F }; + + NiPoint2::NiPoint2(float a_x, float a_y) noexcept : + x(a_x), y(a_y) + {} + + float& NiPoint2::operator[](std::size_t a_pos) noexcept + { + assert(a_pos < 2); + return std::addressof(x)[a_pos]; + } + + const float& NiPoint2::operator[](std::size_t a_pos) const noexcept + { + assert(a_pos < 2); + return std::addressof(x)[a_pos]; + } + + bool NiPoint2::operator==(const NiPoint2& a_rhs) const noexcept + { + return (x == a_rhs.x) && (y == a_rhs.y); + } + + bool NiPoint2::operator!=(const NiPoint2& a_rhs) const noexcept + { + return !operator==(a_rhs); + } + + bool NiPoint2::operator<(const NiPoint2& a_rhs) const noexcept + { + return std::tie(x, y) < std::tie(a_rhs.x, a_rhs.y); + } + + bool NiPoint2::operator>(const NiPoint2& a_rhs) const noexcept + { + return std::tie(x, y) > std::tie(a_rhs.x, a_rhs.y); + } + + NiPoint2 NiPoint2::operator+(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x + a_rhs.x, y + a_rhs.y); + } + + NiPoint2 NiPoint2::operator-(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x - a_rhs.x, y - a_rhs.y); + } + + NiPoint2 NiPoint2::operator*(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x * a_rhs.x, y * a_rhs.y); + } + + NiPoint2 NiPoint2::operator/(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x / a_rhs.x, y / a_rhs.y); + } + + NiPoint2 NiPoint2::operator*(float a_scalar) const noexcept + { + return NiPoint2(x * a_scalar, y * a_scalar); + } + + NiPoint2 NiPoint2::operator/(float a_scalar) const noexcept + { + return NiPoint2(x / a_scalar, y / a_scalar); + } + + NiPoint2 NiPoint2::operator-() const noexcept + { + return NiPoint2(-x, -y); + } + + NiPoint2& NiPoint2::operator+=(const NiPoint2& a_rhs) noexcept + { + x += a_rhs.x; + y += a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator-=(const NiPoint2& a_rhs) noexcept + { + x -= a_rhs.x; + y -= a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator*=(const NiPoint2& a_rhs) noexcept + { + x *= a_rhs.x; + y *= a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator/=(const NiPoint2& a_rhs) noexcept + { + x /= a_rhs.x; + y /= a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator+=(float a_scalar) noexcept + { + x += a_scalar; + y += a_scalar; + return *this; + } + + NiPoint2& NiPoint2::operator-=(float a_scalar) noexcept + { + x -= a_scalar; + y -= a_scalar; + return *this; + } + + NiPoint2& NiPoint2::operator*=(float a_scalar) noexcept + { + x *= a_scalar; + y *= a_scalar; + return *this; + } + + NiPoint2& NiPoint2::operator/=(float a_scalar) noexcept + { + x /= a_scalar; + y /= a_scalar; + return *this; + } +} diff --git a/CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp b/CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp index 8ddd3e55..0cab9a51 100644 --- a/CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp +++ b/CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp @@ -2,59 +2,85 @@ namespace RE { - NiPoint3::reference NiPoint3::operator[](size_type a_pos) noexcept + const NiPoint3 NiPoint3::ZERO = { 0.0F, 0.0F, 0.0F }; + const NiPoint3A NiPoint3A::ZERO = { 0.0F, 0.0F, 0.0F }; + + NiPoint3::NiPoint3(const NiPoint2& a_point) noexcept : + x(a_point.x), y(a_point.y) + {} + + NiPoint3::NiPoint3(float a_x, float a_y, float a_z) noexcept : + x(a_x), y(a_y), z(a_z) + {} + + float& NiPoint3::operator[](std::size_t a_pos) noexcept { assert(a_pos < 3); - return reinterpret_cast(std::addressof(x))[a_pos]; + return std::addressof(x)[a_pos]; } - NiPoint3::const_reference NiPoint3::operator[](size_type a_pos) const noexcept + const float& NiPoint3::operator[](std::size_t a_pos) const noexcept { assert(a_pos < 3); - return reinterpret_cast(std::addressof(x))[a_pos]; + return std::addressof(x)[a_pos]; } - bool NiPoint3::operator==(const NiPoint3& a_rhs) const + bool NiPoint3::operator==(const NiPoint3& a_rhs) const noexcept { - return (x == a_rhs.x && y == a_rhs.y && z == a_rhs.z); + return (x == a_rhs.x) && (y == a_rhs.y) && (z == a_rhs.z); } - bool NiPoint3::operator!=(const NiPoint3& a_rhs) const + bool NiPoint3::operator!=(const NiPoint3& a_rhs) const noexcept { return !operator==(a_rhs); } - NiPoint3 NiPoint3::operator+(const NiPoint3& a_rhs) const + bool NiPoint3::operator<(const NiPoint3& a_rhs) const noexcept + { + return std::tie(x, y, z) < std::tie(a_rhs.x, a_rhs.y, a_rhs.z); + } + + bool NiPoint3::operator>(const NiPoint3& a_rhs) const noexcept + { + return std::tie(x, y, z) > std::tie(a_rhs.x, a_rhs.y, a_rhs.z); + } + + NiPoint3 NiPoint3::operator+(const NiPoint3& a_rhs) const noexcept { return NiPoint3(x + a_rhs.x, y + a_rhs.y, z + a_rhs.z); } - NiPoint3 NiPoint3::operator-(const NiPoint3& a_rhs) const + NiPoint3 NiPoint3::operator-(const NiPoint3& a_rhs) const noexcept { return NiPoint3(x - a_rhs.x, y - a_rhs.y, z - a_rhs.z); } - float NiPoint3::operator*(const NiPoint3& a_rhs) const + NiPoint3 NiPoint3::operator*(const NiPoint3& a_rhs) const noexcept + { + return NiPoint3(x * a_rhs.x, y * a_rhs.y, z * a_rhs.z); + } + + NiPoint3 NiPoint3::operator/(const NiPoint3& a_rhs) const noexcept { - return x * a_rhs.x + y * a_rhs.y + z * a_rhs.z; + return NiPoint3(x / a_rhs.x, y / a_rhs.y, z / a_rhs.z); } - NiPoint3 NiPoint3::operator*(float a_scalar) const + NiPoint3 NiPoint3::operator*(float a_scalar) const noexcept { return NiPoint3(x * a_scalar, y * a_scalar, z * a_scalar); } - NiPoint3 NiPoint3::operator/(float a_scalar) const + NiPoint3 NiPoint3::operator/(float a_scalar) const noexcept { return NiPoint3(x / a_scalar, y / a_scalar, z / a_scalar); } - NiPoint3 NiPoint3::operator-() const + NiPoint3 NiPoint3::operator-() const noexcept { return NiPoint3(-x, -y, -z); } - NiPoint3& NiPoint3::operator+=(const NiPoint3& a_rhs) + NiPoint3& NiPoint3::operator+=(const NiPoint3& a_rhs) noexcept { x += a_rhs.x; y += a_rhs.y; @@ -62,7 +88,7 @@ namespace RE return *this; } - NiPoint3& NiPoint3::operator-=(const NiPoint3& a_rhs) + NiPoint3& NiPoint3::operator-=(const NiPoint3& a_rhs) noexcept { x -= a_rhs.x; y -= a_rhs.y; @@ -70,7 +96,7 @@ namespace RE return *this; } - NiPoint3& NiPoint3::operator*=(const NiPoint3& a_rhs) + NiPoint3& NiPoint3::operator*=(const NiPoint3& a_rhs) noexcept { x *= a_rhs.x; y *= a_rhs.y; @@ -78,7 +104,7 @@ namespace RE return *this; } - NiPoint3& NiPoint3::operator/=(const NiPoint3& a_rhs) + NiPoint3& NiPoint3::operator/=(const NiPoint3& a_rhs) noexcept { x /= a_rhs.x; y /= a_rhs.y; @@ -86,7 +112,23 @@ namespace RE return *this; } - NiPoint3& NiPoint3::operator*=(float a_scalar) + NiPoint3& NiPoint3::operator+=(float a_scalar) noexcept + { + x += a_scalar; + y += a_scalar; + z += a_scalar; + return *this; + } + + NiPoint3& NiPoint3::operator-=(float a_scalar) noexcept + { + x -= a_scalar; + y -= a_scalar; + z -= a_scalar; + return *this; + } + + NiPoint3& NiPoint3::operator*=(float a_scalar) noexcept { x *= a_scalar; y *= a_scalar; @@ -94,62 +136,65 @@ namespace RE return *this; } - NiPoint3& NiPoint3::operator/=(float a_scalar) + NiPoint3& NiPoint3::operator/=(float a_scalar) noexcept { - return operator*=(1.0F / a_scalar); + x /= a_scalar; + y /= a_scalar; + z /= a_scalar; + return *this; } - NiPoint3 NiPoint3::Cross(const NiPoint3& a_pt) const + NiPoint3 NiPoint3::Cross(const NiPoint3& a_point) const noexcept { return NiPoint3( - y * a_pt.z - z * a_pt.y, - z * a_pt.x - x * a_pt.z, - x * a_pt.y - y * a_pt.x); + y * a_point.z - z * a_point.y, + z * a_point.x - x * a_point.z, + x * a_point.y - y * a_point.x); } - float NiPoint3::Dot(const NiPoint3& a_pt) const + float NiPoint3::Dot(const NiPoint3& a_point) const noexcept { - return x * a_pt.x + y * a_pt.y + z * a_pt.z; + return x * a_point.x + y * a_point.y + z * a_point.z; } - float NiPoint3::GetDistance(const NiPoint3& a_pt) const noexcept + float NiPoint3::GetDistance(const NiPoint3& a_point) const noexcept { - return std::sqrtf(GetSquaredDistance(a_pt)); + return std::sqrtf(GetSquaredDistance(a_point)); } - float NiPoint3::GetSquaredDistance(const NiPoint3& a_pt) const noexcept + float NiPoint3::GetSquaredDistance(const NiPoint3& a_point) const noexcept { - const float dx = a_pt.x - x; - const float dy = a_pt.y - y; - const float dz = a_pt.z - z; + const float dx = a_point.x - x; + const float dy = a_point.y - y; + const float dz = a_point.z - z; return dx * dx + dy * dy + dz * dz; } - float NiPoint3::Length() const + float NiPoint3::GetZAngleFromVector() const + { + using func_t = decltype(&NiPoint3::GetZAngleFromVector); + static REL::Relocation func{ REL::ID(1450064) }; + return func(this); + } + + float NiPoint3::Length() const noexcept { return std::sqrtf(x * x + y * y + z * z); } - float NiPoint3::SqrLength() const + float NiPoint3::SqrLength() const noexcept { return x * x + y * y + z * z; } - NiPoint3 NiPoint3::UnitCross(const NiPoint3& a_pt) const + NiPoint3 NiPoint3::UnitCross(const NiPoint3& a_point) const noexcept { - auto cross = Cross(a_pt); + auto cross = Cross(a_point); cross.Unitize(); return cross; } - float NiPoint3::GetZAngleFromVector() - { - using func_t = decltype(&NiPoint3::GetZAngleFromVector); - REL::Relocation func{ REL::ID(1450064) }; - return func(this); - } - - float NiPoint3::Unitize() + float NiPoint3::Unitize() noexcept { auto length = Length(); if (length == 1.f) { diff --git a/CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp b/CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp new file mode 100644 index 00000000..46d3019f --- /dev/null +++ b/CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp @@ -0,0 +1,161 @@ +#include "RE/NetImmerse/NiPoint4.h" + +namespace RE +{ + const NiPoint4 NiPoint4::ZERO = { 0.0F, 0.0F, 0.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY0 = { 1.0F, 0.0F, 0.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY1 = { 0.0F, 1.0F, 0.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY2 = { 0.0F, 0.0F, 1.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY3 = { 0.0F, 0.0F, 0.0F, 1.0F }; + + NiPoint4::NiPoint4(const NiPoint2& a_point) noexcept : + x(a_point.x), y(a_point.y) + {} + + NiPoint4::NiPoint4(const NiPoint3& a_point) noexcept : + x(a_point.x), y(a_point.y), z(a_point.z) + {} + + NiPoint4::NiPoint4(float a_x, float a_y, float a_z, float a_w) noexcept : + x(a_x), y(a_y), z(a_z), w(a_w) + {} + + float& NiPoint4::operator[](std::size_t a_pos) noexcept + { + assert(a_pos < 4); + return std::addressof(x)[a_pos]; + } + + const float& NiPoint4::operator[](std::size_t a_pos) const noexcept + { + assert(a_pos < 4); + return std::addressof(x)[a_pos]; + } + + bool NiPoint4::operator==(const NiPoint4& a_rhs) const noexcept + { + return (x == a_rhs.x) && (y == a_rhs.y) && (z == a_rhs.z) && (w == a_rhs.w); + } + + bool NiPoint4::operator!=(const NiPoint4& a_rhs) const noexcept + { + return !operator==(a_rhs); + } + + bool NiPoint4::operator<(const NiPoint4& a_rhs) const noexcept + { + return std::tie(x, y, z, w) < std::tie(a_rhs.x, a_rhs.y, a_rhs.z, a_rhs.w); + } + + bool NiPoint4::operator>(const NiPoint4& a_rhs) const noexcept + { + return std::tie(x, y, z, w) > std::tie(a_rhs.x, a_rhs.y, a_rhs.z, a_rhs.w); + } + + NiPoint4 NiPoint4::operator+(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x + a_rhs.x, y + a_rhs.y, z + a_rhs.z, w + a_rhs.w); + } + + NiPoint4 NiPoint4::operator-(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x - a_rhs.x, y - a_rhs.y, z - a_rhs.z, w - a_rhs.w); + } + + NiPoint4 NiPoint4::operator*(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x * a_rhs.x, y * a_rhs.y, z * a_rhs.z, w * a_rhs.w); + } + + NiPoint4 NiPoint4::operator/(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x / a_rhs.x, y / a_rhs.y, z / a_rhs.z, w / a_rhs.w); + } + + NiPoint4 NiPoint4::operator*(float a_scalar) const noexcept + { + return NiPoint4(x * a_scalar, y * a_scalar, z * a_scalar, w * a_scalar); + } + + NiPoint4 NiPoint4::operator/(float a_scalar) const noexcept + { + return operator*(1.0F / a_scalar); + } + + NiPoint4 NiPoint4::operator-() const noexcept + { + return NiPoint4(-x, -y, -z, -w); + } + + NiPoint4& NiPoint4::operator+=(const NiPoint4& a_rhs) noexcept + { + x += a_rhs.x; + y += a_rhs.y; + z += a_rhs.z; + w += a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator-=(const NiPoint4& a_rhs) noexcept + { + x -= a_rhs.x; + y -= a_rhs.y; + z -= a_rhs.z; + w -= a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator*=(const NiPoint4& a_rhs) noexcept + { + x *= a_rhs.x; + y *= a_rhs.y; + z *= a_rhs.z; + w *= a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator/=(const NiPoint4& a_rhs) noexcept + { + x /= a_rhs.x; + y /= a_rhs.y; + z /= a_rhs.z; + w /= a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator+=(float a_scalar) noexcept + { + x += a_scalar; + y += a_scalar; + z += a_scalar; + w += a_scalar; + return *this; + } + + NiPoint4& NiPoint4::operator-=(float a_scalar) noexcept + { + x -= a_scalar; + y -= a_scalar; + z -= a_scalar; + w -= a_scalar; + return *this; + } + + NiPoint4& NiPoint4::operator*=(float a_scalar) noexcept + { + x *= a_scalar; + y *= a_scalar; + z *= a_scalar; + w *= a_scalar; + return *this; + } + + NiPoint4& NiPoint4::operator/=(float a_scalar) noexcept + { + x /= a_scalar; + y /= a_scalar; + z /= a_scalar; + w /= a_scalar; + return *this; + } +} From 45734814cef5c049c3bdd6fb2c9dfc8ded666a36 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:48:19 -0500 Subject: [PATCH 6/9] feat: add `SEX` formatter --- .../include/RE/Bethesda/TESBoundAnimObjects.h | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h index 9b92a4ae..239f36eb 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h @@ -277,7 +277,7 @@ namespace RE [[nodiscard]] TESContainer* GetContainer() { using func_t = decltype(&TESFurniture::GetContainer); - REL::Relocation func{ REL::ID(2198043) }; + static REL::Relocation func{ REL::ID(2198043) }; return func(this); } @@ -403,7 +403,7 @@ namespace RE [[nodiscard]] static TESNPC* GetDefaultNPC(TESNPC* npc) { using func_t = decltype(&TESNPC::GetDefaultNPC); - REL::Relocation func{ REL::ID(1073775) }; + static REL::Relocation func{ REL::ID(1073775) }; return func(npc); } @@ -452,7 +452,7 @@ namespace RE [[nodiscard]] SEX GetSex() noexcept { using func_t = decltype(&TESNPC::GetSex); - REL::Relocation func{ REL::ID(2207107) }; + static REL::Relocation func{ REL::ID(2207107) }; return func(this); } @@ -483,7 +483,7 @@ namespace RE float GetFacialBoneMorphIntensity() { using func_t = decltype(&TESNPC::GetFacialBoneMorphIntensity); - REL::Relocation func{ REL::ID(2207416) }; + static REL::Relocation func{ REL::ID(2207416) }; return func(this); } @@ -581,21 +581,21 @@ namespace RE LOCK_LEVEL GetHackDifficultyLockLevel(TESObjectREFR* a_refr) { using func_t = decltype(&BGSTerminal::GetHackDifficultyLockLevel); - REL::Relocation func{ REL::ID(2197777) }; + static REL::Relocation func{ REL::ID(2197777) }; return func(this, a_refr); } static bool IsTerminalRefInUse(TESObjectREFR* a_refr) { using func_t = decltype(&BGSTerminal::IsTerminalRefInUse); - REL::Relocation func{ REL::ID(2197779) }; + static REL::Relocation func{ REL::ID(2197779) }; return func(a_refr); } static void Show(TESObjectREFR* a_refr) { using func_t = decltype(&BGSTerminal::Show); - REL::Relocation func{ REL::ID(2197776) }; + static REL::Relocation func{ REL::ID(2197776) }; return func(a_refr); } @@ -607,3 +607,28 @@ namespace RE }; static_assert(sizeof(BGSTerminal) == 0x1E0); } + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::SEX& a_sex, FormatContext& a_ctx) const + { + switch (a_sex) { + case RE::SEX::kNone: + return format_to(a_ctx.out(), "None"); + case RE::SEX::kMale: + return format_to(a_ctx.out(), "Male"); + case RE::SEX::kFemale: + return format_to(a_ctx.out(), "Female"); + } + + return format_to(a_ctx.out(), "Unknown"); + } +}; From ff4a70e11a5397fc7003f3812a0876c2c9425241 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:59:49 -0500 Subject: [PATCH 7/9] fix: generate cmake sourcelist --- CommonLibF4/cmake/sourcelist.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CommonLibF4/cmake/sourcelist.cmake b/CommonLibF4/cmake/sourcelist.cmake index 30d2af66..12ad1c35 100644 --- a/CommonLibF4/cmake/sourcelist.cmake +++ b/CommonLibF4/cmake/sourcelist.cmake @@ -434,8 +434,11 @@ set(SOURCES src/RE/Fallout.cpp src/RE/NetImmerse/NiAVObject.cpp src/RE/NetImmerse/NiBinaryStream.cpp + src/RE/NetImmerse/NiMatrix3.cpp src/RE/NetImmerse/NiObjectNET.cpp + src/RE/NetImmerse/NiPoint2.cpp src/RE/NetImmerse/NiPoint3.cpp + src/RE/NetImmerse/NiPoint4.cpp src/RE/NetImmerse/NiRect.cpp src/RE/Scaleform/GFx/GFx_Player.cpp src/REL/IAT.cpp From 7d4ee48b3e44288fca573981e68847ce5785e0dd Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:55:30 -0500 Subject: [PATCH 8/9] refactor: merge `NiPointX.h` into `NiPoint.h` --- CommonLibF4/cmake/sourcelist.cmake | 8 +- CommonLibF4/include/RE/Bethesda/Actor.h | 2 +- .../include/RE/Bethesda/BGSCharacterMorph.h | 2 +- .../include/RE/Bethesda/BGSPrimitive.h | 2 +- .../include/RE/Bethesda/BGSTextureSet.h | 3 +- .../include/RE/Bethesda/BSAudioManager.h | 2 +- CommonLibF4/include/RE/Bethesda/BSBound.h | 2 +- CommonLibF4/include/RE/Bethesda/BSExtraData.h | 2 +- CommonLibF4/include/RE/Bethesda/BSGraphics.h | 2 +- .../include/RE/Bethesda/BSShaderMaterial.h | 2 +- CommonLibF4/include/RE/Bethesda/BSSpring.h | 3 +- .../include/RE/Bethesda/BSTInterpolator.h | 2 +- .../include/RE/Bethesda/FormComponents.h | 2 +- CommonLibF4/include/RE/Bethesda/IMenu.h | 3 +- .../include/RE/Bethesda/IMovementInterface.h | 2 +- CommonLibF4/include/RE/Bethesda/Interface3D.h | 2 +- CommonLibF4/include/RE/Bethesda/NavMesh.h | 2 +- .../include/RE/Bethesda/PlayerCharacter.h | 2 +- .../include/RE/Bethesda/PlayerControls.h | 3 +- CommonLibF4/include/RE/Bethesda/Projectiles.h | 2 +- .../RE/Bethesda/ReferenceEffectController.h | 2 +- .../include/RE/Bethesda/TESBoundAnimObjects.h | 2 +- .../include/RE/Bethesda/TESBoundObjects.h | 2 +- CommonLibF4/include/RE/Bethesda/TESCamera.h | 3 +- CommonLibF4/include/RE/Bethesda/TESForms.h | 3 +- .../include/RE/Bethesda/TESObjectREFRs.h | 2 +- CommonLibF4/include/RE/Bethesda/TESPackages.h | 2 +- CommonLibF4/include/RE/Bethesda/TESRace.h | 2 +- .../include/RE/Bethesda/TESWaterForm.h | 2 +- .../include/RE/Bethesda/TESWorldSpace.h | 2 +- CommonLibF4/include/RE/Bethesda/Utilities.h | 2 +- CommonLibF4/include/RE/Bethesda/Workshop.h | 2 +- .../RE/Bethesda/bhkCharacterController.h | 2 +- CommonLibF4/include/RE/Bethesda/bhkPickData.h | 2 +- CommonLibF4/include/RE/Fallout.h | 4 +- CommonLibF4/include/RE/NetImmerse/NiBound.h | 2 +- .../include/RE/NetImmerse/NiCloningProcess.h | 2 +- CommonLibF4/include/RE/NetImmerse/NiMatrix3.h | 3 +- CommonLibF4/include/RE/NetImmerse/NiPoint.h | 196 +++++++ CommonLibF4/include/RE/NetImmerse/NiPoint2.h | 56 -- CommonLibF4/include/RE/NetImmerse/NiPoint3.h | 80 --- CommonLibF4/include/RE/NetImmerse/NiPoint4.h | 67 --- .../include/RE/NetImmerse/NiTransform.h | 2 +- CommonLibF4/src/RE/NetImmerse/NiPoint.cpp | 504 ++++++++++++++++++ CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp | 133 ----- CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp | 212 -------- CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp | 161 ------ 47 files changed, 740 insertions(+), 762 deletions(-) create mode 100644 CommonLibF4/include/RE/NetImmerse/NiPoint.h delete mode 100644 CommonLibF4/include/RE/NetImmerse/NiPoint2.h delete mode 100644 CommonLibF4/include/RE/NetImmerse/NiPoint3.h delete mode 100644 CommonLibF4/include/RE/NetImmerse/NiPoint4.h create mode 100644 CommonLibF4/src/RE/NetImmerse/NiPoint.cpp delete mode 100644 CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp delete mode 100644 CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp delete mode 100644 CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp diff --git a/CommonLibF4/cmake/sourcelist.cmake b/CommonLibF4/cmake/sourcelist.cmake index 12ad1c35..4d1f3063 100644 --- a/CommonLibF4/cmake/sourcelist.cmake +++ b/CommonLibF4/cmake/sourcelist.cmake @@ -284,9 +284,7 @@ set(SOURCES include/RE/NetImmerse/NiNode.h include/RE/NetImmerse/NiObject.h include/RE/NetImmerse/NiObjectNET.h - include/RE/NetImmerse/NiPoint2.h - include/RE/NetImmerse/NiPoint3.h - include/RE/NetImmerse/NiPoint4.h + include/RE/NetImmerse/NiPoint.h include/RE/NetImmerse/NiProperty.h include/RE/NetImmerse/NiQuaternion.h include/RE/NetImmerse/NiRTTI.h @@ -436,9 +434,7 @@ set(SOURCES src/RE/NetImmerse/NiBinaryStream.cpp src/RE/NetImmerse/NiMatrix3.cpp src/RE/NetImmerse/NiObjectNET.cpp - src/RE/NetImmerse/NiPoint2.cpp - src/RE/NetImmerse/NiPoint3.cpp - src/RE/NetImmerse/NiPoint4.cpp + src/RE/NetImmerse/NiPoint.cpp src/RE/NetImmerse/NiRect.cpp src/RE/Scaleform/GFx/GFx_Player.cpp src/REL/IAT.cpp diff --git a/CommonLibF4/include/RE/Bethesda/Actor.h b/CommonLibF4/include/RE/Bethesda/Actor.h index 892e06cb..efb6f7f6 100644 --- a/CommonLibF4/include/RE/Bethesda/Actor.h +++ b/CommonLibF4/include/RE/Bethesda/Actor.h @@ -14,7 +14,7 @@ #include "RE/Bethesda/IMovementInterface.h" #include "RE/Bethesda/TESObjectREFRs.h" #include "RE/NetImmerse/NiFlags.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/BGSCharacterMorph.h b/CommonLibF4/include/RE/Bethesda/BGSCharacterMorph.h index c46576be..18ee69b2 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSCharacterMorph.h +++ b/CommonLibF4/include/RE/Bethesda/BGSCharacterMorph.h @@ -5,7 +5,7 @@ #include "RE/Bethesda/BSFixedString.h" #include "RE/Bethesda/BSTArray.h" #include "RE/Bethesda/BSTHashMap.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/BGSPrimitive.h b/CommonLibF4/include/RE/Bethesda/BGSPrimitive.h index 509b0004..ae29d871 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSPrimitive.h +++ b/CommonLibF4/include/RE/Bethesda/BGSPrimitive.h @@ -1,6 +1,6 @@ #pragma once -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/BGSTextureSet.h b/CommonLibF4/include/RE/Bethesda/BGSTextureSet.h index 757974c4..c190af43 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSTextureSet.h +++ b/CommonLibF4/include/RE/Bethesda/BGSTextureSet.h @@ -10,8 +10,7 @@ #include "RE/Bethesda/TESForms.h" #include "RE/NetImmerse/NiAlphaProperty.h" #include "RE/NetImmerse/NiColor.h" -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/BSAudioManager.h b/CommonLibF4/include/RE/Bethesda/BSAudioManager.h index 684a6c7c..18e9055f 100644 --- a/CommonLibF4/include/RE/Bethesda/BSAudioManager.h +++ b/CommonLibF4/include/RE/Bethesda/BSAudioManager.h @@ -5,7 +5,7 @@ #include "RE/Bethesda/BSTHashMap.h" #include "RE/Bethesda/BSTList.h" #include "RE/NetImmerse/NiAVObject.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/BSBound.h b/CommonLibF4/include/RE/Bethesda/BSBound.h index 59e294fa..f5c95dfc 100644 --- a/CommonLibF4/include/RE/Bethesda/BSBound.h +++ b/CommonLibF4/include/RE/Bethesda/BSBound.h @@ -1,7 +1,7 @@ #pragma once #include "RE/NetImmerse/NiExtraData.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/BSExtraData.h b/CommonLibF4/include/RE/Bethesda/BSExtraData.h index 95d8b9ea..2747934f 100644 --- a/CommonLibF4/include/RE/Bethesda/BSExtraData.h +++ b/CommonLibF4/include/RE/Bethesda/BSExtraData.h @@ -7,7 +7,7 @@ #include "RE/Bethesda/BSTSmartPointer.h" #include "RE/Bethesda/BSTTuple.h" #include "RE/Bethesda/MemoryManager.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/BSGraphics.h b/CommonLibF4/include/RE/Bethesda/BSGraphics.h index eb1f1479..4fc10de3 100644 --- a/CommonLibF4/include/RE/Bethesda/BSGraphics.h +++ b/CommonLibF4/include/RE/Bethesda/BSGraphics.h @@ -3,7 +3,7 @@ #include "RE/Bethesda/Atomic.h" #include "RE/Bethesda/BSTHashMap.h" #include "RE/NetImmerse/NiColor.h" -#include "RE/NetImmerse/NiPoint2.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiRect.h" #include "RE/NetImmerse/NiSmartPointer.h" #include "RE/NetImmerse/NiTexture.h" diff --git a/CommonLibF4/include/RE/Bethesda/BSShaderMaterial.h b/CommonLibF4/include/RE/Bethesda/BSShaderMaterial.h index b7801268..3ab16859 100644 --- a/CommonLibF4/include/RE/Bethesda/BSShaderMaterial.h +++ b/CommonLibF4/include/RE/Bethesda/BSShaderMaterial.h @@ -5,7 +5,7 @@ #include "RE/Bethesda/BSTSmartPointer.h" #include "RE/Bethesda/BSTextureDB.h" #include "RE/NetImmerse/NiColor.h" -#include "RE/NetImmerse/NiPoint2.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/BSSpring.h b/CommonLibF4/include/RE/Bethesda/BSSpring.h index aa4acf36..2e32c9f5 100644 --- a/CommonLibF4/include/RE/Bethesda/BSSpring.h +++ b/CommonLibF4/include/RE/Bethesda/BSSpring.h @@ -1,7 +1,6 @@ #pragma once -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE::BSSpring { diff --git a/CommonLibF4/include/RE/Bethesda/BSTInterpolator.h b/CommonLibF4/include/RE/Bethesda/BSTInterpolator.h index 4527f3fd..92c5e332 100644 --- a/CommonLibF4/include/RE/Bethesda/BSTInterpolator.h +++ b/CommonLibF4/include/RE/Bethesda/BSTInterpolator.h @@ -1,6 +1,6 @@ #pragma once -#include "RE/NetImmerse/NiPoint2.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/FormComponents.h b/CommonLibF4/include/RE/Bethesda/FormComponents.h index d7d84bf0..590deeee 100644 --- a/CommonLibF4/include/RE/Bethesda/FormComponents.h +++ b/CommonLibF4/include/RE/Bethesda/FormComponents.h @@ -9,7 +9,7 @@ #include "RE/Bethesda/BSTSmartPointer.h" #include "RE/Bethesda/BSTTuple.h" #include "RE/Bethesda/MemoryManager.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiRefObject.h" #include "RE/NetImmerse/NiSmartPointer.h" diff --git a/CommonLibF4/include/RE/Bethesda/IMenu.h b/CommonLibF4/include/RE/Bethesda/IMenu.h index 7b2d94a4..74fbd080 100644 --- a/CommonLibF4/include/RE/Bethesda/IMenu.h +++ b/CommonLibF4/include/RE/Bethesda/IMenu.h @@ -31,8 +31,7 @@ #include "RE/Bethesda/UserEvents.h" #include "RE/NetImmerse/NiColor.h" #include "RE/NetImmerse/NiMatrix3.h" -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiQuaternion.h" #include "RE/NetImmerse/NiRect.h" #include "RE/NetImmerse/NiSmartPointer.h" diff --git a/CommonLibF4/include/RE/Bethesda/IMovementInterface.h b/CommonLibF4/include/RE/Bethesda/IMovementInterface.h index 6e04d3c1..139ce07f 100644 --- a/CommonLibF4/include/RE/Bethesda/IMovementInterface.h +++ b/CommonLibF4/include/RE/Bethesda/IMovementInterface.h @@ -1,7 +1,7 @@ #pragma once #include "RE/Bethesda/BSTSmartPointer.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/Interface3D.h b/CommonLibF4/include/RE/Bethesda/Interface3D.h index 43614d96..50c27cfe 100644 --- a/CommonLibF4/include/RE/Bethesda/Interface3D.h +++ b/CommonLibF4/include/RE/Bethesda/Interface3D.h @@ -5,7 +5,7 @@ #include "RE/Bethesda/BSTArray.h" #include "RE/Bethesda/UIShaderFXInfo.h" #include "RE/NetImmerse/NiColor.h" -#include "RE/NetImmerse/NiPoint2.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/NavMesh.h b/CommonLibF4/include/RE/Bethesda/NavMesh.h index bdc4bd25..229f9d2d 100644 --- a/CommonLibF4/include/RE/Bethesda/NavMesh.h +++ b/CommonLibF4/include/RE/Bethesda/NavMesh.h @@ -5,7 +5,7 @@ #include "RE/Bethesda/BSTSmartPointer.h" #include "RE/Bethesda/FormComponents.h" #include "RE/Bethesda/TESForms.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h b/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h index 369acbcf..e05fb890 100644 --- a/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h +++ b/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h @@ -15,7 +15,7 @@ #include "RE/Bethesda/BSTTuple.h" #include "RE/Bethesda/IMovementInterface.h" #include "RE/Havok/hkRefPtr.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" #include "RE/NetImmerse/NiTMap.h" diff --git a/CommonLibF4/include/RE/Bethesda/PlayerControls.h b/CommonLibF4/include/RE/Bethesda/PlayerControls.h index 7b03d4de..0a74687e 100644 --- a/CommonLibF4/include/RE/Bethesda/PlayerControls.h +++ b/CommonLibF4/include/RE/Bethesda/PlayerControls.h @@ -8,8 +8,7 @@ #include "RE/Bethesda/BSTEvent.h" #include "RE/Bethesda/BSTSingleton.h" #include "RE/Bethesda/IMovementInterface.h" -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/Projectiles.h b/CommonLibF4/include/RE/Bethesda/Projectiles.h index fe3c5d3e..b8cc036e 100644 --- a/CommonLibF4/include/RE/Bethesda/Projectiles.h +++ b/CommonLibF4/include/RE/Bethesda/Projectiles.h @@ -6,7 +6,7 @@ #include "RE/Bethesda/BSTEvent.h" #include "RE/Bethesda/CELLJobs.h" #include "RE/Bethesda/TESObjectREFRs.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" #include "RE/NetImmerse/NiTransform.h" diff --git a/CommonLibF4/include/RE/Bethesda/ReferenceEffectController.h b/CommonLibF4/include/RE/Bethesda/ReferenceEffectController.h index 58d8245d..31b785e4 100644 --- a/CommonLibF4/include/RE/Bethesda/ReferenceEffectController.h +++ b/CommonLibF4/include/RE/Bethesda/ReferenceEffectController.h @@ -2,7 +2,7 @@ #include "RE/Bethesda/BSFixedString.h" #include "RE/Bethesda/BSPointerHandle.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h index 239f36eb..a21c0993 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h @@ -10,7 +10,7 @@ #include "RE/Bethesda/TESBoundObjects.h" #include "RE/Bethesda/TESCondition.h" #include "RE/NetImmerse/NiColor.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h index 95967721..d1ca1e17 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h @@ -13,7 +13,7 @@ #include "RE/Bethesda/TESCondition.h" #include "RE/Bethesda/TESForms.h" #include "RE/NetImmerse/NiColor.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/TESCamera.h b/CommonLibF4/include/RE/Bethesda/TESCamera.h index a8dd7945..2eea9253 100644 --- a/CommonLibF4/include/RE/Bethesda/TESCamera.h +++ b/CommonLibF4/include/RE/Bethesda/TESCamera.h @@ -9,8 +9,7 @@ #include "RE/Bethesda/BSTSingleton.h" #include "RE/Bethesda/BSTSmartPointer.h" #include "RE/Havok/hkRefPtr.h" -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiQuaternion.h" #include "RE/NetImmerse/NiSmartPointer.h" diff --git a/CommonLibF4/include/RE/Bethesda/TESForms.h b/CommonLibF4/include/RE/Bethesda/TESForms.h index 827f3e3b..a948780b 100644 --- a/CommonLibF4/include/RE/Bethesda/TESForms.h +++ b/CommonLibF4/include/RE/Bethesda/TESForms.h @@ -22,8 +22,7 @@ #include "RE/Bethesda/bhkPickData.h" #include "RE/NetImmerse/NiColor.h" #include "RE/NetImmerse/NiFlags.h" -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h b/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h index 813e8eef..0e72d174 100644 --- a/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h +++ b/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h @@ -11,7 +11,7 @@ #include "RE/Bethesda/TESForms.h" #include "RE/Havok/hknpBodyId.h" #include "RE/Havok/hknpClosestUniqueBodyIdHitCollector.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiRefObject.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/TESPackages.h b/CommonLibF4/include/RE/Bethesda/TESPackages.h index 74fe05ee..7530c65f 100644 --- a/CommonLibF4/include/RE/Bethesda/TESPackages.h +++ b/CommonLibF4/include/RE/Bethesda/TESPackages.h @@ -5,7 +5,7 @@ #include "RE/Bethesda/BSTList.h" #include "RE/Bethesda/TESCondition.h" #include "RE/Bethesda/TESForms.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/TESRace.h b/CommonLibF4/include/RE/Bethesda/TESRace.h index 58092152..928c652c 100644 --- a/CommonLibF4/include/RE/Bethesda/TESRace.h +++ b/CommonLibF4/include/RE/Bethesda/TESRace.h @@ -9,7 +9,7 @@ #include "RE/Bethesda/Movement.h" #include "RE/Bethesda/TESCondition.h" #include "RE/Bethesda/TESForms.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/TESWaterForm.h b/CommonLibF4/include/RE/Bethesda/TESWaterForm.h index 821205c6..cfba4295 100644 --- a/CommonLibF4/include/RE/Bethesda/TESWaterForm.h +++ b/CommonLibF4/include/RE/Bethesda/TESWaterForm.h @@ -3,7 +3,7 @@ #include "RE/Bethesda/FormComponents.h" #include "RE/Bethesda/TESForms.h" #include "RE/NetImmerse/NiColor.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h b/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h index 1d5b59e1..79777863 100644 --- a/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h +++ b/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h @@ -6,7 +6,7 @@ #include "RE/Bethesda/BSTHashMap.h" #include "RE/Bethesda/FormComponents.h" #include "RE/Bethesda/TESForms.h" -#include "RE/NetImmerse/NiPoint2.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" #include "RE/NetImmerse/NiTMap.h" diff --git a/CommonLibF4/include/RE/Bethesda/Utilities.h b/CommonLibF4/include/RE/Bethesda/Utilities.h index 254090fa..ec7ea475 100644 --- a/CommonLibF4/include/RE/Bethesda/Utilities.h +++ b/CommonLibF4/include/RE/Bethesda/Utilities.h @@ -5,7 +5,7 @@ #include "RE/Bethesda/TESBoundObjects.h" #include "RE/Bethesda/bhkPickData.h" #include "RE/NetImmerse/NiAVObject.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/Workshop.h b/CommonLibF4/include/RE/Bethesda/Workshop.h index 904e6135..5c2fc3e0 100644 --- a/CommonLibF4/include/RE/Bethesda/Workshop.h +++ b/CommonLibF4/include/RE/Bethesda/Workshop.h @@ -3,7 +3,7 @@ #include "RE/Bethesda/BSExtraData.h" #include "RE/Bethesda/BSTArray.h" #include "RE/Bethesda/MemoryManager.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h b/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h index 3eda036d..0c930b15 100644 --- a/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h +++ b/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h @@ -14,7 +14,7 @@ #include "RE/NetImmerse/NiCollisionObject.h" #include "RE/NetImmerse/NiFlags.h" #include "RE/NetImmerse/NiMatrix3.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiSmartPointer.h" namespace RE diff --git a/CommonLibF4/include/RE/Bethesda/bhkPickData.h b/CommonLibF4/include/RE/Bethesda/bhkPickData.h index c098b984..ef070831 100644 --- a/CommonLibF4/include/RE/Bethesda/bhkPickData.h +++ b/CommonLibF4/include/RE/Bethesda/bhkPickData.h @@ -4,7 +4,7 @@ #include "RE/Bethesda/bhkCharacterController.h" #include "RE/Havok/hkVector4.h" #include "RE/Havok/hknpCollisionResult.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/Fallout.h b/CommonLibF4/include/RE/Fallout.h index 49ad82cb..68fe0371 100644 --- a/CommonLibF4/include/RE/Fallout.h +++ b/CommonLibF4/include/RE/Fallout.h @@ -278,9 +278,7 @@ #include "RE/NetImmerse/NiNode.h" #include "RE/NetImmerse/NiObject.h" #include "RE/NetImmerse/NiObjectNET.h" -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" -#include "RE/NetImmerse/NiPoint4.h" +#include "RE/NetImmerse/NiPoint.h" #include "RE/NetImmerse/NiProperty.h" #include "RE/NetImmerse/NiQuaternion.h" #include "RE/NetImmerse/NiRTTI.h" diff --git a/CommonLibF4/include/RE/NetImmerse/NiBound.h b/CommonLibF4/include/RE/NetImmerse/NiBound.h index 89fd9f9f..645f15ed 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiBound.h +++ b/CommonLibF4/include/RE/NetImmerse/NiBound.h @@ -1,6 +1,6 @@ #pragma once -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/NetImmerse/NiCloningProcess.h b/CommonLibF4/include/RE/NetImmerse/NiCloningProcess.h index 5bd9e5c8..c9c47aff 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiCloningProcess.h +++ b/CommonLibF4/include/RE/NetImmerse/NiCloningProcess.h @@ -1,7 +1,7 @@ #pragma once #include "RE/Bethesda/BSTHashMap.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h b/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h index 0839191e..afd2712d 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h +++ b/CommonLibF4/include/RE/NetImmerse/NiMatrix3.h @@ -1,7 +1,6 @@ #pragma once -#include "RE/NetImmerse/NiPoint3.h" -#include "RE/NetImmerse/NiPoint4.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/include/RE/NetImmerse/NiPoint.h b/CommonLibF4/include/RE/NetImmerse/NiPoint.h new file mode 100644 index 00000000..8153bd20 --- /dev/null +++ b/CommonLibF4/include/RE/NetImmerse/NiPoint.h @@ -0,0 +1,196 @@ +#pragma once + +namespace RE +{ + class NiPoint2 + { + public: + static const NiPoint2 ZERO; + + NiPoint2() noexcept = default; + NiPoint2(float a_x, float a_y) noexcept; + + float& operator[](std::size_t a_pos) noexcept; + const float& operator[](std::size_t a_pos) const noexcept; + bool operator==(const NiPoint2& a_rhs) const noexcept; + bool operator!=(const NiPoint2& a_rhs) const noexcept; + bool operator<(const NiPoint2& a_rhs) const noexcept; + bool operator>(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator+(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator-(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator*(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator/(const NiPoint2& a_rhs) const noexcept; + NiPoint2 operator*(float a_scalar) const noexcept; + NiPoint2 operator/(float a_scalar) const noexcept; + NiPoint2 operator-() const noexcept; + NiPoint2& operator+=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator-=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator*=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator/=(const NiPoint2& a_rhs) noexcept; + NiPoint2& operator+=(float a_scalar) noexcept; + NiPoint2& operator-=(float a_scalar) noexcept; + NiPoint2& operator*=(float a_scalar) noexcept; + NiPoint2& operator/=(float a_scalar) noexcept; + + // members + float x{ 0.0F }; // 00 + float y{ 0.0F }; // 04 + }; + static_assert(sizeof(NiPoint2) == 0x8); +} + +namespace RE +{ + class NiPoint3 + { + public: + static const NiPoint3 ZERO; + + NiPoint3() noexcept = default; + NiPoint3(const NiPoint2& a_point) noexcept; + NiPoint3(float a_x, float a_y, float a_z) noexcept; + + float& operator[](std::size_t a_pos) noexcept; + const float& operator[](std::size_t a_pos) const noexcept; + bool operator==(const NiPoint3& a_rhs) const noexcept; + bool operator!=(const NiPoint3& a_rhs) const noexcept; + bool operator<(const NiPoint3& a_rhs) const noexcept; + bool operator>(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator+(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator-(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator*(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator/(const NiPoint3& a_rhs) const noexcept; + NiPoint3 operator*(float a_scalar) const noexcept; + NiPoint3 operator/(float a_scalar) const noexcept; + NiPoint3 operator-() const noexcept; + NiPoint3& operator+=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator-=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator*=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator/=(const NiPoint3& a_rhs) noexcept; + NiPoint3& operator+=(float a_scalar) noexcept; + NiPoint3& operator-=(float a_scalar) noexcept; + NiPoint3& operator*=(float a_scalar) noexcept; + NiPoint3& operator/=(float a_scalar) noexcept; + + [[nodiscard]] NiPoint3 Cross(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float Dot(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float GetDistance(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float GetSquaredDistance(const NiPoint3& a_point) const noexcept; + [[nodiscard]] float GetZAngleFromVector() const; + [[nodiscard]] float Length() const noexcept; + [[nodiscard]] float SqrLength() const noexcept; + [[nodiscard]] NiPoint3 UnitCross(const NiPoint3& a_point) const noexcept; + float Unitize() noexcept; + + // members + float x{ 0.0F }; // 00 + float y{ 0.0F }; // 04 + float z{ 0.0F }; // 08 + }; + static_assert(sizeof(NiPoint3) == 0xC); + + class alignas(0x10) NiPoint3A : + public NiPoint3 + { + public: + static const NiPoint3A ZERO; + + using NiPoint3::NiPoint3; + }; + static_assert(sizeof(NiPoint3A) == 0x10); +} + +namespace RE +{ + class NiPoint4 + { + public: + static const NiPoint4 ZERO; + static const NiPoint4 IDENTITY0; + static const NiPoint4 IDENTITY1; + static const NiPoint4 IDENTITY2; + static const NiPoint4 IDENTITY3; + + NiPoint4() noexcept = default; + NiPoint4(const NiPoint2& a_point) noexcept; + NiPoint4(const NiPoint3& a_point) noexcept; + NiPoint4(float a_x, float a_y, float a_z, float a_w) noexcept; + + float& operator[](std::size_t a_pos) noexcept; + const float& operator[](std::size_t a_pos) const noexcept; + bool operator==(const NiPoint4& a_rhs) const noexcept; + bool operator!=(const NiPoint4& a_rhs) const noexcept; + bool operator<(const NiPoint4& a_rhs) const noexcept; + bool operator>(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator+(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator-(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator*(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator/(const NiPoint4& a_rhs) const noexcept; + NiPoint4 operator*(float a_scalar) const noexcept; + NiPoint4 operator/(float a_scalar) const noexcept; + NiPoint4 operator-() const noexcept; + NiPoint4& operator+=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator-=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator*=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator/=(const NiPoint4& a_rhs) noexcept; + NiPoint4& operator+=(float a_scalar) noexcept; + NiPoint4& operator-=(float a_scalar) noexcept; + NiPoint4& operator*=(float a_scalar) noexcept; + NiPoint4& operator/=(float a_scalar) noexcept; + + // members + float x{ 0.0F }; // 00 + float y{ 0.0F }; // 04 + float z{ 0.0F }; // 08 + float w{ 0.0F }; // 0C + }; + static_assert(sizeof(NiPoint4) == 0x10); +} + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::NiPoint2& a_point, FormatContext& a_ctx) const + { + return format_to(a_ctx.out(), "({}, {})", a_point.x, a_point.y); + } +}; + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::NiPoint3& a_point, FormatContext& a_ctx) const + { + return format_to(a_ctx.out(), "({}, {}, {})", a_point.x, a_point.y, a_point.z); + } +}; + +template <> +struct std::formatter +{ + template + constexpr auto parse(ParseContext& a_ctx) + { + return a_ctx.begin(); + } + + template + constexpr auto format(const RE::NiPoint4& a_point, FormatContext& a_ctx) const + { + return format_to(a_ctx.out(), "({}, {}, {}, {})", a_point.x, a_point.y, a_point.z, a_point.w); + } +}; diff --git a/CommonLibF4/include/RE/NetImmerse/NiPoint2.h b/CommonLibF4/include/RE/NetImmerse/NiPoint2.h deleted file mode 100644 index b0f5d065..00000000 --- a/CommonLibF4/include/RE/NetImmerse/NiPoint2.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -namespace RE -{ - class NiPoint2 - { - public: - static const NiPoint2 ZERO; - - NiPoint2() noexcept = default; - NiPoint2(float a_x, float a_y) noexcept; - - float& operator[](std::size_t a_pos) noexcept; - const float& operator[](std::size_t a_pos) const noexcept; - bool operator==(const NiPoint2& a_rhs) const noexcept; - bool operator!=(const NiPoint2& a_rhs) const noexcept; - bool operator<(const NiPoint2& a_rhs) const noexcept; - bool operator>(const NiPoint2& a_rhs) const noexcept; - NiPoint2 operator+(const NiPoint2& a_rhs) const noexcept; - NiPoint2 operator-(const NiPoint2& a_rhs) const noexcept; - NiPoint2 operator*(const NiPoint2& a_rhs) const noexcept; - NiPoint2 operator/(const NiPoint2& a_rhs) const noexcept; - NiPoint2 operator*(float a_scalar) const noexcept; - NiPoint2 operator/(float a_scalar) const noexcept; - NiPoint2 operator-() const noexcept; - NiPoint2& operator+=(const NiPoint2& a_rhs) noexcept; - NiPoint2& operator-=(const NiPoint2& a_rhs) noexcept; - NiPoint2& operator*=(const NiPoint2& a_rhs) noexcept; - NiPoint2& operator/=(const NiPoint2& a_rhs) noexcept; - NiPoint2& operator+=(float a_scalar) noexcept; - NiPoint2& operator-=(float a_scalar) noexcept; - NiPoint2& operator*=(float a_scalar) noexcept; - NiPoint2& operator/=(float a_scalar) noexcept; - - // members - float x{ 0.0F }; // 00 - float y{ 0.0F }; // 04 - }; - static_assert(sizeof(NiPoint2) == 0x8); -} - -template <> -struct std::formatter -{ - template - constexpr auto parse(ParseContext& a_ctx) - { - return a_ctx.begin(); - } - - template - constexpr auto format(const RE::NiPoint2& a_point, FormatContext& a_ctx) const - { - return format_to(a_ctx.out(), "({}, {})", a_point.x, a_point.y); - } -}; diff --git a/CommonLibF4/include/RE/NetImmerse/NiPoint3.h b/CommonLibF4/include/RE/NetImmerse/NiPoint3.h deleted file mode 100644 index 62cca0eb..00000000 --- a/CommonLibF4/include/RE/NetImmerse/NiPoint3.h +++ /dev/null @@ -1,80 +0,0 @@ -#pragma once - -#include "RE/NetImmerse/NiPoint2.h" - -namespace RE -{ - class NiPoint3 - { - public: - static const NiPoint3 ZERO; - - NiPoint3() noexcept = default; - NiPoint3(const NiPoint2& a_point) noexcept; - NiPoint3(float a_x, float a_y, float a_z) noexcept; - - float& operator[](std::size_t a_pos) noexcept; - const float& operator[](std::size_t a_pos) const noexcept; - bool operator==(const NiPoint3& a_rhs) const noexcept; - bool operator!=(const NiPoint3& a_rhs) const noexcept; - bool operator<(const NiPoint3& a_rhs) const noexcept; - bool operator>(const NiPoint3& a_rhs) const noexcept; - NiPoint3 operator+(const NiPoint3& a_rhs) const noexcept; - NiPoint3 operator-(const NiPoint3& a_rhs) const noexcept; - NiPoint3 operator*(const NiPoint3& a_rhs) const noexcept; - NiPoint3 operator/(const NiPoint3& a_rhs) const noexcept; - NiPoint3 operator*(float a_scalar) const noexcept; - NiPoint3 operator/(float a_scalar) const noexcept; - NiPoint3 operator-() const noexcept; - NiPoint3& operator+=(const NiPoint3& a_rhs) noexcept; - NiPoint3& operator-=(const NiPoint3& a_rhs) noexcept; - NiPoint3& operator*=(const NiPoint3& a_rhs) noexcept; - NiPoint3& operator/=(const NiPoint3& a_rhs) noexcept; - NiPoint3& operator+=(float a_scalar) noexcept; - NiPoint3& operator-=(float a_scalar) noexcept; - NiPoint3& operator*=(float a_scalar) noexcept; - NiPoint3& operator/=(float a_scalar) noexcept; - - [[nodiscard]] NiPoint3 Cross(const NiPoint3& a_point) const noexcept; - [[nodiscard]] float Dot(const NiPoint3& a_point) const noexcept; - [[nodiscard]] float GetDistance(const NiPoint3& a_point) const noexcept; - [[nodiscard]] float GetSquaredDistance(const NiPoint3& a_point) const noexcept; - [[nodiscard]] float GetZAngleFromVector() const; - [[nodiscard]] float Length() const noexcept; - [[nodiscard]] float SqrLength() const noexcept; - [[nodiscard]] NiPoint3 UnitCross(const NiPoint3& a_point) const noexcept; - float Unitize() noexcept; - - // members - float x{ 0.0F }; // 00 - float y{ 0.0F }; // 04 - float z{ 0.0F }; // 08 - }; - static_assert(sizeof(NiPoint3) == 0xC); - - class alignas(0x10) NiPoint3A : - public NiPoint3 - { - public: - static const NiPoint3A ZERO; - - using NiPoint3::NiPoint3; - }; - static_assert(sizeof(NiPoint3A) == 0x10); -} - -template <> -struct std::formatter -{ - template - constexpr auto parse(ParseContext& a_ctx) - { - return a_ctx.begin(); - } - - template - constexpr auto format(const RE::NiPoint3& a_point, FormatContext& a_ctx) const - { - return format_to(a_ctx.out(), "({}, {}, {})", a_point.x, a_point.y, a_point.z); - } -}; diff --git a/CommonLibF4/include/RE/NetImmerse/NiPoint4.h b/CommonLibF4/include/RE/NetImmerse/NiPoint4.h deleted file mode 100644 index 3e93ec61..00000000 --- a/CommonLibF4/include/RE/NetImmerse/NiPoint4.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once - -#include "RE/NetImmerse/NiPoint2.h" -#include "RE/NetImmerse/NiPoint3.h" - -namespace RE -{ - class NiPoint4 - { - public: - static const NiPoint4 ZERO; - static const NiPoint4 IDENTITY0; - static const NiPoint4 IDENTITY1; - static const NiPoint4 IDENTITY2; - static const NiPoint4 IDENTITY3; - - NiPoint4() noexcept = default; - NiPoint4(const NiPoint2& a_point) noexcept; - NiPoint4(const NiPoint3& a_point) noexcept; - NiPoint4(float a_x, float a_y, float a_z, float a_w) noexcept; - - float& operator[](std::size_t a_pos) noexcept; - const float& operator[](std::size_t a_pos) const noexcept; - bool operator==(const NiPoint4& a_rhs) const noexcept; - bool operator!=(const NiPoint4& a_rhs) const noexcept; - bool operator<(const NiPoint4& a_rhs) const noexcept; - bool operator>(const NiPoint4& a_rhs) const noexcept; - NiPoint4 operator+(const NiPoint4& a_rhs) const noexcept; - NiPoint4 operator-(const NiPoint4& a_rhs) const noexcept; - NiPoint4 operator*(const NiPoint4& a_rhs) const noexcept; - NiPoint4 operator/(const NiPoint4& a_rhs) const noexcept; - NiPoint4 operator*(float a_scalar) const noexcept; - NiPoint4 operator/(float a_scalar) const noexcept; - NiPoint4 operator-() const noexcept; - NiPoint4& operator+=(const NiPoint4& a_rhs) noexcept; - NiPoint4& operator-=(const NiPoint4& a_rhs) noexcept; - NiPoint4& operator*=(const NiPoint4& a_rhs) noexcept; - NiPoint4& operator/=(const NiPoint4& a_rhs) noexcept; - NiPoint4& operator+=(float a_scalar) noexcept; - NiPoint4& operator-=(float a_scalar) noexcept; - NiPoint4& operator*=(float a_scalar) noexcept; - NiPoint4& operator/=(float a_scalar) noexcept; - - // members - float x{ 0.0F }; // 00 - float y{ 0.0F }; // 04 - float z{ 0.0F }; // 08 - float w{ 0.0F }; // 0C - }; - static_assert(sizeof(NiPoint4) == 0x10); -} - -template <> -struct std::formatter -{ - template - constexpr auto parse(ParseContext& a_ctx) - { - return a_ctx.begin(); - } - - template - constexpr auto format(const RE::NiPoint4& a_point, FormatContext& a_ctx) const - { - return format_to(a_ctx.out(), "({}, {}, {}, {})", a_point.x, a_point.y, a_point.z, a_point.w); - } -}; diff --git a/CommonLibF4/include/RE/NetImmerse/NiTransform.h b/CommonLibF4/include/RE/NetImmerse/NiTransform.h index c42d639d..49d5b0c4 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiTransform.h +++ b/CommonLibF4/include/RE/NetImmerse/NiTransform.h @@ -1,7 +1,7 @@ #pragma once #include "RE/NetImmerse/NiMatrix3.h" -#include "RE/NetImmerse/NiPoint3.h" +#include "RE/NetImmerse/NiPoint.h" namespace RE { diff --git a/CommonLibF4/src/RE/NetImmerse/NiPoint.cpp b/CommonLibF4/src/RE/NetImmerse/NiPoint.cpp new file mode 100644 index 00000000..ba45ef8e --- /dev/null +++ b/CommonLibF4/src/RE/NetImmerse/NiPoint.cpp @@ -0,0 +1,504 @@ +#include "RE/NetImmerse/NiPoint.h" + +namespace RE +{ + const NiPoint2 NiPoint2::ZERO = { 0.0F, 0.0F }; + + NiPoint2::NiPoint2(float a_x, float a_y) noexcept : + x(a_x), y(a_y) + {} + + float& NiPoint2::operator[](std::size_t a_pos) noexcept + { + assert(a_pos < 2); + return std::addressof(x)[a_pos]; + } + + const float& NiPoint2::operator[](std::size_t a_pos) const noexcept + { + assert(a_pos < 2); + return std::addressof(x)[a_pos]; + } + + bool NiPoint2::operator==(const NiPoint2& a_rhs) const noexcept + { + return (x == a_rhs.x) && (y == a_rhs.y); + } + + bool NiPoint2::operator!=(const NiPoint2& a_rhs) const noexcept + { + return !operator==(a_rhs); + } + + bool NiPoint2::operator<(const NiPoint2& a_rhs) const noexcept + { + return std::tie(x, y) < std::tie(a_rhs.x, a_rhs.y); + } + + bool NiPoint2::operator>(const NiPoint2& a_rhs) const noexcept + { + return std::tie(x, y) > std::tie(a_rhs.x, a_rhs.y); + } + + NiPoint2 NiPoint2::operator+(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x + a_rhs.x, y + a_rhs.y); + } + + NiPoint2 NiPoint2::operator-(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x - a_rhs.x, y - a_rhs.y); + } + + NiPoint2 NiPoint2::operator*(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x * a_rhs.x, y * a_rhs.y); + } + + NiPoint2 NiPoint2::operator/(const NiPoint2& a_rhs) const noexcept + { + return NiPoint2(x / a_rhs.x, y / a_rhs.y); + } + + NiPoint2 NiPoint2::operator*(float a_scalar) const noexcept + { + return NiPoint2(x * a_scalar, y * a_scalar); + } + + NiPoint2 NiPoint2::operator/(float a_scalar) const noexcept + { + return NiPoint2(x / a_scalar, y / a_scalar); + } + + NiPoint2 NiPoint2::operator-() const noexcept + { + return NiPoint2(-x, -y); + } + + NiPoint2& NiPoint2::operator+=(const NiPoint2& a_rhs) noexcept + { + x += a_rhs.x; + y += a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator-=(const NiPoint2& a_rhs) noexcept + { + x -= a_rhs.x; + y -= a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator*=(const NiPoint2& a_rhs) noexcept + { + x *= a_rhs.x; + y *= a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator/=(const NiPoint2& a_rhs) noexcept + { + x /= a_rhs.x; + y /= a_rhs.y; + return *this; + } + + NiPoint2& NiPoint2::operator+=(float a_scalar) noexcept + { + x += a_scalar; + y += a_scalar; + return *this; + } + + NiPoint2& NiPoint2::operator-=(float a_scalar) noexcept + { + x -= a_scalar; + y -= a_scalar; + return *this; + } + + NiPoint2& NiPoint2::operator*=(float a_scalar) noexcept + { + x *= a_scalar; + y *= a_scalar; + return *this; + } + + NiPoint2& NiPoint2::operator/=(float a_scalar) noexcept + { + x /= a_scalar; + y /= a_scalar; + return *this; + } +} + +namespace RE +{ + const NiPoint3 NiPoint3::ZERO = { 0.0F, 0.0F, 0.0F }; + const NiPoint3A NiPoint3A::ZERO = { 0.0F, 0.0F, 0.0F }; + + NiPoint3::NiPoint3(const NiPoint2& a_point) noexcept : + x(a_point.x), y(a_point.y) + {} + + NiPoint3::NiPoint3(float a_x, float a_y, float a_z) noexcept : + x(a_x), y(a_y), z(a_z) + {} + + float& NiPoint3::operator[](std::size_t a_pos) noexcept + { + assert(a_pos < 3); + return std::addressof(x)[a_pos]; + } + + const float& NiPoint3::operator[](std::size_t a_pos) const noexcept + { + assert(a_pos < 3); + return std::addressof(x)[a_pos]; + } + + bool NiPoint3::operator==(const NiPoint3& a_rhs) const noexcept + { + return (x == a_rhs.x) && (y == a_rhs.y) && (z == a_rhs.z); + } + + bool NiPoint3::operator!=(const NiPoint3& a_rhs) const noexcept + { + return !operator==(a_rhs); + } + + bool NiPoint3::operator<(const NiPoint3& a_rhs) const noexcept + { + return std::tie(x, y, z) < std::tie(a_rhs.x, a_rhs.y, a_rhs.z); + } + + bool NiPoint3::operator>(const NiPoint3& a_rhs) const noexcept + { + return std::tie(x, y, z) > std::tie(a_rhs.x, a_rhs.y, a_rhs.z); + } + + NiPoint3 NiPoint3::operator+(const NiPoint3& a_rhs) const noexcept + { + return NiPoint3(x + a_rhs.x, y + a_rhs.y, z + a_rhs.z); + } + + NiPoint3 NiPoint3::operator-(const NiPoint3& a_rhs) const noexcept + { + return NiPoint3(x - a_rhs.x, y - a_rhs.y, z - a_rhs.z); + } + + NiPoint3 NiPoint3::operator*(const NiPoint3& a_rhs) const noexcept + { + return NiPoint3(x * a_rhs.x, y * a_rhs.y, z * a_rhs.z); + } + + NiPoint3 NiPoint3::operator/(const NiPoint3& a_rhs) const noexcept + { + return NiPoint3(x / a_rhs.x, y / a_rhs.y, z / a_rhs.z); + } + + NiPoint3 NiPoint3::operator*(float a_scalar) const noexcept + { + return NiPoint3(x * a_scalar, y * a_scalar, z * a_scalar); + } + + NiPoint3 NiPoint3::operator/(float a_scalar) const noexcept + { + return NiPoint3(x / a_scalar, y / a_scalar, z / a_scalar); + } + + NiPoint3 NiPoint3::operator-() const noexcept + { + return NiPoint3(-x, -y, -z); + } + + NiPoint3& NiPoint3::operator+=(const NiPoint3& a_rhs) noexcept + { + x += a_rhs.x; + y += a_rhs.y; + z += a_rhs.z; + return *this; + } + + NiPoint3& NiPoint3::operator-=(const NiPoint3& a_rhs) noexcept + { + x -= a_rhs.x; + y -= a_rhs.y; + z -= a_rhs.z; + return *this; + } + + NiPoint3& NiPoint3::operator*=(const NiPoint3& a_rhs) noexcept + { + x *= a_rhs.x; + y *= a_rhs.y; + z *= a_rhs.z; + return *this; + } + + NiPoint3& NiPoint3::operator/=(const NiPoint3& a_rhs) noexcept + { + x /= a_rhs.x; + y /= a_rhs.y; + z /= a_rhs.z; + return *this; + } + + NiPoint3& NiPoint3::operator+=(float a_scalar) noexcept + { + x += a_scalar; + y += a_scalar; + z += a_scalar; + return *this; + } + + NiPoint3& NiPoint3::operator-=(float a_scalar) noexcept + { + x -= a_scalar; + y -= a_scalar; + z -= a_scalar; + return *this; + } + + NiPoint3& NiPoint3::operator*=(float a_scalar) noexcept + { + x *= a_scalar; + y *= a_scalar; + z *= a_scalar; + return *this; + } + + NiPoint3& NiPoint3::operator/=(float a_scalar) noexcept + { + x /= a_scalar; + y /= a_scalar; + z /= a_scalar; + return *this; + } + + NiPoint3 NiPoint3::Cross(const NiPoint3& a_point) const noexcept + { + return NiPoint3( + y * a_point.z - z * a_point.y, + z * a_point.x - x * a_point.z, + x * a_point.y - y * a_point.x); + } + + float NiPoint3::Dot(const NiPoint3& a_point) const noexcept + { + return x * a_point.x + y * a_point.y + z * a_point.z; + } + + float NiPoint3::GetDistance(const NiPoint3& a_point) const noexcept + { + return std::sqrtf(GetSquaredDistance(a_point)); + } + + float NiPoint3::GetSquaredDistance(const NiPoint3& a_point) const noexcept + { + const float dx = a_point.x - x; + const float dy = a_point.y - y; + const float dz = a_point.z - z; + return dx * dx + dy * dy + dz * dz; + } + + float NiPoint3::GetZAngleFromVector() const + { + using func_t = decltype(&NiPoint3::GetZAngleFromVector); + static REL::Relocation func{ REL::ID(1450064) }; + return func(this); + } + + float NiPoint3::Length() const noexcept + { + return std::sqrtf(x * x + y * y + z * z); + } + + float NiPoint3::SqrLength() const noexcept + { + return x * x + y * y + z * z; + } + + NiPoint3 NiPoint3::UnitCross(const NiPoint3& a_point) const noexcept + { + auto cross = Cross(a_point); + cross.Unitize(); + return cross; + } + + float NiPoint3::Unitize() noexcept + { + auto length = Length(); + if (length == 1.f) { + return length; + } else if (length > FLT_EPSILON) { + operator/=(length); + } else { + x = 0.0; + y = 0.0; + z = 0.0; + length = 0.0; + } + return length; + } +} + +namespace RE +{ + const NiPoint4 NiPoint4::ZERO = { 0.0F, 0.0F, 0.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY0 = { 1.0F, 0.0F, 0.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY1 = { 0.0F, 1.0F, 0.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY2 = { 0.0F, 0.0F, 1.0F, 0.0F }; + const NiPoint4 NiPoint4::IDENTITY3 = { 0.0F, 0.0F, 0.0F, 1.0F }; + + NiPoint4::NiPoint4(const NiPoint2& a_point) noexcept : + x(a_point.x), y(a_point.y) + {} + + NiPoint4::NiPoint4(const NiPoint3& a_point) noexcept : + x(a_point.x), y(a_point.y), z(a_point.z) + {} + + NiPoint4::NiPoint4(float a_x, float a_y, float a_z, float a_w) noexcept : + x(a_x), y(a_y), z(a_z), w(a_w) + {} + + float& NiPoint4::operator[](std::size_t a_pos) noexcept + { + assert(a_pos < 4); + return std::addressof(x)[a_pos]; + } + + const float& NiPoint4::operator[](std::size_t a_pos) const noexcept + { + assert(a_pos < 4); + return std::addressof(x)[a_pos]; + } + + bool NiPoint4::operator==(const NiPoint4& a_rhs) const noexcept + { + return (x == a_rhs.x) && (y == a_rhs.y) && (z == a_rhs.z) && (w == a_rhs.w); + } + + bool NiPoint4::operator!=(const NiPoint4& a_rhs) const noexcept + { + return !operator==(a_rhs); + } + + bool NiPoint4::operator<(const NiPoint4& a_rhs) const noexcept + { + return std::tie(x, y, z, w) < std::tie(a_rhs.x, a_rhs.y, a_rhs.z, a_rhs.w); + } + + bool NiPoint4::operator>(const NiPoint4& a_rhs) const noexcept + { + return std::tie(x, y, z, w) > std::tie(a_rhs.x, a_rhs.y, a_rhs.z, a_rhs.w); + } + + NiPoint4 NiPoint4::operator+(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x + a_rhs.x, y + a_rhs.y, z + a_rhs.z, w + a_rhs.w); + } + + NiPoint4 NiPoint4::operator-(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x - a_rhs.x, y - a_rhs.y, z - a_rhs.z, w - a_rhs.w); + } + + NiPoint4 NiPoint4::operator*(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x * a_rhs.x, y * a_rhs.y, z * a_rhs.z, w * a_rhs.w); + } + + NiPoint4 NiPoint4::operator/(const NiPoint4& a_rhs) const noexcept + { + return NiPoint4(x / a_rhs.x, y / a_rhs.y, z / a_rhs.z, w / a_rhs.w); + } + + NiPoint4 NiPoint4::operator*(float a_scalar) const noexcept + { + return NiPoint4(x * a_scalar, y * a_scalar, z * a_scalar, w * a_scalar); + } + + NiPoint4 NiPoint4::operator/(float a_scalar) const noexcept + { + return operator*(1.0F / a_scalar); + } + + NiPoint4 NiPoint4::operator-() const noexcept + { + return NiPoint4(-x, -y, -z, -w); + } + + NiPoint4& NiPoint4::operator+=(const NiPoint4& a_rhs) noexcept + { + x += a_rhs.x; + y += a_rhs.y; + z += a_rhs.z; + w += a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator-=(const NiPoint4& a_rhs) noexcept + { + x -= a_rhs.x; + y -= a_rhs.y; + z -= a_rhs.z; + w -= a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator*=(const NiPoint4& a_rhs) noexcept + { + x *= a_rhs.x; + y *= a_rhs.y; + z *= a_rhs.z; + w *= a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator/=(const NiPoint4& a_rhs) noexcept + { + x /= a_rhs.x; + y /= a_rhs.y; + z /= a_rhs.z; + w /= a_rhs.w; + return *this; + } + + NiPoint4& NiPoint4::operator+=(float a_scalar) noexcept + { + x += a_scalar; + y += a_scalar; + z += a_scalar; + w += a_scalar; + return *this; + } + + NiPoint4& NiPoint4::operator-=(float a_scalar) noexcept + { + x -= a_scalar; + y -= a_scalar; + z -= a_scalar; + w -= a_scalar; + return *this; + } + + NiPoint4& NiPoint4::operator*=(float a_scalar) noexcept + { + x *= a_scalar; + y *= a_scalar; + z *= a_scalar; + w *= a_scalar; + return *this; + } + + NiPoint4& NiPoint4::operator/=(float a_scalar) noexcept + { + x /= a_scalar; + y /= a_scalar; + z /= a_scalar; + w /= a_scalar; + return *this; + } +} diff --git a/CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp b/CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp deleted file mode 100644 index 4711d416..00000000 --- a/CommonLibF4/src/RE/NetImmerse/NiPoint2.cpp +++ /dev/null @@ -1,133 +0,0 @@ -#include "RE/NetImmerse/NiPoint2.h" - -namespace RE -{ - const NiPoint2 NiPoint2::ZERO = { 0.0F, 0.0F }; - - NiPoint2::NiPoint2(float a_x, float a_y) noexcept : - x(a_x), y(a_y) - {} - - float& NiPoint2::operator[](std::size_t a_pos) noexcept - { - assert(a_pos < 2); - return std::addressof(x)[a_pos]; - } - - const float& NiPoint2::operator[](std::size_t a_pos) const noexcept - { - assert(a_pos < 2); - return std::addressof(x)[a_pos]; - } - - bool NiPoint2::operator==(const NiPoint2& a_rhs) const noexcept - { - return (x == a_rhs.x) && (y == a_rhs.y); - } - - bool NiPoint2::operator!=(const NiPoint2& a_rhs) const noexcept - { - return !operator==(a_rhs); - } - - bool NiPoint2::operator<(const NiPoint2& a_rhs) const noexcept - { - return std::tie(x, y) < std::tie(a_rhs.x, a_rhs.y); - } - - bool NiPoint2::operator>(const NiPoint2& a_rhs) const noexcept - { - return std::tie(x, y) > std::tie(a_rhs.x, a_rhs.y); - } - - NiPoint2 NiPoint2::operator+(const NiPoint2& a_rhs) const noexcept - { - return NiPoint2(x + a_rhs.x, y + a_rhs.y); - } - - NiPoint2 NiPoint2::operator-(const NiPoint2& a_rhs) const noexcept - { - return NiPoint2(x - a_rhs.x, y - a_rhs.y); - } - - NiPoint2 NiPoint2::operator*(const NiPoint2& a_rhs) const noexcept - { - return NiPoint2(x * a_rhs.x, y * a_rhs.y); - } - - NiPoint2 NiPoint2::operator/(const NiPoint2& a_rhs) const noexcept - { - return NiPoint2(x / a_rhs.x, y / a_rhs.y); - } - - NiPoint2 NiPoint2::operator*(float a_scalar) const noexcept - { - return NiPoint2(x * a_scalar, y * a_scalar); - } - - NiPoint2 NiPoint2::operator/(float a_scalar) const noexcept - { - return NiPoint2(x / a_scalar, y / a_scalar); - } - - NiPoint2 NiPoint2::operator-() const noexcept - { - return NiPoint2(-x, -y); - } - - NiPoint2& NiPoint2::operator+=(const NiPoint2& a_rhs) noexcept - { - x += a_rhs.x; - y += a_rhs.y; - return *this; - } - - NiPoint2& NiPoint2::operator-=(const NiPoint2& a_rhs) noexcept - { - x -= a_rhs.x; - y -= a_rhs.y; - return *this; - } - - NiPoint2& NiPoint2::operator*=(const NiPoint2& a_rhs) noexcept - { - x *= a_rhs.x; - y *= a_rhs.y; - return *this; - } - - NiPoint2& NiPoint2::operator/=(const NiPoint2& a_rhs) noexcept - { - x /= a_rhs.x; - y /= a_rhs.y; - return *this; - } - - NiPoint2& NiPoint2::operator+=(float a_scalar) noexcept - { - x += a_scalar; - y += a_scalar; - return *this; - } - - NiPoint2& NiPoint2::operator-=(float a_scalar) noexcept - { - x -= a_scalar; - y -= a_scalar; - return *this; - } - - NiPoint2& NiPoint2::operator*=(float a_scalar) noexcept - { - x *= a_scalar; - y *= a_scalar; - return *this; - } - - NiPoint2& NiPoint2::operator/=(float a_scalar) noexcept - { - x /= a_scalar; - y /= a_scalar; - return *this; - } -} diff --git a/CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp b/CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp deleted file mode 100644 index 0cab9a51..00000000 --- a/CommonLibF4/src/RE/NetImmerse/NiPoint3.cpp +++ /dev/null @@ -1,212 +0,0 @@ -#include "RE/NetImmerse/NiPoint3.h" - -namespace RE -{ - const NiPoint3 NiPoint3::ZERO = { 0.0F, 0.0F, 0.0F }; - const NiPoint3A NiPoint3A::ZERO = { 0.0F, 0.0F, 0.0F }; - - NiPoint3::NiPoint3(const NiPoint2& a_point) noexcept : - x(a_point.x), y(a_point.y) - {} - - NiPoint3::NiPoint3(float a_x, float a_y, float a_z) noexcept : - x(a_x), y(a_y), z(a_z) - {} - - float& NiPoint3::operator[](std::size_t a_pos) noexcept - { - assert(a_pos < 3); - return std::addressof(x)[a_pos]; - } - - const float& NiPoint3::operator[](std::size_t a_pos) const noexcept - { - assert(a_pos < 3); - return std::addressof(x)[a_pos]; - } - - bool NiPoint3::operator==(const NiPoint3& a_rhs) const noexcept - { - return (x == a_rhs.x) && (y == a_rhs.y) && (z == a_rhs.z); - } - - bool NiPoint3::operator!=(const NiPoint3& a_rhs) const noexcept - { - return !operator==(a_rhs); - } - - bool NiPoint3::operator<(const NiPoint3& a_rhs) const noexcept - { - return std::tie(x, y, z) < std::tie(a_rhs.x, a_rhs.y, a_rhs.z); - } - - bool NiPoint3::operator>(const NiPoint3& a_rhs) const noexcept - { - return std::tie(x, y, z) > std::tie(a_rhs.x, a_rhs.y, a_rhs.z); - } - - NiPoint3 NiPoint3::operator+(const NiPoint3& a_rhs) const noexcept - { - return NiPoint3(x + a_rhs.x, y + a_rhs.y, z + a_rhs.z); - } - - NiPoint3 NiPoint3::operator-(const NiPoint3& a_rhs) const noexcept - { - return NiPoint3(x - a_rhs.x, y - a_rhs.y, z - a_rhs.z); - } - - NiPoint3 NiPoint3::operator*(const NiPoint3& a_rhs) const noexcept - { - return NiPoint3(x * a_rhs.x, y * a_rhs.y, z * a_rhs.z); - } - - NiPoint3 NiPoint3::operator/(const NiPoint3& a_rhs) const noexcept - { - return NiPoint3(x / a_rhs.x, y / a_rhs.y, z / a_rhs.z); - } - - NiPoint3 NiPoint3::operator*(float a_scalar) const noexcept - { - return NiPoint3(x * a_scalar, y * a_scalar, z * a_scalar); - } - - NiPoint3 NiPoint3::operator/(float a_scalar) const noexcept - { - return NiPoint3(x / a_scalar, y / a_scalar, z / a_scalar); - } - - NiPoint3 NiPoint3::operator-() const noexcept - { - return NiPoint3(-x, -y, -z); - } - - NiPoint3& NiPoint3::operator+=(const NiPoint3& a_rhs) noexcept - { - x += a_rhs.x; - y += a_rhs.y; - z += a_rhs.z; - return *this; - } - - NiPoint3& NiPoint3::operator-=(const NiPoint3& a_rhs) noexcept - { - x -= a_rhs.x; - y -= a_rhs.y; - z -= a_rhs.z; - return *this; - } - - NiPoint3& NiPoint3::operator*=(const NiPoint3& a_rhs) noexcept - { - x *= a_rhs.x; - y *= a_rhs.y; - z *= a_rhs.z; - return *this; - } - - NiPoint3& NiPoint3::operator/=(const NiPoint3& a_rhs) noexcept - { - x /= a_rhs.x; - y /= a_rhs.y; - z /= a_rhs.z; - return *this; - } - - NiPoint3& NiPoint3::operator+=(float a_scalar) noexcept - { - x += a_scalar; - y += a_scalar; - z += a_scalar; - return *this; - } - - NiPoint3& NiPoint3::operator-=(float a_scalar) noexcept - { - x -= a_scalar; - y -= a_scalar; - z -= a_scalar; - return *this; - } - - NiPoint3& NiPoint3::operator*=(float a_scalar) noexcept - { - x *= a_scalar; - y *= a_scalar; - z *= a_scalar; - return *this; - } - - NiPoint3& NiPoint3::operator/=(float a_scalar) noexcept - { - x /= a_scalar; - y /= a_scalar; - z /= a_scalar; - return *this; - } - - NiPoint3 NiPoint3::Cross(const NiPoint3& a_point) const noexcept - { - return NiPoint3( - y * a_point.z - z * a_point.y, - z * a_point.x - x * a_point.z, - x * a_point.y - y * a_point.x); - } - - float NiPoint3::Dot(const NiPoint3& a_point) const noexcept - { - return x * a_point.x + y * a_point.y + z * a_point.z; - } - - float NiPoint3::GetDistance(const NiPoint3& a_point) const noexcept - { - return std::sqrtf(GetSquaredDistance(a_point)); - } - - float NiPoint3::GetSquaredDistance(const NiPoint3& a_point) const noexcept - { - const float dx = a_point.x - x; - const float dy = a_point.y - y; - const float dz = a_point.z - z; - return dx * dx + dy * dy + dz * dz; - } - - float NiPoint3::GetZAngleFromVector() const - { - using func_t = decltype(&NiPoint3::GetZAngleFromVector); - static REL::Relocation func{ REL::ID(1450064) }; - return func(this); - } - - float NiPoint3::Length() const noexcept - { - return std::sqrtf(x * x + y * y + z * z); - } - - float NiPoint3::SqrLength() const noexcept - { - return x * x + y * y + z * z; - } - - NiPoint3 NiPoint3::UnitCross(const NiPoint3& a_point) const noexcept - { - auto cross = Cross(a_point); - cross.Unitize(); - return cross; - } - - float NiPoint3::Unitize() noexcept - { - auto length = Length(); - if (length == 1.f) { - return length; - } else if (length > FLT_EPSILON) { - operator/=(length); - } else { - x = 0.0; - y = 0.0; - z = 0.0; - length = 0.0; - } - return length; - } -} diff --git a/CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp b/CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp deleted file mode 100644 index 46d3019f..00000000 --- a/CommonLibF4/src/RE/NetImmerse/NiPoint4.cpp +++ /dev/null @@ -1,161 +0,0 @@ -#include "RE/NetImmerse/NiPoint4.h" - -namespace RE -{ - const NiPoint4 NiPoint4::ZERO = { 0.0F, 0.0F, 0.0F, 0.0F }; - const NiPoint4 NiPoint4::IDENTITY0 = { 1.0F, 0.0F, 0.0F, 0.0F }; - const NiPoint4 NiPoint4::IDENTITY1 = { 0.0F, 1.0F, 0.0F, 0.0F }; - const NiPoint4 NiPoint4::IDENTITY2 = { 0.0F, 0.0F, 1.0F, 0.0F }; - const NiPoint4 NiPoint4::IDENTITY3 = { 0.0F, 0.0F, 0.0F, 1.0F }; - - NiPoint4::NiPoint4(const NiPoint2& a_point) noexcept : - x(a_point.x), y(a_point.y) - {} - - NiPoint4::NiPoint4(const NiPoint3& a_point) noexcept : - x(a_point.x), y(a_point.y), z(a_point.z) - {} - - NiPoint4::NiPoint4(float a_x, float a_y, float a_z, float a_w) noexcept : - x(a_x), y(a_y), z(a_z), w(a_w) - {} - - float& NiPoint4::operator[](std::size_t a_pos) noexcept - { - assert(a_pos < 4); - return std::addressof(x)[a_pos]; - } - - const float& NiPoint4::operator[](std::size_t a_pos) const noexcept - { - assert(a_pos < 4); - return std::addressof(x)[a_pos]; - } - - bool NiPoint4::operator==(const NiPoint4& a_rhs) const noexcept - { - return (x == a_rhs.x) && (y == a_rhs.y) && (z == a_rhs.z) && (w == a_rhs.w); - } - - bool NiPoint4::operator!=(const NiPoint4& a_rhs) const noexcept - { - return !operator==(a_rhs); - } - - bool NiPoint4::operator<(const NiPoint4& a_rhs) const noexcept - { - return std::tie(x, y, z, w) < std::tie(a_rhs.x, a_rhs.y, a_rhs.z, a_rhs.w); - } - - bool NiPoint4::operator>(const NiPoint4& a_rhs) const noexcept - { - return std::tie(x, y, z, w) > std::tie(a_rhs.x, a_rhs.y, a_rhs.z, a_rhs.w); - } - - NiPoint4 NiPoint4::operator+(const NiPoint4& a_rhs) const noexcept - { - return NiPoint4(x + a_rhs.x, y + a_rhs.y, z + a_rhs.z, w + a_rhs.w); - } - - NiPoint4 NiPoint4::operator-(const NiPoint4& a_rhs) const noexcept - { - return NiPoint4(x - a_rhs.x, y - a_rhs.y, z - a_rhs.z, w - a_rhs.w); - } - - NiPoint4 NiPoint4::operator*(const NiPoint4& a_rhs) const noexcept - { - return NiPoint4(x * a_rhs.x, y * a_rhs.y, z * a_rhs.z, w * a_rhs.w); - } - - NiPoint4 NiPoint4::operator/(const NiPoint4& a_rhs) const noexcept - { - return NiPoint4(x / a_rhs.x, y / a_rhs.y, z / a_rhs.z, w / a_rhs.w); - } - - NiPoint4 NiPoint4::operator*(float a_scalar) const noexcept - { - return NiPoint4(x * a_scalar, y * a_scalar, z * a_scalar, w * a_scalar); - } - - NiPoint4 NiPoint4::operator/(float a_scalar) const noexcept - { - return operator*(1.0F / a_scalar); - } - - NiPoint4 NiPoint4::operator-() const noexcept - { - return NiPoint4(-x, -y, -z, -w); - } - - NiPoint4& NiPoint4::operator+=(const NiPoint4& a_rhs) noexcept - { - x += a_rhs.x; - y += a_rhs.y; - z += a_rhs.z; - w += a_rhs.w; - return *this; - } - - NiPoint4& NiPoint4::operator-=(const NiPoint4& a_rhs) noexcept - { - x -= a_rhs.x; - y -= a_rhs.y; - z -= a_rhs.z; - w -= a_rhs.w; - return *this; - } - - NiPoint4& NiPoint4::operator*=(const NiPoint4& a_rhs) noexcept - { - x *= a_rhs.x; - y *= a_rhs.y; - z *= a_rhs.z; - w *= a_rhs.w; - return *this; - } - - NiPoint4& NiPoint4::operator/=(const NiPoint4& a_rhs) noexcept - { - x /= a_rhs.x; - y /= a_rhs.y; - z /= a_rhs.z; - w /= a_rhs.w; - return *this; - } - - NiPoint4& NiPoint4::operator+=(float a_scalar) noexcept - { - x += a_scalar; - y += a_scalar; - z += a_scalar; - w += a_scalar; - return *this; - } - - NiPoint4& NiPoint4::operator-=(float a_scalar) noexcept - { - x -= a_scalar; - y -= a_scalar; - z -= a_scalar; - w -= a_scalar; - return *this; - } - - NiPoint4& NiPoint4::operator*=(float a_scalar) noexcept - { - x *= a_scalar; - y *= a_scalar; - z *= a_scalar; - w *= a_scalar; - return *this; - } - - NiPoint4& NiPoint4::operator/=(float a_scalar) noexcept - { - x /= a_scalar; - y /= a_scalar; - z /= a_scalar; - w /= a_scalar; - return *this; - } -} From 55030ee3a64c7238b1bb509c074c6f6781f77343 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Fri, 7 Jun 2024 23:14:47 -0500 Subject: [PATCH 9/9] feat: add `static` to all `Relocation` uses --- .../include/RE/Bethesda/ActiveEffect.h | 2 +- .../include/RE/Bethesda/ActorValueInfo.h | 2 +- CommonLibF4/include/RE/Bethesda/Archive2.h | 28 ++-- .../RE/Bethesda/BGSCreatedObjectManager.h | 6 +- .../RE/Bethesda/BGSDefaultObjectManager.h | 8 +- .../Bethesda/BGSDynamicPersistenceManager.h | 6 +- .../include/RE/Bethesda/BGSEntryPoint.h | 2 +- .../RE/Bethesda/BGSInventoryInterface.h | 4 +- .../include/RE/Bethesda/BGSInventoryItem.h | 10 +- CommonLibF4/include/RE/Bethesda/BGSMod.h | 12 +- CommonLibF4/include/RE/Bethesda/BGSSaveLoad.h | 4 +- .../RE/Bethesda/BGSStoryEventManager.h | 12 +- .../RE/Bethesda/BGSStoryManagerTreeForm.h | 6 +- .../BGSSynchronizedAnimationManager.h | 4 +- .../include/RE/Bethesda/BSAudioManager.h | 4 +- CommonLibF4/include/RE/Bethesda/BSExtraData.h | 34 ++--- CommonLibF4/include/RE/Bethesda/BSGeometry.h | 2 +- CommonLibF4/include/RE/Bethesda/BSGraphics.h | 12 +- CommonLibF4/include/RE/Bethesda/BSHavok.h | 2 +- .../RE/Bethesda/BSInputDeviceManager.h | 2 +- .../RE/Bethesda/BSInputEnableManager.h | 10 +- CommonLibF4/include/RE/Bethesda/BSLock.h | 12 +- CommonLibF4/include/RE/Bethesda/BSModelDB.h | 6 +- .../include/RE/Bethesda/BSPointerHandle.h | 6 +- CommonLibF4/include/RE/Bethesda/BSResource.h | 2 +- .../include/RE/Bethesda/BSResource/Entry.h | 2 +- .../RE/Bethesda/BSResource/GlobalLocations.h | 2 +- .../RE/Bethesda/BSResource/GlobalPaths.h | 2 +- .../include/RE/Bethesda/BSScaleformManager.h | 10 +- .../RE/Bethesda/BSScript/ArrayWrapper.h | 2 +- .../BSScript/NF_util/NativeFunctionBase.h | 2 +- .../include/RE/Bethesda/BSScript/Object.h | 6 +- .../RE/Bethesda/BSScript/ObjectBindPolicy.h | 4 +- .../include/RE/Bethesda/BSScript/Stack.h | 4 +- .../include/RE/Bethesda/BSScriptUtil.h | 2 +- .../include/RE/Bethesda/BSShaderProperty.h | 2 +- .../include/RE/Bethesda/BSSoundHandle.h | 4 +- .../include/RE/Bethesda/BSStringPool.h | 8 +- CommonLibF4/include/RE/Bethesda/BSStringT.h | 2 +- .../RE/Bethesda/BSSystemFileStreamer.h | 2 +- .../include/RE/Bethesda/BSSystemUtility.h | 2 +- CommonLibF4/include/RE/Bethesda/BSTEvent.h | 2 +- .../include/RE/Bethesda/BSTempEffect.h | 2 +- CommonLibF4/include/RE/Bethesda/BSTextureDB.h | 2 +- .../include/RE/Bethesda/BSTextureSet.h | 2 +- CommonLibF4/include/RE/Bethesda/Calendar.h | 2 +- .../include/RE/Bethesda/CombatFormulas.h | 8 +- CommonLibF4/include/RE/Bethesda/Console.h | 6 +- CommonLibF4/include/RE/Bethesda/ControlMap.h | 12 +- CommonLibF4/include/RE/Bethesda/Events.h | 30 ++--- .../include/RE/Bethesda/FavoritesManager.h | 4 +- .../include/RE/Bethesda/FormComponents.h | 36 ++--- CommonLibF4/include/RE/Bethesda/FormFactory.h | 2 +- .../include/RE/Bethesda/GamePlayFormulas.h | 8 +- CommonLibF4/include/RE/Bethesda/GameScript.h | 20 +-- CommonLibF4/include/RE/Bethesda/IMenu.h | 126 +++++++++--------- .../include/RE/Bethesda/ImageSpaceManager.h | 2 +- .../include/RE/Bethesda/ImageSpaceModifier.h | 8 +- CommonLibF4/include/RE/Bethesda/Interface3D.h | 38 +++--- .../RE/Bethesda/InventoryUserUIUtils.h | 10 +- CommonLibF4/include/RE/Bethesda/ItemCrafted.h | 6 +- CommonLibF4/include/RE/Bethesda/MagicItems.h | 2 +- .../include/RE/Bethesda/MemoryManager.h | 8 +- .../include/RE/Bethesda/MenuControls.h | 2 +- CommonLibF4/include/RE/Bethesda/MenuCursor.h | 10 +- .../include/RE/Bethesda/MenuTopicManager.h | 2 +- .../include/RE/Bethesda/MessageMenuManager.h | 4 +- .../RE/Bethesda/PipboyInventoryUtils.h | 6 +- .../include/RE/Bethesda/PipboyManager.h | 52 ++++---- .../include/RE/Bethesda/PlayerCharacter.h | 38 +++--- .../include/RE/Bethesda/PlayerControls.h | 8 +- .../include/RE/Bethesda/ProcessLists.h | 8 +- .../RE/Bethesda/SWFToCodeFunctionHandler.h | 4 +- CommonLibF4/include/RE/Bethesda/Script.h | 12 +- .../include/RE/Bethesda/SendHUDMessage.h | 8 +- CommonLibF4/include/RE/Bethesda/Settings.h | 8 +- CommonLibF4/include/RE/Bethesda/Sky.h | 6 +- CommonLibF4/include/RE/Bethesda/SplineUtils.h | 4 +- .../include/RE/Bethesda/TESBoundAnimObjects.h | 2 +- .../include/RE/Bethesda/TESBoundObjects.h | 10 +- CommonLibF4/include/RE/Bethesda/TESCamera.h | 16 +-- .../include/RE/Bethesda/TESCondition.h | 8 +- .../include/RE/Bethesda/TESDataHandler.h | 10 +- CommonLibF4/include/RE/Bethesda/TESFile.h | 14 +- CommonLibF4/include/RE/Bethesda/TESForms.h | 56 ++++---- .../include/RE/Bethesda/TESObjectREFRs.h | 88 ++++++------ .../include/RE/Bethesda/TESWorldSpace.h | 2 +- .../include/RE/Bethesda/TaskQueueInterface.h | 14 +- CommonLibF4/include/RE/Bethesda/UI.h | 14 +- CommonLibF4/include/RE/Bethesda/UIMessage.h | 8 +- .../include/RE/Bethesda/UIMessageQueue.h | 4 +- CommonLibF4/include/RE/Bethesda/Utilities.h | 16 +-- CommonLibF4/include/RE/Bethesda/VATS.h | 2 +- CommonLibF4/include/RE/Bethesda/Workshop.h | 46 +++---- .../RE/Bethesda/bhkCharacterController.h | 12 +- CommonLibF4/include/RE/Bethesda/bhkPickData.h | 20 +-- .../include/RE/Havok/hkLifoAllocator.h | 14 +- CommonLibF4/include/RE/Havok/hkMemoryRouter.h | 4 +- .../RE/Havok/hknpClosestHitCollector.h | 2 +- .../include/RE/NetImmerse/NiAlphaProperty.h | 10 +- .../include/RE/NetImmerse/NiController.h | 6 +- CommonLibF4/include/RE/NetImmerse/NiNode.h | 2 +- CommonLibF4/include/RE/NetImmerse/NiRTTI.h | 2 +- .../include/RE/NetImmerse/NiRefObject.h | 4 +- .../include/RE/NetImmerse/NiTCollection.h | 4 +- CommonLibF4/include/RE/NetImmerse/NiTexture.h | 2 +- .../include/RE/Scaleform/GFx/GFx_ASString.h | 2 +- .../include/RE/Scaleform/GFx/GFx_Loader.h | 2 +- .../include/RE/Scaleform/GFx/GFx_Player.h | 24 ++-- .../include/RE/Scaleform/Kernel/SF_Memory.h | 4 +- .../include/RE/Scaleform/Kernel/SF_SysAlloc.h | 4 +- CommonLibF4/include/RE/msvc/typeinfo.h | 4 +- 112 files changed, 597 insertions(+), 597 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/ActiveEffect.h b/CommonLibF4/include/RE/Bethesda/ActiveEffect.h index bedfdf39..2c73b34e 100644 --- a/CommonLibF4/include/RE/Bethesda/ActiveEffect.h +++ b/CommonLibF4/include/RE/Bethesda/ActiveEffect.h @@ -57,7 +57,7 @@ namespace RE bool CheckDisplacementSpellOnTarget() { using func_t = decltype(&ActiveEffect::CheckDisplacementSpellOnTarget); - REL::Relocation func{ REL::ID(1415178) }; + static REL::Relocation func{ REL::ID(1415178) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/ActorValueInfo.h b/CommonLibF4/include/RE/Bethesda/ActorValueInfo.h index 4607fcad..a695364f 100644 --- a/CommonLibF4/include/RE/Bethesda/ActorValueInfo.h +++ b/CommonLibF4/include/RE/Bethesda/ActorValueInfo.h @@ -58,7 +58,7 @@ namespace RE [[nodiscard]] static ActorValue* GetSingleton() { using func_t = decltype(&ActorValue::GetSingleton); - REL::Relocation func{ REL::ID(2189587) }; + static REL::Relocation func{ REL::ID(2189587) }; return func(); } diff --git a/CommonLibF4/include/RE/Bethesda/Archive2.h b/CommonLibF4/include/RE/Bethesda/Archive2.h index 44ff4f75..fac94f3d 100644 --- a/CommonLibF4/include/RE/Bethesda/Archive2.h +++ b/CommonLibF4/include/RE/Bethesda/Archive2.h @@ -168,35 +168,35 @@ namespace RE::BSResource::Archive2 ErrorCode DoOpen() override // 01 { using func_t = decltype(&ReaderStream::DoOpen); - REL::Relocation func{ REL::ID(762048) }; + static REL::Relocation func{ REL::ID(762048) }; return func(this); } void DoClose() override // 02 { using func_t = decltype(&ReaderStream::DoClose); - REL::Relocation func{ REL::ID(109149) }; + static REL::Relocation func{ REL::ID(109149) }; return func(this); } std::uint64_t DoGetKey() const override // 03 { using func_t = decltype(&ReaderStream::DoGetKey); - REL::Relocation func{ REL::ID(772817) }; + static REL::Relocation func{ REL::ID(772817) }; return func(this); } void DoClone(BSTSmartPointer& a_result) const override // 05 { using func_t = decltype(&ReaderStream::DoClone); - REL::Relocation func{ REL::ID(855081) }; + static REL::Relocation func{ REL::ID(855081) }; return func(this, a_result); } ErrorCode DoRead(void* a_buffer, std::uint64_t a_bytes, std::uint64_t& a_read) const override // 06 { using func_t = decltype(&ReaderStream::DoRead); - REL::Relocation func{ REL::ID(1359347) }; + static REL::Relocation func{ REL::ID(1359347) }; return func(this, a_buffer, a_bytes, a_read); } @@ -209,14 +209,14 @@ namespace RE::BSResource::Archive2 ErrorCode DoSeek(std::int64_t a_offset, SeekMode a_whence, std::uint64_t& a_pos) const override // 09 { using func_t = decltype(&ReaderStream::DoSeek); - REL::Relocation func{ REL::ID(1000164) }; + static REL::Relocation func{ REL::ID(1000164) }; return func(this, a_offset, a_whence, a_pos); } ErrorCode DoPrefetchAll(std::uint32_t a_priority) const override // 0E { using func_t = decltype(&ReaderStream::DoPrefetchAll); - REL::Relocation func{ REL::ID(1518821) }; + static REL::Relocation func{ REL::ID(1518821) }; return func(this, a_priority); } @@ -229,7 +229,7 @@ namespace RE::BSResource::Archive2 ErrorCode DoCreateAsync(BSTSmartPointer& a_result) const override // 10 { using func_t = decltype(&ReaderStream::DoCreateAsync); - REL::Relocation func{ REL::ID(893405) }; + static REL::Relocation func{ REL::ID(893405) }; return func(this, a_result); } @@ -272,14 +272,14 @@ namespace RE::BSResource::Archive2 ErrorCode DoOpen() override // 01 { using func_t = decltype(&AsyncReaderStream::DoOpen); - REL::Relocation func{ REL::ID(1401160) }; + static REL::Relocation func{ REL::ID(1401160) }; return func(this); } void DoClose() override // 02 { using func_t = decltype(&AsyncReaderStream::DoClose); - REL::Relocation func{ REL::ID(883012) }; + static REL::Relocation func{ REL::ID(883012) }; return func(this); } @@ -287,7 +287,7 @@ namespace RE::BSResource::Archive2 BSTSmartPointer& a_result) const override // 05 { using func_t = decltype(&AsyncReaderStream::DoClone); - REL::Relocation func{ REL::ID(803750) }; + static REL::Relocation func{ REL::ID(803750) }; return func(this, a_result); } @@ -297,7 +297,7 @@ namespace RE::BSResource::Archive2 std::uint64_t a_offset) const override // 06 { using func_t = decltype(&AsyncReaderStream::DoStartRead); - REL::Relocation func{ REL::ID(1215072) }; + static REL::Relocation func{ REL::ID(1215072) }; return func(this, a_buffer, a_bytes, a_offset); } @@ -307,7 +307,7 @@ namespace RE::BSResource::Archive2 std::uint64_t a_offset) const override // 07 { using func_t = decltype(&AsyncReaderStream::DoStartPacketAlignedBufferedRead); - REL::Relocation func{ REL::ID(603387) }; + static REL::Relocation func{ REL::ID(603387) }; return func(this, a_buffer, a_bytes, a_offset); } @@ -330,7 +330,7 @@ namespace RE::BSResource::Archive2 bool a_block) override // 0B { using func_t = decltype(&AsyncReaderStream::DoWait); - REL::Relocation func{ REL::ID(2269399) }; + static REL::Relocation func{ REL::ID(2269399) }; return func(this, a_transferred, a_block); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSCreatedObjectManager.h b/CommonLibF4/include/RE/Bethesda/BGSCreatedObjectManager.h index 6f592688..ab33901b 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSCreatedObjectManager.h +++ b/CommonLibF4/include/RE/Bethesda/BGSCreatedObjectManager.h @@ -53,21 +53,21 @@ namespace RE [[nodiscard]] static BGSCreatedObjectManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(1000678) }; + static REL::Relocation singleton{ REL::ID(1000678) }; return *singleton; } void DecrementRef(AlchemyItem* a_alchItem) { using func_t = decltype(&BGSCreatedObjectManager::DecrementRef); - REL::Relocation func{ REL::ID(230928) }; + static REL::Relocation func{ REL::ID(230928) }; return func(this, a_alchItem); } void IncrementRef(AlchemyItem* a_alchItem) { using func_t = decltype(&BGSCreatedObjectManager::IncrementRef); - REL::Relocation func{ REL::ID(1042515) }; + static REL::Relocation func{ REL::ID(1042515) }; return func(this, a_alchItem); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSDefaultObjectManager.h b/CommonLibF4/include/RE/Bethesda/BGSDefaultObjectManager.h index aa306a69..e9bba538 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSDefaultObjectManager.h +++ b/CommonLibF4/include/RE/Bethesda/BGSDefaultObjectManager.h @@ -430,7 +430,7 @@ namespace RE [[nodiscard]] inline std::span GetDefaultObjectData() { - REL::Relocation data{ REL::ID(838886) }; + static REL::Relocation data{ REL::ID(838886) }; return { *data }; } @@ -446,7 +446,7 @@ namespace RE [[nodiscard]] static BGSDefaultObjectManager* GetSingleton() { using func_t = decltype(&BGSDefaultObjectManager::GetSingleton); - REL::Relocation func{ REL::ID(484974) }; + static REL::Relocation func{ REL::ID(484974) }; return func(); } @@ -489,7 +489,7 @@ namespace RE [[nodiscard]] static BSTArray* GetSingleton() { - REL::Relocation**> singleton{ REL::ID(2690473) }; + static REL::Relocation**> singleton{ REL::ID(2690473) }; return *singleton; } @@ -508,7 +508,7 @@ namespace RE BGSDefaultObject* ctor(const char* a_name, ENUM_FORM_ID a_formType, const char* a_description) { using func_t = decltype(&BGSDefaultObject::ctor); - REL::Relocation func{ REL::ID(2197003) }; + static REL::Relocation func{ REL::ID(2197003) }; return func(this, a_name, a_formType, a_description); } }; diff --git a/CommonLibF4/include/RE/Bethesda/BGSDynamicPersistenceManager.h b/CommonLibF4/include/RE/Bethesda/BGSDynamicPersistenceManager.h index 44f55e40..a5a0240a 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSDynamicPersistenceManager.h +++ b/CommonLibF4/include/RE/Bethesda/BGSDynamicPersistenceManager.h @@ -15,21 +15,21 @@ namespace RE public: [[nodiscard]] static BGSDynamicPersistenceManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(109630) }; + static REL::Relocation singleton{ REL::ID(109630) }; return *singleton; } bool PromoteReference(TESObjectREFR* a_refr, TESForm* a_owner) { using func_t = decltype(&BGSDynamicPersistenceManager::PromoteReference); - REL::Relocation func{ REL::ID(1300345) }; + static REL::Relocation func{ REL::ID(1300345) }; return func(this, a_refr, a_owner); } bool DemoteReference(TESObjectREFR* a_refr, TESForm* a_owner, bool a_allowActors = false) { using func_t = decltype(&BGSDynamicPersistenceManager::DemoteReference); - REL::Relocation func{ REL::ID(222813) }; + static REL::Relocation func{ REL::ID(222813) }; return func(this, a_refr, a_owner, a_allowActors); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSEntryPoint.h b/CommonLibF4/include/RE/Bethesda/BGSEntryPoint.h index 7d588ab6..01a89339 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSEntryPoint.h +++ b/CommonLibF4/include/RE/Bethesda/BGSEntryPoint.h @@ -172,7 +172,7 @@ namespace RE inline void HandleEntryPoint(ENTRY_POINT a_entryPoint, Actor* a_perkOwner, Args... a_args) { using func_t = decltype(&BGSEntryPoint::HandleEntryPoint); - REL::Relocation func{ REL::ID(2206243) }; + static REL::Relocation func{ REL::ID(2206243) }; return func(a_entryPoint, a_perkOwner, a_args...); } } diff --git a/CommonLibF4/include/RE/Bethesda/BGSInventoryInterface.h b/CommonLibF4/include/RE/Bethesda/BGSInventoryInterface.h index 6c846ad4..f51d6d14 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSInventoryInterface.h +++ b/CommonLibF4/include/RE/Bethesda/BGSInventoryInterface.h @@ -62,14 +62,14 @@ namespace RE [[nodiscard]] static BGSInventoryInterface* GetSingleton() { - REL::Relocation singleton{ REL::ID(2689299) }; + static REL::Relocation singleton{ REL::ID(2689299) }; return *singleton; } [[nodiscard]] const BGSInventoryItem* RequestInventoryItem(const std::uint32_t& a_handleID) const { using func_t = decltype(&BGSInventoryInterface::RequestInventoryItem); - REL::Relocation func{ REL::ID(2194009) }; + static REL::Relocation func{ REL::ID(2194009) }; return func(this, a_handleID); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h b/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h index 25558e6e..82b59f45 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h +++ b/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h @@ -130,7 +130,7 @@ namespace RE bool FindAndWriteStackData(StackDataCompareFunctor& a_compareFunc, StackDataWriteFunctor& a_writeFunc, bool a_manualMerge, ObjectRefHandle a_owner) { using func_t = decltype(&BGSInventoryItem::FindAndWriteStackData); - REL::Relocation func{ REL::ID(770140) }; + static REL::Relocation func{ REL::ID(770140) }; return func(this, a_compareFunc, a_writeFunc, a_manualMerge, a_owner); } @@ -148,21 +148,21 @@ namespace RE [[nodiscard]] const char* GetDisplayFullName(std::uint32_t a_stackID) { using func_t = decltype(&BGSInventoryItem::GetDisplayFullName); - REL::Relocation func{ REL::ID(2194079) }; + static REL::Relocation func{ REL::ID(2194079) }; return func(this, a_stackID); } [[nodiscard]] TBO_InstanceData* GetInstanceData(std::uint32_t a_stackID) { using func_t = decltype(&BGSInventoryItem::GetInstanceData); - REL::Relocation func{ REL::ID(2194072) }; + static REL::Relocation func{ REL::ID(2194072) }; return func(this, a_stackID); } [[nodiscard]] std::int32_t GetInventoryValue(std::uint32_t a_stackID, bool a_scale) const { using func_t = decltype(&BGSInventoryItem::GetInventoryValue); - REL::Relocation func{ REL::ID(2194099) }; + static REL::Relocation func{ REL::ID(2194099) }; return func(this, a_stackID, a_scale); } @@ -183,7 +183,7 @@ namespace RE virtual void WriteDataImpl(TESBoundObject& a_baseObj, BGSInventoryItem::Stack& a_stack) override // 01 { using func_t = decltype(&ApplyChangesFunctor::WriteDataImpl); - REL::Relocation func{ REL::ID(2223194) }; + static REL::Relocation func{ REL::ID(2223194) }; return func(this, a_baseObj, a_stack); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSMod.h b/CommonLibF4/include/RE/Bethesda/BGSMod.h index 5cf2e0ff..63f40e2a 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSMod.h +++ b/CommonLibF4/include/RE/Bethesda/BGSMod.h @@ -134,7 +134,7 @@ namespace RE::BGSMod { [[nodiscard]] inline BSTHashMap& GetAllLooseMods() { - REL::Relocation*> mods{ REL::ID(1108112), -0x8 }; + static REL::Relocation*> mods{ REL::ID(1108112), -0x8 }; return *mods; } @@ -166,28 +166,28 @@ namespace RE::BGSMod static void FindModsForLooseMod(TESObjectMISC* a_looseMod, BSScrapArray& a_result) { using func_t = decltype(&Mod::FindModsForLooseMod); - REL::Relocation func{ REL::ID(410363) }; + static REL::Relocation func{ REL::ID(410363) }; return func(a_looseMod, a_result); } void GetData(Data& a_data) const { using func_t = decltype(&Mod::GetData); - REL::Relocation func{ REL::ID(33658) }; + static REL::Relocation func{ REL::ID(33658) }; return func(this, a_data); } TESObjectMISC* GetLooseMod() { using func_t = decltype(&Mod::GetLooseMod); - REL::Relocation func{ REL::ID(1359613) }; + static REL::Relocation func{ REL::ID(1359613) }; return func(this); } void SetLooseMod(TESObjectMISC* misc) { using func_t = decltype(&Mod::SetLooseMod); - REL::Relocation func{ REL::ID(123132) }; + static REL::Relocation func{ REL::ID(123132) }; return func(this, misc); } @@ -250,7 +250,7 @@ namespace RE::BGSMod static void CreateInstanceDataForObjectAndExtra(TESBoundObject& a_object, ExtraDataList& a_extra, const INSTANCE_FILTER* a_filter, bool a_useDefault) { using func_t = decltype(&Items::CreateInstanceDataForObjectAndExtra); - REL::Relocation func{ REL::ID(147297) }; + static REL::Relocation func{ REL::ID(147297) }; return func(a_object, a_extra, a_filter, a_useDefault); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSSaveLoad.h b/CommonLibF4/include/RE/Bethesda/BGSSaveLoad.h index 0bfe49cd..bafe229f 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSSaveLoad.h +++ b/CommonLibF4/include/RE/Bethesda/BGSSaveLoad.h @@ -123,14 +123,14 @@ namespace RE [[nodiscard]] static BGSSaveLoadManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(2697802) }; + static REL::Relocation singleton{ REL::ID(2697802) }; return *singleton; } void QueueSaveLoadTask(QUEUED_TASK a_task) { using func_t = decltype(&BGSSaveLoadManager::QueueSaveLoadTask); - REL::Relocation func{ REL::ID(2228080) }; + static REL::Relocation func{ REL::ID(2228080) }; return func(this, a_task); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSStoryEventManager.h b/CommonLibF4/include/RE/Bethesda/BGSStoryEventManager.h index 422eb2de..6708cba5 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSStoryEventManager.h +++ b/CommonLibF4/include/RE/Bethesda/BGSStoryEventManager.h @@ -17,14 +17,14 @@ namespace RE public: [[nodiscard]] static BGSStoryEventManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(2693504) }; + static REL::Relocation singleton{ REL::ID(2693504) }; return *singleton; } std::uint32_t AddEvent(std::uint32_t a_index, const void* a_event) { using func_t = std::uint32_t (BGSStoryEventManager::*)(std::uint32_t, const void*); - REL::Relocation func{ REL::ID(2214088) }; + static REL::Relocation func{ REL::ID(2214088) }; return func(this, a_index, a_event); } @@ -55,7 +55,7 @@ namespace RE [[nodiscard]] static std::uint32_t EVENT_INDEX() { - REL::Relocation eventIdx{ REL::ID(2663409) }; + static REL::Relocation eventIdx{ REL::ID(2663409) }; return *eventIdx; } @@ -79,7 +79,7 @@ namespace RE [[nodiscard]] static std::uint32_t EVENT_INDEX() { - REL::Relocation eventIdx{ REL::ID(1186942) }; + static REL::Relocation eventIdx{ REL::ID(1186942) }; return *eventIdx; } @@ -99,7 +99,7 @@ namespace RE [[nodiscard]] static std::uint32_t EVENT_INDEX() { - REL::Relocation eventIdx{ REL::ID(701969) }; + static REL::Relocation eventIdx{ REL::ID(701969) }; return *eventIdx; } @@ -112,7 +112,7 @@ namespace RE BGSPickLockEvent* ctor(TESObjectREFR* a_actor, TESObjectREFR* a_lockRef, bool a_isCrime) { using func_t = decltype(&BGSPickLockEvent::ctor); - REL::Relocation func{ REL::ID(193329) }; + static REL::Relocation func{ REL::ID(193329) }; return func(this, a_actor, a_lockRef, a_isCrime); } }; diff --git a/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h b/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h index df446d7f..467ed446 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h +++ b/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h @@ -103,7 +103,7 @@ namespace RE static void ParseString(BSStringT* a_inOutText, const TESQuest* a_quest, std::uint32_t a_instanceID) { using func_t = decltype(&BGSQuestInstanceText::ParseString); - REL::Relocation func{ REL::ID(2206630) }; + static REL::Relocation func{ REL::ID(2206630) }; return func(a_inOutText, a_quest, a_instanceID); } @@ -132,14 +132,14 @@ namespace RE bool SetStage(std::uint16_t a_stage) { using func_t = decltype(&TESQuest::SetStage); - REL::Relocation func{ REL::ID(2207743) }; + static REL::Relocation func{ REL::ID(2207743) }; return func(this, a_stage); } BSPointerHandle* GetAliasedRef(BSPointerHandle* a_result, std::uint32_t a_aiAliasID) { using func_t = decltype(&TESQuest::GetAliasedRef); - REL::Relocation func{ REL::ID(2207810) }; + static REL::Relocation func{ REL::ID(2207810) }; return func(this, a_result, a_aiAliasID); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSSynchronizedAnimationManager.h b/CommonLibF4/include/RE/Bethesda/BGSSynchronizedAnimationManager.h index 97fa6fb6..f6ef9580 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSSynchronizedAnimationManager.h +++ b/CommonLibF4/include/RE/Bethesda/BGSSynchronizedAnimationManager.h @@ -27,14 +27,14 @@ namespace RE [[nodiscard]] static BGSSynchronizedAnimationManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(2690996) }; + static REL::Relocation singleton{ REL::ID(2690996) }; return *singleton; } [[nodiscard]] bool IsReferenceInSynchronizedScene(ObjectRefHandle a_ref) { using func_t = decltype(&BGSSynchronizedAnimationManager::IsReferenceInSynchronizedScene); - REL::Relocation func{ REL::ID(2214437) }; + static REL::Relocation func{ REL::ID(2214437) }; return func(this, a_ref); } diff --git a/CommonLibF4/include/RE/Bethesda/BSAudioManager.h b/CommonLibF4/include/RE/Bethesda/BSAudioManager.h index 18e9055f..2c6bf8f7 100644 --- a/CommonLibF4/include/RE/Bethesda/BSAudioManager.h +++ b/CommonLibF4/include/RE/Bethesda/BSAudioManager.h @@ -72,14 +72,14 @@ namespace RE [[nodiscard]] static BSAudioManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(1321158) }; + static REL::Relocation singleton{ REL::ID(1321158) }; return *singleton; } void GetSoundHandleByName(BSSoundHandle& a_handle, const char* a_soundName, float a_distance, std::uint32_t a_usageFlags, BSISoundDescriptor::ExtraResolutionData* a_data) { using func_t = decltype(&BSAudioManager::GetSoundHandleByName); - REL::Relocation func{ REL::ID(196484) }; + static REL::Relocation func{ REL::ID(196484) }; return func(this, a_handle, a_soundName, a_distance, a_usageFlags, a_data); } diff --git a/CommonLibF4/include/RE/Bethesda/BSExtraData.h b/CommonLibF4/include/RE/Bethesda/BSExtraData.h index 2747934f..e7c0127b 100644 --- a/CommonLibF4/include/RE/Bethesda/BSExtraData.h +++ b/CommonLibF4/include/RE/Bethesda/BSExtraData.h @@ -454,21 +454,21 @@ namespace RE static bool AttachModToReference(TESObjectREFR& a_ref, BGSMod::Attachment::Mod& a_mod, std::uint8_t a_attachIndex, std::uint8_t a_rank) { using func_t = decltype(&BGSObjectInstanceExtra::AttachModToReference); - REL::Relocation func{ REL::ID(2189033) }; + static REL::Relocation func{ REL::ID(2189033) }; return func(a_ref, a_mod, a_attachIndex, a_rank); } bool HasMod(const BGSMod::Attachment::Mod& a_mod) { using func_t = decltype(&BGSObjectInstanceExtra::HasMod); - REL::Relocation func{ REL::ID(2189026) }; + static REL::Relocation func{ REL::ID(2189026) }; return func(this, a_mod); } void AddMod(const BGSMod::Attachment::Mod& a_newMod, std::uint8_t a_attachIndex, std::uint8_t a_rank, bool a_removeInvalidMods) { using func_t = decltype(&BGSObjectInstanceExtra::AddMod); - REL::Relocation func{ REL::ID(2189025) }; + static REL::Relocation func{ REL::ID(2189025) }; return func(this, a_newMod, a_attachIndex, a_rank, a_removeInvalidMods); } @@ -479,14 +479,14 @@ namespace RE std::uint32_t RemoveInvalidMods(const BGSAttachParentArray* a_baseObjectParents) { using func_t = decltype(&BGSObjectInstanceExtra::RemoveInvalidMods); - REL::Relocation func{ REL::ID(2189028) }; + static REL::Relocation func{ REL::ID(2189028) }; return func(this, a_baseObjectParents); } std::uint32_t RemoveMod(const BGSMod::Attachment::Mod* a_mod, std::uint8_t a_attachIndex) { using func_t = decltype(&BGSObjectInstanceExtra::RemoveMod); - REL::Relocation func{ REL::ID(2189027) }; + static REL::Relocation func{ REL::ID(2189027) }; return func(this, a_mod, a_attachIndex); } @@ -498,7 +498,7 @@ namespace RE BGSObjectInstanceExtra* ctor(const BGSMod::Template::Item* a_item, TESForm* a_parentForm, const INSTANCE_FILTER* a_filter) { using func_t = decltype(&BGSObjectInstanceExtra::ctor); - REL::Relocation func{ REL::ID(1222521) }; + static REL::Relocation func{ REL::ID(1222521) }; return func(this, a_item, a_parentForm, a_filter); } }; @@ -614,7 +614,7 @@ namespace RE [[nodiscard]] const BSFixedStringCS& GetDisplayName(TESBoundObject* a_baseObject) { using func_t = decltype(&ExtraTextDisplayData::GetDisplayName); - REL::Relocation func{ REL::ID(1523343) }; + static REL::Relocation func{ REL::ID(1523343) }; return func(this, a_baseObject); } @@ -839,7 +839,7 @@ namespace RE stl::observer CreateInstanceData(TESBoundObject* a_object, bool a_generateName) { using func_t = decltype(&ExtraDataList::CreateInstanceData); - REL::Relocation func{ REL::ID(2190185) }; + static REL::Relocation func{ REL::ID(2190185) }; return func(this, a_object, a_generateName); } @@ -858,7 +858,7 @@ namespace RE [[nodiscard]] BGSMod::Attachment::Mod* GetLegendaryMod() { using func_t = decltype(&ExtraDataList::GetLegendaryMod); - REL::Relocation func{ REL::ID(2190180) }; + static REL::Relocation func{ REL::ID(2190180) }; return func(this); } @@ -889,56 +889,56 @@ namespace RE bool SetBendableSplineInfo(float* a_thickness, float* a_slack, NiPoint3* a_halfExtents = nullptr, bool* a_detachedEnd = nullptr) { using func_t = decltype(&ExtraDataList::SetBendableSplineInfo); - REL::Relocation func{ REL::ID(2190623) }; + static REL::Relocation func{ REL::ID(2190623) }; return func(this, a_thickness, a_slack, a_halfExtents, a_detachedEnd); } void SetDisplayNameFromInstanceData(BGSObjectInstanceExtra* a_instExtra, TESBoundObject* a_object, const BSTSmartPointer& a_data) { using func_t = decltype(&ExtraDataList::SetDisplayNameFromInstanceData); - REL::Relocation func{ REL::ID(2190179) }; + static REL::Relocation func{ REL::ID(2190179) }; return func(this, a_instExtra, a_object, a_data); } void SetOverrideName(const char* a_name) { using func_t = decltype(&ExtraDataList::SetOverrideName); - REL::Relocation func{ REL::ID(2190167) }; + static REL::Relocation func{ REL::ID(2190167) }; return func(this, a_name); } void SetStartingWorldOrCell(TESForm* a_form) { using func_t = decltype(&ExtraDataList::SetStartingWorldOrCell); - REL::Relocation func{ REL::ID(2191213) }; + static REL::Relocation func{ REL::ID(2191213) }; return func(this, a_form); } float GetHealthPerc() { using func_t = decltype(&ExtraDataList::GetHealthPerc); - REL::Relocation func{ REL::ID(2190226) }; + static REL::Relocation func{ REL::ID(2190226) }; return func(this); } void SetHealthPerc(float a_healthPerc) { using func_t = decltype(&ExtraDataList::SetHealthPerc); - REL::Relocation func{ REL::ID(2190124) }; + static REL::Relocation func{ REL::ID(2190124) }; return func(this, a_healthPerc); } bool ClearFavorite() { using func_t = decltype(&ExtraDataList::ClearFavorite); - REL::Relocation func{ REL::ID(2190191) }; + static REL::Relocation func{ REL::ID(2190191) }; return func(this); } bool IsFavorite() { using func_t = decltype(&ExtraDataList::IsFavorite); - REL::Relocation func{ REL::ID(2190189) }; + static REL::Relocation func{ REL::ID(2190189) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/BSGeometry.h b/CommonLibF4/include/RE/Bethesda/BSGeometry.h index e49e9205..1cbc363d 100644 --- a/CommonLibF4/include/RE/Bethesda/BSGeometry.h +++ b/CommonLibF4/include/RE/Bethesda/BSGeometry.h @@ -67,7 +67,7 @@ namespace RE // override (BSGeometry) const NiRTTI* GetRTTI() const override // 02 { - REL::Relocation rtti{ BSTriShape::Ni_RTTI }; + static REL::Relocation rtti{ BSTriShape::Ni_RTTI }; return rtti.get(); } diff --git a/CommonLibF4/include/RE/Bethesda/BSGraphics.h b/CommonLibF4/include/RE/Bethesda/BSGraphics.h index 4fc10de3..09c15b27 100644 --- a/CommonLibF4/include/RE/Bethesda/BSGraphics.h +++ b/CommonLibF4/include/RE/Bethesda/BSGraphics.h @@ -245,7 +245,7 @@ namespace RE public: [[nodiscard]] static RendererData* GetSingleton() { - REL::Relocation singleton{ REL::ID(1235449) }; + static REL::Relocation singleton{ REL::ID(1235449) }; return *singleton; } @@ -287,13 +287,13 @@ namespace RE void IncRef(Buffer* a_vertexBuffer) { using func_t = decltype(&BSGraphics::Renderer::IncRef); - REL::Relocation func{ REL::ID(1337764) }; + static REL::Relocation func{ REL::ID(1337764) }; return func(this, a_vertexBuffer); } void DecRef(Buffer* a_vertexBuffer) { using func_t = decltype(&BSGraphics::Renderer::DecRef); - REL::Relocation func{ REL::ID(194808) }; + static REL::Relocation func{ REL::ID(194808) }; return func(this, a_vertexBuffer); } @@ -512,7 +512,7 @@ namespace RE public: [[nodiscard]] static State GetSingleton() { - REL::Relocation singleton{ REL::ID(600795) }; + static REL::Relocation singleton{ REL::ID(600795) }; return *singleton; } @@ -621,14 +621,14 @@ namespace RE [[nodiscard]] static RenderTargetManager GetSingleton() { - REL::Relocation singleton{ REL::ID(1508457) }; + static REL::Relocation singleton{ REL::ID(1508457) }; return *singleton; } void SetEnableDynamicResolution(bool a_enableDynamicResolution) { using func_t = decltype(&RenderTargetManager::SetEnableDynamicResolution); - REL::Relocation func{ REL::ID(116947) }; + static REL::Relocation func{ REL::ID(116947) }; return func(this, a_enableDynamicResolution); } diff --git a/CommonLibF4/include/RE/Bethesda/BSHavok.h b/CommonLibF4/include/RE/Bethesda/BSHavok.h index 3d9dbab3..57e6ecb5 100644 --- a/CommonLibF4/include/RE/Bethesda/BSHavok.h +++ b/CommonLibF4/include/RE/Bethesda/BSHavok.h @@ -21,7 +21,7 @@ namespace RE static bool RemoveObjects(NiAVObject* a_object, bool a_recurse, bool a_force) { using func_t = decltype(&RemoveObjects); - REL::Relocation func{ REL::ID(2277721) }; + static REL::Relocation func{ REL::ID(2277721) }; return func(a_object, a_recurse, a_force); } diff --git a/CommonLibF4/include/RE/Bethesda/BSInputDeviceManager.h b/CommonLibF4/include/RE/Bethesda/BSInputDeviceManager.h index b192dca2..da9298b3 100644 --- a/CommonLibF4/include/RE/Bethesda/BSInputDeviceManager.h +++ b/CommonLibF4/include/RE/Bethesda/BSInputDeviceManager.h @@ -55,7 +55,7 @@ namespace RE [[nodiscard]] static BSInputDeviceManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(1284221) }; + static REL::Relocation singleton{ REL::ID(1284221) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/BSInputEnableManager.h b/CommonLibF4/include/RE/Bethesda/BSInputEnableManager.h index 6fa3ef6a..18d8f33e 100644 --- a/CommonLibF4/include/RE/Bethesda/BSInputEnableManager.h +++ b/CommonLibF4/include/RE/Bethesda/BSInputEnableManager.h @@ -43,7 +43,7 @@ namespace RE [[nodiscard]] std::uint32_t DecRef() const { using func_t = decltype(&BSInputEnableLayer::DecRef); - REL::Relocation func{ REL::ID(659989) }; + static REL::Relocation func{ REL::ID(659989) }; return func(this); } @@ -77,14 +77,14 @@ namespace RE [[nodiscard]] static BSInputEnableManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(781703) }; + static REL::Relocation singleton{ REL::ID(781703) }; return *singleton; } bool AllocateNewLayer(BSTSmartPointer& a_layer, const char* a_debugName) { using func_t = decltype(&BSInputEnableManager::AllocateNewLayer); - REL::Relocation func{ REL::ID(537494) }; + static REL::Relocation func{ REL::ID(537494) }; return func(this, a_layer, a_debugName); } @@ -98,14 +98,14 @@ namespace RE bool EnableUserEvent(std::uint32_t a_layerID, UEFlag a_userEventFlags, bool a_enable, UserEvents::SENDER_ID a_senderID) { using func_t = decltype(&BSInputEnableManager::EnableUserEvent); - REL::Relocation func{ REL::ID(1432984) }; + static REL::Relocation func{ REL::ID(1432984) }; return func(this, a_layerID, a_userEventFlags, a_enable, a_senderID); } bool EnableOtherEvent(std::uint32_t a_layerID, OEFlag a_otherEventFlags, bool a_enable, UserEvents::SENDER_ID a_senderID) { using func_t = decltype(&BSInputEnableManager::EnableOtherEvent); - REL::Relocation func{ REL::ID(1419268) }; + static REL::Relocation func{ REL::ID(1419268) }; return func(this, a_layerID, a_otherEventFlags, a_enable, a_senderID); } diff --git a/CommonLibF4/include/RE/Bethesda/BSLock.h b/CommonLibF4/include/RE/Bethesda/BSLock.h index 5348322a..12e11513 100644 --- a/CommonLibF4/include/RE/Bethesda/BSLock.h +++ b/CommonLibF4/include/RE/Bethesda/BSLock.h @@ -26,14 +26,14 @@ namespace RE void lock(const char* a_id = nullptr) { using func_t = decltype(&BSSpinLock::lock); - REL::Relocation func{ REL::ID(2192245) }; + static REL::Relocation func{ REL::ID(2192245) }; return func(this, a_id); } [[nodiscard]] bool try_lock() { using func_t = decltype(&BSSpinLock::try_lock); - REL::Relocation func{ REL::ID(2267902) }; + static REL::Relocation func{ REL::ID(2267902) }; return func(this); } @@ -62,28 +62,28 @@ namespace RE void lock_read() { using func_t = decltype(&BSReadWriteLock::lock_read); - REL::Relocation func{ REL::ID(2267897) }; + static REL::Relocation func{ REL::ID(2267897) }; return func(this); } void lock_write() { using func_t = decltype(&BSReadWriteLock::lock_write); - REL::Relocation func{ REL::ID(2267898) }; + static REL::Relocation func{ REL::ID(2267898) }; return func(this); } [[nodiscard]] bool try_lock_read() { using func_t = decltype(&BSReadWriteLock::try_lock_read); - REL::Relocation func{ REL::ID(2267901) }; + static REL::Relocation func{ REL::ID(2267901) }; return func(this); } [[nodiscard]] bool try_lock_write() { using func_t = decltype(&BSReadWriteLock::try_lock_write); - REL::Relocation func{ REL::ID(2267902) }; + static REL::Relocation func{ REL::ID(2267902) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/BSModelDB.h b/CommonLibF4/include/RE/Bethesda/BSModelDB.h index 564d2119..6837416b 100644 --- a/CommonLibF4/include/RE/Bethesda/BSModelDB.h +++ b/CommonLibF4/include/RE/Bethesda/BSModelDB.h @@ -46,7 +46,7 @@ namespace RE static BSResource::EntryDB* GetSingleton() { - REL::Relocation**> singleton{ REL::ID(45807) }; + static REL::Relocation**> singleton{ REL::ID(45807) }; return *singleton; } }; @@ -58,7 +58,7 @@ namespace RE const DBTraits::ArgsType& a_args) { using func_t = BSResource::ErrorCode (*)(const char*, BSResource::RHandleType, BSResource::EntryDBTraits>::CArgs>, BSResource::EntryDB>&, const DBTraits::ArgsType&); - REL::Relocation func{ REL::ID(1066398) }; + static REL::Relocation func{ REL::ID(1066398) }; return func(a_name, a_result, a_args); } @@ -68,7 +68,7 @@ namespace RE const DBTraits::ArgsType& a_args) { using func_t = BSResource::ErrorCode (*)(const char*, NiPointer*, const DBTraits::ArgsType&); - REL::Relocation func{ REL::ID(1225688) }; + static REL::Relocation func{ REL::ID(1225688) }; return func(a_name, a_result, a_args); } }; diff --git a/CommonLibF4/include/RE/Bethesda/BSPointerHandle.h b/CommonLibF4/include/RE/Bethesda/BSPointerHandle.h index a4d036fc..4442a143 100644 --- a/CommonLibF4/include/RE/Bethesda/BSPointerHandle.h +++ b/CommonLibF4/include/RE/Bethesda/BSPointerHandle.h @@ -161,21 +161,21 @@ namespace RE static BSPointerHandle CreateHandle(T* a_ptr) { using func_t = decltype(&BSPointerHandleManagerInterface::CreateHandle); - REL::Relocation func{ REL::ID(2188375) }; + static REL::Relocation func{ REL::ID(2188375) }; return func(a_ptr); } static BSPointerHandle GetHandle(T* a_ptr) { using func_t = decltype(&BSPointerHandleManagerInterface::GetHandle); - REL::Relocation func{ REL::ID(2188676) }; + static REL::Relocation func{ REL::ID(2188676) }; return func(a_ptr); } static bool GetSmartPointer(const BSPointerHandle& a_handle, NiPointer& a_smartPointerOut) { using func_t = decltype(&BSPointerHandleManagerInterface::GetSmartPointer); - REL::Relocation func{ REL::ID(2188681) }; + static REL::Relocation func{ REL::ID(2188681) }; return func(a_handle, a_smartPointerOut); } }; diff --git a/CommonLibF4/include/RE/Bethesda/BSResource.h b/CommonLibF4/include/RE/Bethesda/BSResource.h index 37424c1d..4d932ea1 100644 --- a/CommonLibF4/include/RE/Bethesda/BSResource.h +++ b/CommonLibF4/include/RE/Bethesda/BSResource.h @@ -17,7 +17,7 @@ namespace RE::BSResource inline void RegisterLocation(Location* a_location, std::uint32_t a_priority) { using func_t = decltype(&RegisterLocation); - REL::Relocation func{ REL::ID(918408) }; + static REL::Relocation func{ REL::ID(918408) }; return func(a_location, a_priority); } } diff --git a/CommonLibF4/include/RE/Bethesda/BSResource/Entry.h b/CommonLibF4/include/RE/Bethesda/BSResource/Entry.h index d1e45271..d0766c2b 100644 --- a/CommonLibF4/include/RE/Bethesda/BSResource/Entry.h +++ b/CommonLibF4/include/RE/Bethesda/BSResource/Entry.h @@ -38,7 +38,7 @@ namespace RE static bool ReleaseEntryAction(EntryBase* a_entry) { using func_t = decltype(&EntryDBBaseUtil::ReleaseEntryAction); - REL::Relocation func{ REL::ID(777279) }; + static REL::Relocation func{ REL::ID(777279) }; return func(a_entry); } diff --git a/CommonLibF4/include/RE/Bethesda/BSResource/GlobalLocations.h b/CommonLibF4/include/RE/Bethesda/BSResource/GlobalLocations.h index 2f1b196d..f2540ef5 100644 --- a/CommonLibF4/include/RE/Bethesda/BSResource/GlobalLocations.h +++ b/CommonLibF4/include/RE/Bethesda/BSResource/GlobalLocations.h @@ -26,7 +26,7 @@ namespace RE::BSResource [[nodiscard]] static GlobalLocations* GetSingleton() { - REL::Relocation singleton{ REL::ID(1573818) }; + static REL::Relocation singleton{ REL::ID(1573818) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/BSResource/GlobalPaths.h b/CommonLibF4/include/RE/Bethesda/BSResource/GlobalPaths.h index 2fb39a0a..d671b86b 100644 --- a/CommonLibF4/include/RE/Bethesda/BSResource/GlobalPaths.h +++ b/CommonLibF4/include/RE/Bethesda/BSResource/GlobalPaths.h @@ -17,7 +17,7 @@ namespace RE::BSResource [[nodiscard]] static GlobalPaths* GetSingleton() { - REL::Relocation singleton{ REL::ID(210868) }; + static REL::Relocation singleton{ REL::ID(210868) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/BSScaleformManager.h b/CommonLibF4/include/RE/Bethesda/BSScaleformManager.h index 3f8801f7..a6006890 100644 --- a/CommonLibF4/include/RE/Bethesda/BSScaleformManager.h +++ b/CommonLibF4/include/RE/Bethesda/BSScaleformManager.h @@ -43,7 +43,7 @@ namespace RE void Initialize() { using func_t = decltype(&BSScaleformRenderer::Initialize); - REL::Relocation func{ REL::ID(1403529) }; + static REL::Relocation func{ REL::ID(1403529) }; return func(this); } @@ -85,7 +85,7 @@ namespace RE [[nodiscard]] static BSScaleformManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(106578) }; + static REL::Relocation singleton{ REL::ID(106578) }; return *singleton; } @@ -98,7 +98,7 @@ namespace RE float a_backgroundAlpha = 0.0F) { using func_t = decltype(&BSScaleformManager::LoadMovie); - REL::Relocation func{ REL::ID(1526234) }; + static REL::Relocation func{ REL::ID(1526234) }; return func(this, a_menu, a_movie, a_menuName, a_menuObjPath, a_scaleMode, a_backgroundAlpha); } @@ -120,14 +120,14 @@ namespace RE [[nodiscard]] bool GetMovieFilename(char const* a_menuName, BSStaticStringT<260>& a_filePath) { using func_t = decltype(&BSScaleformManager::GetMovieFilename); - REL::Relocation func{ REL::ID(1191277) }; + static REL::Relocation func{ REL::ID(1191277) }; return func(this, a_menuName, a_filePath); } void InitMovieViewport(Scaleform::GFx::Movie& a_movie, const float a_dynamicWidthRatio, const float a_dynamicHeightRatio) { using func_t = decltype(&BSScaleformManager::InitMovieViewport); - REL::Relocation func{ REL::ID(206895) }; + static REL::Relocation func{ REL::ID(206895) }; return func(this, a_movie, a_dynamicWidthRatio, a_dynamicHeightRatio); } }; diff --git a/CommonLibF4/include/RE/Bethesda/BSScript/ArrayWrapper.h b/CommonLibF4/include/RE/Bethesda/BSScript/ArrayWrapper.h index 4f06586b..33d72a05 100644 --- a/CommonLibF4/include/RE/Bethesda/BSScript/ArrayWrapper.h +++ b/CommonLibF4/include/RE/Bethesda/BSScript/ArrayWrapper.h @@ -49,7 +49,7 @@ namespace RE void ReplaceArray(BSScrapArray& a_copy, IVirtualMachine& a_vm) { using func_t = decltype(&ArrayWrapper::ReplaceArray); - REL::Relocation func{ REL::ID(445184) }; + static REL::Relocation func{ REL::ID(445184) }; return func(this, a_copy, a_vm); } diff --git a/CommonLibF4/include/RE/Bethesda/BSScript/NF_util/NativeFunctionBase.h b/CommonLibF4/include/RE/Bethesda/BSScript/NF_util/NativeFunctionBase.h index 4d6ea00b..a81ca55d 100644 --- a/CommonLibF4/include/RE/Bethesda/BSScript/NF_util/NativeFunctionBase.h +++ b/CommonLibF4/include/RE/Bethesda/BSScript/NF_util/NativeFunctionBase.h @@ -87,7 +87,7 @@ namespace RE CallResult Call(const BSTSmartPointer& a_stack, ErrorLogger& a_errorLogger, Internal::VirtualMachine& a_vm, bool a_inScriptTasklet) const override // 0F { using func_t = decltype(&NativeFunctionBase::Call); - REL::Relocation func{ REL::ID(2314780) }; + static REL::Relocation func{ REL::ID(2314780) }; return func(this, a_stack, a_errorLogger, a_vm, a_inScriptTasklet); } diff --git a/CommonLibF4/include/RE/Bethesda/BSScript/Object.h b/CommonLibF4/include/RE/Bethesda/BSScript/Object.h index 586f246d..307cd6bc 100644 --- a/CommonLibF4/include/RE/Bethesda/BSScript/Object.h +++ b/CommonLibF4/include/RE/Bethesda/BSScript/Object.h @@ -36,21 +36,21 @@ namespace RE [[nodiscard]] std::uint32_t DecRef() const { using func_t = decltype(&Object::DecRef); - REL::Relocation func{ REL::ID(541793) }; + static REL::Relocation func{ REL::ID(541793) }; return func(this); } [[nodiscard]] std::size_t GetHandle() const { using func_t = decltype(&Object::GetHandle); - REL::Relocation func{ REL::ID(2314431) }; + static REL::Relocation func{ REL::ID(2314431) }; return func(this); } void IncRef() const { using func_t = decltype(&Object::IncRef); - REL::Relocation func{ REL::ID(2314436) }; + static REL::Relocation func{ REL::ID(2314436) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/BSScript/ObjectBindPolicy.h b/CommonLibF4/include/RE/Bethesda/BSScript/ObjectBindPolicy.h index fb9c68a6..db239adf 100644 --- a/CommonLibF4/include/RE/Bethesda/BSScript/ObjectBindPolicy.h +++ b/CommonLibF4/include/RE/Bethesda/BSScript/ObjectBindPolicy.h @@ -59,14 +59,14 @@ namespace RE void BindObject(const BSTSmartPointer& a_obj, std::size_t a_objHandle) { using func_t = decltype(&ObjectBindPolicy::BindObject); - REL::Relocation func{ REL::ID(709728) }; + static REL::Relocation func{ REL::ID(709728) }; return func(this, a_obj, a_objHandle); } void UnbindObject(const BSTSmartPointer& a_obj) { using func_t = decltype(&ObjectBindPolicy::UnbindObject); - REL::Relocation func{ REL::ID(522763) }; + static REL::Relocation func{ REL::ID(522763) }; return func(this, a_obj); } diff --git a/CommonLibF4/include/RE/Bethesda/BSScript/Stack.h b/CommonLibF4/include/RE/Bethesda/BSScript/Stack.h index 50811144..2c93583b 100644 --- a/CommonLibF4/include/RE/Bethesda/BSScript/Stack.h +++ b/CommonLibF4/include/RE/Bethesda/BSScript/Stack.h @@ -78,14 +78,14 @@ namespace RE [[nodiscard]] std::uint32_t GetPageForFrame(const StackFrame* a_frame) const { using func_t = decltype(&Stack::GetPageForFrame); - REL::Relocation func{ REL::ID(1429302) }; + static REL::Relocation func{ REL::ID(1429302) }; return func(this, a_frame); } [[nodiscard]] Variable& GetStackFrameVariable(const StackFrame* a_frame, std::uint32_t a_index, std::uint32_t a_pageHint) { using func_t = decltype(&Stack::GetStackFrameVariable); - REL::Relocation func{ REL::ID(897539) }; + static REL::Relocation func{ REL::ID(897539) }; return func(this, a_frame, a_index, a_pageHint); } diff --git a/CommonLibF4/include/RE/Bethesda/BSScriptUtil.h b/CommonLibF4/include/RE/Bethesda/BSScriptUtil.h index 0bc56d71..3da0d4c8 100644 --- a/CommonLibF4/include/RE/Bethesda/BSScriptUtil.h +++ b/CommonLibF4/include/RE/Bethesda/BSScriptUtil.h @@ -424,7 +424,7 @@ namespace RE::BSScript { const auto game = GameVM::GetSingleton(); const auto vm = game ? game->GetVM() : nullptr; - REL::Relocation baseObjectName{ REL::ID(648543) }; + static REL::Relocation baseObjectName{ REL::ID(648543) }; BSTSmartPointer typeInfo; if (!vm || !vm->GetScriptObjectType(*baseObjectName, typeInfo) || diff --git a/CommonLibF4/include/RE/Bethesda/BSShaderProperty.h b/CommonLibF4/include/RE/Bethesda/BSShaderProperty.h index 5a62d2c5..53c69bf9 100644 --- a/CommonLibF4/include/RE/Bethesda/BSShaderProperty.h +++ b/CommonLibF4/include/RE/Bethesda/BSShaderProperty.h @@ -145,7 +145,7 @@ namespace RE void SetMaterial(BSShaderMaterial* a_material, bool a_unique) { using func_t = decltype(&BSShaderProperty::SetMaterial); - REL::Relocation func{ REL::ID(706318) }; + static REL::Relocation func{ REL::ID(706318) }; return func(this, a_material, a_unique); } diff --git a/CommonLibF4/include/RE/Bethesda/BSSoundHandle.h b/CommonLibF4/include/RE/Bethesda/BSSoundHandle.h index c300c2fb..89bfcce7 100644 --- a/CommonLibF4/include/RE/Bethesda/BSSoundHandle.h +++ b/CommonLibF4/include/RE/Bethesda/BSSoundHandle.h @@ -10,14 +10,14 @@ namespace RE bool FadeInPlay(std::uint16_t a_milliseconds) { using func_t = decltype(&BSSoundHandle::FadeInPlay); - REL::Relocation func{ REL::ID(353528) }; + static REL::Relocation func{ REL::ID(353528) }; return func(this, a_milliseconds); } bool FadeOutAndRelease(std::uint16_t a_milliseconds) { using func_t = decltype(&BSSoundHandle::FadeOutAndRelease); - REL::Relocation func{ REL::ID(260328) }; + static REL::Relocation func{ REL::ID(260328) }; return func(this, a_milliseconds); } diff --git a/CommonLibF4/include/RE/Bethesda/BSStringPool.h b/CommonLibF4/include/RE/Bethesda/BSStringPool.h index 3b29554e..ad48ea19 100644 --- a/CommonLibF4/include/RE/Bethesda/BSStringPool.h +++ b/CommonLibF4/include/RE/Bethesda/BSStringPool.h @@ -18,7 +18,7 @@ namespace RE static void release(Entry*& a_entry) { using func_t = decltype(&Entry::release); - REL::Relocation func{ REL::ID(2268720) }; + static REL::Relocation func{ REL::ID(2268720) }; return func(a_entry); } @@ -121,7 +121,7 @@ namespace RE static BucketTable& GetSingleton() { using func_t = decltype(&BucketTable::GetSingleton); - REL::Relocation func{ REL::ID(2268736) }; + static REL::Relocation func{ REL::ID(2268736) }; return func(); } @@ -139,7 +139,7 @@ namespace RE inline void GetEntry(BSStringPool::Entry*& a_result, const char* a_string, bool a_caseSensitive) { using func_t = decltype(&GetEntry); - REL::Relocation func{ REL::ID(2268729) }; + static REL::Relocation func{ REL::ID(2268729) }; return func(a_result, a_string, a_caseSensitive); } @@ -147,7 +147,7 @@ namespace RE inline void GetEntry(BSStringPool::Entry*& a_result, const wchar_t* a_string, bool a_caseSensitive) { using func_t = decltype(&GetEntry); - REL::Relocation func{ REL::ID(2268730) }; + static REL::Relocation func{ REL::ID(2268730) }; return func(a_result, a_string, a_caseSensitive); } } diff --git a/CommonLibF4/include/RE/Bethesda/BSStringT.h b/CommonLibF4/include/RE/Bethesda/BSStringT.h index f32c7670..93cfbdf4 100644 --- a/CommonLibF4/include/RE/Bethesda/BSStringT.h +++ b/CommonLibF4/include/RE/Bethesda/BSStringT.h @@ -97,7 +97,7 @@ namespace RE bool Set(const char* apString, std::uint64_t auiMaxLen) { using func_t = decltype(&BSStringT::Set); - REL::Relocation func{ REL::ID(2189084) }; + static REL::Relocation func{ REL::ID(2189084) }; return func(this, apString, auiMaxLen); } diff --git a/CommonLibF4/include/RE/Bethesda/BSSystemFileStreamer.h b/CommonLibF4/include/RE/Bethesda/BSSystemFileStreamer.h index 22fdd637..3acc8743 100644 --- a/CommonLibF4/include/RE/Bethesda/BSSystemFileStreamer.h +++ b/CommonLibF4/include/RE/Bethesda/BSSystemFileStreamer.h @@ -5,7 +5,7 @@ namespace RE::BSSystemFileStreamer inline void UncacheAll(bool a_block) { using func_t = decltype(&UncacheAll); - REL::Relocation func{ REL::ID(40925) }; + static REL::Relocation func{ REL::ID(40925) }; return func(a_block); } } diff --git a/CommonLibF4/include/RE/Bethesda/BSSystemUtility.h b/CommonLibF4/include/RE/Bethesda/BSSystemUtility.h index 6563f8d7..8d066440 100644 --- a/CommonLibF4/include/RE/Bethesda/BSSystemUtility.h +++ b/CommonLibF4/include/RE/Bethesda/BSSystemUtility.h @@ -13,7 +13,7 @@ namespace RE [[nodiscard]] static BSAwardsSystemUtility& GetSingleton() { using func_t = decltype(&BSAwardsSystemUtility::GetSingleton); - REL::Relocation func{ REL::ID(1569384) }; + static REL::Relocation func{ REL::ID(1569384) }; return func(); } diff --git a/CommonLibF4/include/RE/Bethesda/BSTEvent.h b/CommonLibF4/include/RE/Bethesda/BSTEvent.h index a2794b6b..06197fd2 100644 --- a/CommonLibF4/include/RE/Bethesda/BSTEvent.h +++ b/CommonLibF4/include/RE/Bethesda/BSTEvent.h @@ -231,7 +231,7 @@ namespace RE [[nodiscard]] static BSTGlobalEvent* GetSingleton() { - REL::Relocation singleton{ REL::ID(2688814) }; + static REL::Relocation singleton{ REL::ID(2688814) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/BSTempEffect.h b/CommonLibF4/include/RE/Bethesda/BSTempEffect.h index 73c9de4c..4800e65e 100644 --- a/CommonLibF4/include/RE/Bethesda/BSTempEffect.h +++ b/CommonLibF4/include/RE/Bethesda/BSTempEffect.h @@ -309,7 +309,7 @@ namespace RE bool isFirstPerson) { using func_t = BSTempEffectDebris* (*)(BSTempEffectDebris*, TESObjectCELL*, float, const char*, TESObjectREFR*, const NiPoint3&, const NiMatrix3&, const NiPoint3&, const NiPoint3&, float, bool, bool, bool); - REL::Relocation func{ REL::ID(2212059) }; + static REL::Relocation func{ REL::ID(2212059) }; func(this, a_parentCell, a_lifetime, a_fileName, a_sourceRef, a_position, a_rotation, a_startLinearVelocity, a_startAngularVelocity, a_scale, a_useCache, a_addDebrisCount, isFirstPerson); } diff --git a/CommonLibF4/include/RE/Bethesda/BSTextureDB.h b/CommonLibF4/include/RE/Bethesda/BSTextureDB.h index 5fed3627..38308885 100644 --- a/CommonLibF4/include/RE/Bethesda/BSTextureDB.h +++ b/CommonLibF4/include/RE/Bethesda/BSTextureDB.h @@ -29,7 +29,7 @@ namespace RE static BSResource::EntryDB* GetSingleton() { - REL::Relocation**> singleton{ REL::ID(1126862) }; + static REL::Relocation**> singleton{ REL::ID(1126862) }; return *singleton; } }; diff --git a/CommonLibF4/include/RE/Bethesda/BSTextureSet.h b/CommonLibF4/include/RE/Bethesda/BSTextureSet.h index 67640448..d8d0828a 100644 --- a/CommonLibF4/include/RE/Bethesda/BSTextureSet.h +++ b/CommonLibF4/include/RE/Bethesda/BSTextureSet.h @@ -37,7 +37,7 @@ namespace RE static BSShaderTextureSet* CreateObject() { using func_t = decltype(&BSShaderTextureSet::CreateObject); - REL::Relocation func{ REL::ID(2316324) }; + static REL::Relocation func{ REL::ID(2316324) }; return func(); } diff --git a/CommonLibF4/include/RE/Bethesda/Calendar.h b/CommonLibF4/include/RE/Bethesda/Calendar.h index e2799f0b..6729947d 100644 --- a/CommonLibF4/include/RE/Bethesda/Calendar.h +++ b/CommonLibF4/include/RE/Bethesda/Calendar.h @@ -33,7 +33,7 @@ namespace RE [[nodiscard]] static Calendar* GetSingleton() { - REL::Relocation singleton{ REL::ID(2689092) }; + static REL::Relocation singleton{ REL::ID(2689092) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/CombatFormulas.h b/CommonLibF4/include/RE/Bethesda/CombatFormulas.h index c9c642bd..69a87fa5 100644 --- a/CommonLibF4/include/RE/Bethesda/CombatFormulas.h +++ b/CommonLibF4/include/RE/Bethesda/CombatFormulas.h @@ -11,28 +11,28 @@ namespace RE [[nodiscard]] inline float GetWeaponDisplayAccuracy(const BGSObjectInstanceT& a_weapon, Actor* a_actor) { using func_t = decltype(&CombatFormulas::GetWeaponDisplayAccuracy); - REL::Relocation func{ REL::ID(1137654) }; + static REL::Relocation func{ REL::ID(1137654) }; return func(a_weapon, a_actor); } [[nodiscard]] inline float GetWeaponDisplayDamage(const BGSObjectInstanceT& a_weapon, const TESAmmo* a_ammo, float a_condition) { using func_t = decltype(&CombatFormulas::GetWeaponDisplayDamage); - REL::Relocation func{ REL::ID(1431014) }; + static REL::Relocation func{ REL::ID(1431014) }; return func(a_weapon, a_ammo, a_condition); } [[nodiscard]] inline float GetWeaponDisplayRange(const BGSObjectInstanceT& a_weapon) { using func_t = decltype(&CombatFormulas::GetWeaponDisplayRange); - REL::Relocation func{ REL::ID(1324037) }; + static REL::Relocation func{ REL::ID(1324037) }; return func(a_weapon); } [[nodiscard]] inline float GetWeaponDisplayRateOfFire(const TESObjectWEAP& a_weapon, const TESObjectWEAP::InstanceData* a_data) { using func_t = decltype(&CombatFormulas::GetWeaponDisplayRateOfFire); - REL::Relocation func{ REL::ID(1403591) }; + static REL::Relocation func{ REL::ID(1403591) }; return func(a_weapon, a_data); } } diff --git a/CommonLibF4/include/RE/Bethesda/Console.h b/CommonLibF4/include/RE/Bethesda/Console.h index d83c8f75..69f70573 100644 --- a/CommonLibF4/include/RE/Bethesda/Console.h +++ b/CommonLibF4/include/RE/Bethesda/Console.h @@ -11,21 +11,21 @@ namespace RE public: [[nodiscard]] static ConsoleLog* GetSingleton() { - REL::Relocation singleton{ REL::ID(2690148) }; + static REL::Relocation singleton{ REL::ID(2690148) }; return *singleton; } void AddString(char const* a_string) { using func_t = decltype(&ConsoleLog::AddString); - REL::Relocation func{ REL::ID(2248593) }; + static REL::Relocation func{ REL::ID(2248593) }; return func(this, a_string); } void Print(const char* a_fmt, std::va_list a_args) { using func_t = decltype(&ConsoleLog::Print); - REL::Relocation func{ REL::ID(2248591) }; + static REL::Relocation func{ REL::ID(2248591) }; func(this, a_fmt, a_args); } diff --git a/CommonLibF4/include/RE/Bethesda/ControlMap.h b/CommonLibF4/include/RE/Bethesda/ControlMap.h index 276abb3a..feecfc87 100644 --- a/CommonLibF4/include/RE/Bethesda/ControlMap.h +++ b/CommonLibF4/include/RE/Bethesda/ControlMap.h @@ -62,7 +62,7 @@ namespace RE [[nodiscard]] static ControlMap* GetSingleton() { - REL::Relocation singleton{ REL::ID(325206) }; + static REL::Relocation singleton{ REL::ID(325206) }; return *singleton; } @@ -87,35 +87,35 @@ namespace RE bool PopInputContext(UserEvents::INPUT_CONTEXT_ID a_context) { using func_t = decltype(&ControlMap::PopInputContext); - REL::Relocation func{ REL::ID(74587) }; + static REL::Relocation func{ REL::ID(74587) }; return func(this, a_context); } void PushInputContext(UserEvents::INPUT_CONTEXT_ID a_context) { using func_t = decltype(&ControlMap::PushInputContext); - REL::Relocation func{ REL::ID(1404410) }; + static REL::Relocation func{ REL::ID(1404410) }; return func(this, a_context); } bool RemapButton(BSFixedString const& a_id, INPUT_DEVICE a_device, std::int32_t a_buttonID) { using func_t = decltype(&ControlMap::RemapButton); - REL::Relocation func{ REL::ID(11351) }; + static REL::Relocation func{ REL::ID(11351) }; return func(this, a_id, a_device, a_buttonID); } void SaveRemappings() { using func_t = decltype(&ControlMap::SaveRemappings); - REL::Relocation func{ REL::ID(1141541) }; + static REL::Relocation func{ REL::ID(1141541) }; return func(this); } void SetTextEntryMode(bool a_enable) { using func_t = decltype(&ControlMap::SetTextEntryMode); - REL::Relocation func{ REL::ID(1270079) }; + static REL::Relocation func{ REL::ID(1270079) }; return func(this, a_enable); } diff --git a/CommonLibF4/include/RE/Bethesda/Events.h b/CommonLibF4/include/RE/Bethesda/Events.h index d196cecb..34574635 100644 --- a/CommonLibF4/include/RE/Bethesda/Events.h +++ b/CommonLibF4/include/RE/Bethesda/Events.h @@ -96,7 +96,7 @@ namespace RE static void InitSDM() { using func_t = decltype(&BSThreadEvent::InitSDM); - REL::Relocation func{ REL::ID(1425097) }; + static REL::Relocation func{ REL::ID(1425097) }; return func(); } }; @@ -125,7 +125,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(421543) }; + static REL::Relocation singleton{ REL::ID(421543) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -148,7 +148,7 @@ namespace RE [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(344866) }; + static REL::Relocation singleton{ REL::ID(344866) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -182,7 +182,7 @@ namespace RE [[nodiscard]] static CellAttachDetachEventSourceSingleton& GetSingleton() { using func_t = decltype(&CellAttachDetachEventSourceSingleton::GetSingleton); - REL::Relocation func{ REL::ID(862142) }; + static REL::Relocation func{ REL::ID(862142) }; return func(); } @@ -201,7 +201,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(2696196) }; + static REL::Relocation singleton{ REL::ID(2696196) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -218,7 +218,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(1226590) }; + static REL::Relocation singleton{ REL::ID(1226590) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -249,7 +249,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(787908) }; + static REL::Relocation singleton{ REL::ID(787908) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -266,7 +266,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(683142) }; + static REL::Relocation singleton{ REL::ID(683142) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -316,7 +316,7 @@ namespace RE const InventoryUserUIInterfaceEntry& a_entry) { using func_t = decltype(&InventoryItemDisplayData::ctor); - REL::Relocation func{ REL::ID(679373) }; + static REL::Relocation func{ REL::ID(679373) }; return func(this, a_inventoryRef, a_entry); } }; @@ -334,7 +334,7 @@ namespace RE [[nodiscard]] static BSTEventSource* GetEventSource() { using func_t = decltype(&LocksPicked::GetEventSource); - REL::Relocation func{ REL::ID(594991) }; + static REL::Relocation func{ REL::ID(594991) }; return func(); } }; @@ -379,7 +379,7 @@ namespace RE [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(685859) }; + static REL::Relocation singleton{ REL::ID(685859) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -400,7 +400,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(2696280) }; + static REL::Relocation singleton{ REL::ID(2696280) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -440,7 +440,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(120809) }; + static REL::Relocation singleton{ REL::ID(120809) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -806,7 +806,7 @@ namespace RE public: [[nodiscard]] static EventSource_t* GetEventSource() { - REL::Relocation singleton{ REL::ID(1067039) }; + static REL::Relocation singleton{ REL::ID(1067039) }; if (!*singleton) { *singleton = new EventSource_t(&BSTGlobalEvent::GetSingleton()->eventSourceSDMKiller); } @@ -855,7 +855,7 @@ namespace RE public: [[nodiscard]] static TESInitScriptEventSource* GetSingleton() { - REL::Relocation singleton{ REL::ID(2691330) }; + static REL::Relocation singleton{ REL::ID(2691330) }; return singleton.get(); } }; diff --git a/CommonLibF4/include/RE/Bethesda/FavoritesManager.h b/CommonLibF4/include/RE/Bethesda/FavoritesManager.h index 8fb3e660..834b5c45 100644 --- a/CommonLibF4/include/RE/Bethesda/FavoritesManager.h +++ b/CommonLibF4/include/RE/Bethesda/FavoritesManager.h @@ -42,14 +42,14 @@ namespace RE [[nodiscard]] static FavoritesManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(198281) }; + static REL::Relocation singleton{ REL::ID(198281) }; return *singleton; } [[nodiscard]] bool IsComponentFavorite(const TESBoundObject* a_component) { using func_t = decltype(&FavoritesManager::IsComponentFavorite); - REL::Relocation func{ REL::ID(352046) }; + static REL::Relocation func{ REL::ID(352046) }; return func(this, a_component); } diff --git a/CommonLibF4/include/RE/Bethesda/FormComponents.h b/CommonLibF4/include/RE/Bethesda/FormComponents.h index 590deeee..c771ed24 100644 --- a/CommonLibF4/include/RE/Bethesda/FormComponents.h +++ b/CommonLibF4/include/RE/Bethesda/FormComponents.h @@ -646,7 +646,7 @@ namespace RE void SetParentGroupNumber(BGSKeyword* a_parent, std::uint32_t a_groupID) { using func_t = decltype(&BGSAttachParentArray::SetParentGroupNumber); - REL::Relocation func{ REL::ID(1412266) }; + static REL::Relocation func{ REL::ID(1412266) }; return func(this, a_parent, a_groupID); } }; @@ -906,7 +906,7 @@ namespace RE void AddKeyword(BGSKeyword* a_keyword) { using func_t = decltype(&BGSKeywordForm::AddKeyword); - REL::Relocation func{ REL::ID(2192766) }; + static REL::Relocation func{ REL::ID(2192766) }; return func(this, a_keyword); } @@ -953,7 +953,7 @@ namespace RE void RemoveKeyword(BGSKeyword* a_keyword) { using func_t = decltype(&BGSKeywordForm::RemoveKeyword); - REL::Relocation func{ REL::ID(921694) }; + static REL::Relocation func{ REL::ID(921694) }; return func(this, a_keyword); } @@ -1062,14 +1062,14 @@ namespace RE void AllocatePerkRankArray(std::uint32_t a_count) { using func_t = decltype(&BGSPerkRankArray::AllocatePerkRankArray); - REL::Relocation func{ REL::ID(888419) }; + static REL::Relocation func{ REL::ID(888419) }; return func(this, a_count); } void ClearPerks(bool a_removeFormUser) { using func_t = decltype(&BGSPerkRankArray::ClearPerks); - REL::Relocation func{ REL::ID(1247917) }; + static REL::Relocation func{ REL::ID(1247917) }; return func(this, a_removeFormUser); } @@ -1313,14 +1313,14 @@ namespace RE void GetDescription(BSStringT& a_out, const TESForm* a_form) const { using func_t = decltype(&BGSLocalizedStringDL::GetDescription); - REL::Relocation func{ REL::ID(523613) }; + static REL::Relocation func{ REL::ID(523613) }; return func(this, a_out, a_form); } [[nodiscard]] BGSLocalizedStrings::ScrapStringBuffer GetText(TESFile& a_file) const { using func_t = decltype(&BGSLocalizedStringDL::GetText); - REL::Relocation func{ REL::ID(472297) }; + static REL::Relocation func{ REL::ID(472297) }; return func(this, a_file); } @@ -1349,7 +1349,7 @@ namespace RE void GetDescription(BSStringT& a_outString, const TESForm* a_form = nullptr) { using func_t = decltype(&TESDescription::GetDescription); - REL::Relocation func{ REL::ID(523613) }; + static REL::Relocation func{ REL::ID(523613) }; return func(this, a_outString, a_form); } @@ -1397,7 +1397,7 @@ namespace RE [[nodiscard]] static auto GetSparseFullNameMap() -> BSTHashMap& { - REL::Relocation*> sparseFullNameMap{ REL::ID(2661402), -0x8 }; + static REL::Relocation*> sparseFullNameMap{ REL::ID(2661402), -0x8 }; return *sparseFullNameMap; } @@ -1423,7 +1423,7 @@ namespace RE [[nodiscard]] static std::uint32_t GetFormHealth(const TESForm* a_form, const TBO_InstanceData* a_data) { using func_t = decltype(&TESHealthForm::GetFormHealth); - REL::Relocation func{ REL::ID(1515099) }; + static REL::Relocation func{ REL::ID(1515099) }; return func(a_form, a_data); } @@ -1601,7 +1601,7 @@ namespace RE std::uint16_t GetLevel() const { using func_t = decltype(&TESActorBaseData::GetLevel); - REL::Relocation func{ REL::ID(2192891) }; + static REL::Relocation func{ REL::ID(2192891) }; return func(this); } @@ -1743,7 +1743,7 @@ namespace RE LEVELED_OBJECT* AddLeveledObject(std::uint16_t a_level, uint16_t a_count, int8_t a_chanceNone, TESForm* a_item, ContainerItemExtra* a_itemExtra) { using func_t = decltype(&TESLeveledList::AddLeveledObject); - REL::Relocation func{ REL::ID(1163308) }; + static REL::Relocation func{ REL::ID(1163308) }; return func(this, a_level, a_count, a_chanceNone, a_item, a_itemExtra); } @@ -1757,21 +1757,21 @@ namespace RE const char* a_overrideName = nullptr) { using func_t = decltype(&TESLeveledList::CalculateCurrentFormList); - REL::Relocation func{ REL::ID(2193259) }; + static REL::Relocation func{ REL::ID(2193259) }; return func(this, a_level, a_count, a_outCont, a_allBelowForce, a_clampToPlayer, a_instanceFilter, a_overrideName); } void CalculateCurrentFormListForRef(TESObjectREFR* a_ref, BSScrapArray& a_outCont, bool a_legendary) { using func_t = decltype(&TESLeveledList::CalculateCurrentFormListForRef); - REL::Relocation func{ REL::ID(2193260) }; + static REL::Relocation func{ REL::ID(2193260) }; return func(this, a_ref, a_outCont, a_legendary); } bool GetUseAll() { using func_t = decltype(&TESLeveledList::GetUseAll); - REL::Relocation func{ REL::ID(233875) }; + static REL::Relocation func{ REL::ID(233875) }; return func(this); } @@ -2008,7 +2008,7 @@ namespace RE bool AddSpell(TESForm* a_spell) { using func_t = decltype(&TESSpellList::AddSpell); - REL::Relocation func{ REL::ID(1312083) }; + static REL::Relocation func{ REL::ID(1312083) }; return func(this, a_spell); } @@ -2039,7 +2039,7 @@ namespace RE [[nodiscard]] static std::uint32_t GetFormValue(const TESForm* a_form, const TBO_InstanceData* a_data) { using func_t = std::int32_t (*)(const TESForm*, const TBO_InstanceData*); - REL::Relocation func{ REL::ID(885783) }; + static REL::Relocation func{ REL::ID(885783) }; return func(a_form, a_data); } @@ -2061,7 +2061,7 @@ namespace RE [[nodiscard]] static float GetFormWeight(const TESForm* a_form, const TBO_InstanceData* a_data) { using func_t = float (*)(const TESForm*, const TBO_InstanceData*); - REL::Relocation func{ REL::ID(1321341) }; + static REL::Relocation func{ REL::ID(1321341) }; return func(a_form, a_data); } diff --git a/CommonLibF4/include/RE/Bethesda/FormFactory.h b/CommonLibF4/include/RE/Bethesda/FormFactory.h index 04139dee..0ddca4fe 100644 --- a/CommonLibF4/include/RE/Bethesda/FormFactory.h +++ b/CommonLibF4/include/RE/Bethesda/FormFactory.h @@ -36,7 +36,7 @@ namespace RE -> std::span { constexpr auto len = std::to_underlying(ENUM_FORM_ID::kTotal); - REL::Relocation factories{ REL::ID(2689177) }; + static REL::Relocation factories{ REL::ID(2689177) }; return { *factories }; } }; diff --git a/CommonLibF4/include/RE/Bethesda/GamePlayFormulas.h b/CommonLibF4/include/RE/Bethesda/GamePlayFormulas.h index fe26f559..5e61232f 100644 --- a/CommonLibF4/include/RE/Bethesda/GamePlayFormulas.h +++ b/CommonLibF4/include/RE/Bethesda/GamePlayFormulas.h @@ -28,28 +28,28 @@ namespace RE inline bool CanHackGateCheck(LOCK_LEVEL a_lockLevel) { using func_t = decltype(&GamePlayFormulas::CanHackGateCheck); - REL::Relocation func{ REL::ID(269668) }; + static REL::Relocation func{ REL::ID(269668) }; return func(a_lockLevel); } inline bool CanPickLockGateCheck(LOCK_LEVEL a_lockLevel) { using func_t = decltype(&GamePlayFormulas::CanPickLockGateCheck); - REL::Relocation func{ REL::ID(1160841) }; + static REL::Relocation func{ REL::ID(1160841) }; return func(a_lockLevel); } inline float GetExperienceReward(EXPERIENCE_ACTIVITY a_activity, DIFFICULTY_LEVEL a_difficulty, float a_xpBase) { using func_t = decltype(&GamePlayFormulas::GetExperienceReward); - REL::Relocation func{ REL::ID(853500) }; + static REL::Relocation func{ REL::ID(853500) }; return func(a_activity, a_difficulty, a_xpBase); } inline float GetLockXPReward(LOCK_LEVEL a_lockLevel) { using func_t = decltype(&GamePlayFormulas::GetLockXPReward); - REL::Relocation func{ REL::ID(880926) }; + static REL::Relocation func{ REL::ID(880926) }; return func(a_lockLevel); } } diff --git a/CommonLibF4/include/RE/Bethesda/GameScript.h b/CommonLibF4/include/RE/Bethesda/GameScript.h index c0ec289b..f1d56ab8 100644 --- a/CommonLibF4/include/RE/Bethesda/GameScript.h +++ b/CommonLibF4/include/RE/Bethesda/GameScript.h @@ -146,7 +146,7 @@ namespace RE BSScript::ErrorLogger::Severity a_severity = BSScript::ErrorLogger::Severity::kError) { using func_t = decltype(&LogFormError); - REL::Relocation func{ REL::ID(2251028) }; + static REL::Relocation func{ REL::ID(2251028) }; return func(a_obj, a_error, a_vm, a_stackID, a_severity); } @@ -259,21 +259,21 @@ namespace RE void DropSaveLoadRemapData() { using func_t = decltype(&HandlePolicy::DropSaveLoadRemapData); - REL::Relocation func{ REL::ID(2249995) }; + static REL::Relocation func{ REL::ID(2249995) }; return func(this); } void GetInventoryObjFromHandle(std::uint64_t a_cobj, TESObjectREFR*& a_container, std::uint16_t& a_uniqueID, TESObjectREFR*& a_inWorldREFR) { using func_t = decltype(&HandlePolicy::GetInventoryObjFromHandle); - REL::Relocation func{ REL::ID(2249989) }; + static REL::Relocation func{ REL::ID(2249989) }; return func(this, a_cobj, a_container, a_uniqueID, a_inWorldREFR); } void UpdatePersistence() { using func_t = decltype(&HandlePolicy::UpdatePersistence); - REL::Relocation func{ REL::ID(2249991) }; + static REL::Relocation func{ REL::ID(2249991) }; return func(this); } @@ -322,7 +322,7 @@ namespace RE void EndSaveLoad() { using func_t = decltype(&ObjectBindPolicy::EndSaveLoad); - REL::Relocation func{ REL::ID(2250482) }; + static REL::Relocation func{ REL::ID(2250482) }; return func(this); } @@ -494,7 +494,7 @@ namespace RE [[nodiscard]] static GameVM* GetSingleton() { - REL::Relocation singleton{ REL::ID(2689134) }; + static REL::Relocation singleton{ REL::ID(2689134) }; return *singleton; } @@ -503,14 +503,14 @@ namespace RE bool QueuePostRenderCall(const BSTSmartPointer& a_functor) { using func_t = decltype(&GameVM::QueuePostRenderCall); - REL::Relocation func{ REL::ID(2251314) }; + static REL::Relocation func{ REL::ID(2251314) }; return func(this, a_functor); } void RegisterForAllGameEvents() { using func_t = decltype(&GameVM::RegisterForAllGameEvents); - REL::Relocation func{ REL::ID(2251353) }; + static REL::Relocation func{ REL::ID(2251353) }; return func(this); } @@ -522,7 +522,7 @@ namespace RE const BSTSmartPointer& a_callback) { using func_t = decltype(&GameVM::SendEventToObjectAndRelated); - REL::Relocation func{ REL::ID(367992) }; + static REL::Relocation func{ REL::ID(367992) }; return func(this, a_object, a_eventName, a_args, a_filter, a_callback); } @@ -699,7 +699,7 @@ namespace RE inline void BindCObject(const BSTSmartPointer& a_scriptObj, const RefrOrInventoryObj& a_cobj, BSScript::IVirtualMachine& a_vm) { using func_t = decltype(&BindCObject); - REL::Relocation func{ REL::ID(81787) }; + static REL::Relocation func{ REL::ID(81787) }; return func(a_scriptObj, a_cobj, a_vm); } diff --git a/CommonLibF4/include/RE/Bethesda/IMenu.h b/CommonLibF4/include/RE/Bethesda/IMenu.h index 74fbd080..019dfc29 100644 --- a/CommonLibF4/include/RE/Bethesda/IMenu.h +++ b/CommonLibF4/include/RE/Bethesda/IMenu.h @@ -179,7 +179,7 @@ namespace RE [[nodiscard]] static FlatScreenModel* GetSingleton() { - REL::Relocation singleton{ REL::ID(847741) }; + static REL::Relocation singleton{ REL::ID(847741) }; return *singleton; } @@ -203,14 +203,14 @@ namespace RE [[nodiscard]] static GameUIModel* GetSingleton() { - REL::Relocation singleton{ REL::ID(17419) }; + static REL::Relocation singleton{ REL::ID(17419) }; return *singleton; } void UpdateDataModels() { using func_t = decltype(&GameUIModel::UpdateDataModels); - REL::Relocation func{ REL::ID(1269653) }; + static REL::Relocation func{ REL::ID(1269653) }; return func(this); } }; @@ -244,7 +244,7 @@ namespace RE bool ShouldHandleEvent(const InputEvent* a_event) override // 01 { using func_t = decltype(&IMenu::ShouldHandleEvent); - REL::Relocation func{ REL::ID(1241790) }; + static REL::Relocation func{ REL::ID(1241790) }; return func(this, a_event); } @@ -296,7 +296,7 @@ namespace RE virtual bool PassesRenderConditionText(MENU_RENDER_CONTEXT a_reason, const BSFixedString& a_customRendererName) const // 07 { using func_t = decltype(&IMenu::PassesRenderConditionText); - REL::Relocation func{ REL::ID(937304) }; + static REL::Relocation func{ REL::ID(937304) }; return func(this, a_reason, a_customRendererName); } @@ -348,7 +348,7 @@ namespace RE void OnSetSafeRect() { using func_t = decltype(&IMenu::OnSetSafeRect); - REL::Relocation func{ REL::ID(964859) }; + static REL::Relocation func{ REL::ID(964859) }; return func(this); } @@ -357,14 +357,14 @@ namespace RE UI_MESSAGE_RESULTS ProcessScaleformEvent(Scaleform::GFx::Movie* a_movie, const IUIMessageData* a_data) { using func_t = decltype(&IMenu::ProcessScaleformEvent); - REL::Relocation func{ REL::ID(150211) }; + static REL::Relocation func{ REL::ID(150211) }; return func(this, a_movie, a_data); } void RefreshPlatform() { using func_t = decltype(&IMenu::RefreshPlatform); - REL::Relocation func{ REL::ID(1071829) }; + static REL::Relocation func{ REL::ID(1071829) }; return func(this); } @@ -489,14 +489,14 @@ namespace RE Scaleform::GFx::Value* AcquireFlashObjectByMemberName(const Scaleform::GFx::Value& a_flashObject, const char* a_relativePathToMember) { using func_t = decltype(&BSGFxObject::AcquireFlashObjectByMemberName); - REL::Relocation func{ REL::ID(2287014) }; + static REL::Relocation func{ REL::ID(2287014) }; return func(this, a_flashObject, a_relativePathToMember); } Scaleform::GFx::Value* AcquireFlashObjectByPath(const Scaleform::GFx::Movie& a_parentMovie, const char* a_absolutePathToMember) { using func_t = decltype(&BSGFxObject::AcquireFlashObjectByPath); - REL::Relocation func{ REL::ID(1065592) }; + static REL::Relocation func{ REL::ID(1065592) }; return func(this, a_parentMovie, a_absolutePathToMember); } }; @@ -546,7 +546,7 @@ namespace RE void RemoveChild(const BSGFxDisplayObject& a_child) const { using func_t = decltype(&BSGFxDisplayObject::RemoveChild); - REL::Relocation func{ REL::ID(2287327) }; + static REL::Relocation func{ REL::ID(2287327) }; return func(this, a_child); } @@ -615,7 +615,7 @@ namespace RE virtual BSEventNotifyControl ProcessEvent(const ApplyColorUpdateEvent& a_event, BSTEventSource* a_source) override // 01 { using func_t = decltype(&BSGFxShaderFXTarget::ProcessEvent); - REL::Relocation func{ REL::ID(848563) }; + static REL::Relocation func{ REL::ID(848563) }; return func(this, a_event, a_source); } @@ -623,35 +623,35 @@ namespace RE virtual void AppendShaderFXInfos(BSTArray& a_colorFXInfo, BSTArray& a_backgroundFXInfo) // 02 { using func_t = decltype(&BSGFxShaderFXTarget::AppendShaderFXInfos); - REL::Relocation func{ REL::ID(2287021) }; + static REL::Relocation func{ REL::ID(2287021) }; return func(this, a_colorFXInfo, a_backgroundFXInfo); } void CreateAndSetFiltersToColor(const NiColor& a_color, float a_brightness) { using func_t = void (BSGFxShaderFXTarget::*)(const NiColor&, float); - REL::Relocation func{ REL::ID(2287028) }; + static REL::Relocation func{ REL::ID(2287028) }; func(this, a_color, a_brightness); } void CreateAndSetFiltersToColor(std::uint8_t a_r, std::uint8_t a_g, std::uint8_t a_b, float a_brightness) { using func_t = void (BSGFxShaderFXTarget::*)(std::uint8_t, std::uint8_t, std::uint8_t, float); - REL::Relocation func{ REL::ID(783104) }; + static REL::Relocation func{ REL::ID(783104) }; func(this, a_r, a_g, a_b, a_brightness); } void CreateAndSetFiltersToHUD(HUDColorTypes a_colorType, float a_scale = 1.0) { using func_t = decltype(&BSGFxShaderFXTarget::CreateAndSetFiltersToHUD); - REL::Relocation func{ REL::ID(2287027) }; + static REL::Relocation func{ REL::ID(2287027) }; func(this, a_colorType, a_scale); } void EnableShadedBackground(HUDColorTypes a_colorType, float a_scale = 1.0) { using func_t = decltype(&BSGFxShaderFXTarget::EnableShadedBackground); - REL::Relocation func{ REL::ID(2287022) }; + static REL::Relocation func{ REL::ID(2287022) }; func(this, a_colorType, a_scale); } @@ -720,14 +720,14 @@ namespace RE virtual void SetIsTopButtonBar(bool a_isTopButtonBar) override // 08 { using func_t = decltype(&GameMenuBase::SetIsTopButtonBar); - REL::Relocation func{ REL::ID(1367353) }; + static REL::Relocation func{ REL::ID(1367353) }; return func(this, a_isTopButtonBar); } virtual void OnMenuDisplayStateChanged() override // 0A { using func_t = decltype(&GameMenuBase::OnMenuDisplayStateChanged); - REL::Relocation func{ REL::ID(1274450) }; + static REL::Relocation func{ REL::ID(1274450) }; return func(this); } @@ -750,21 +750,21 @@ namespace RE virtual bool CacheShaderFXQuadsForRenderer_Impl() override // 10 { using func_t = decltype(&GameMenuBase::CacheShaderFXQuadsForRenderer_Impl); - REL::Relocation func{ REL::ID(863029) }; + static REL::Relocation func{ REL::ID(863029) }; return func(this); } virtual void TransferCachedShaderFXQuadsForRenderer(const BSFixedString& a_rendererName) override // 11 { using func_t = decltype(&GameMenuBase::TransferCachedShaderFXQuadsForRenderer); - REL::Relocation func{ REL::ID(65166) }; + static REL::Relocation func{ REL::ID(65166) }; return func(this, a_rendererName); } virtual void SetViewportRect(const NiRect& a_viewportRect) override // 12 { using func_t = decltype(&GameMenuBase::SetViewportRect); - REL::Relocation func{ REL::ID(1554334) }; + static REL::Relocation func{ REL::ID(1554334) }; return func(this, a_viewportRect); } @@ -772,14 +772,14 @@ namespace RE virtual void AppendShaderFXInfos(BSTAlignedArray& a_colorFXInfos, BSTAlignedArray& a_backgroundFXInfos) const // 13 { using func_t = decltype(&GameMenuBase::AppendShaderFXInfos); - REL::Relocation func{ REL::ID(583584) }; + static REL::Relocation func{ REL::ID(583584) }; return func(this, a_colorFXInfos, a_backgroundFXInfos); } void SetUpButtonBar(BSGFxShaderFXTarget& a_parentObject, const char* a_buttonBarPath, HUDColorTypes a_colorType) { using func_t = decltype(&GameMenuBase::SetUpButtonBar); - REL::Relocation func{ REL::ID(531584) }; + static REL::Relocation func{ REL::ID(531584) }; func(this, a_parentObject, a_buttonBarPath, a_colorType); } @@ -816,25 +816,25 @@ namespace RE static void ExecuteCommand(const char* a_command) { using func_t = decltype(&Console::ExecuteCommand); - REL::Relocation func{ REL::ID(2248537) }; + static REL::Relocation func{ REL::ID(2248537) }; return func(a_command); } [[nodiscard]] static decltype(auto) GetCurrentPickIndex() { - REL::Relocation currentPickIndex{ REL::ID(2701382) }; + static REL::Relocation currentPickIndex{ REL::ID(2701382) }; return *currentPickIndex; } [[nodiscard]] static decltype(auto) GetPickRef() { - REL::Relocation ref{ REL::ID(170742) }; + static REL::Relocation ref{ REL::ID(170742) }; return *ref; } [[nodiscard]] static decltype(auto) GetPickRefs() { - REL::Relocation*> pickRefs{ REL::ID(875116) }; + static REL::Relocation*> pickRefs{ REL::ID(875116) }; return *pickRefs; } @@ -850,7 +850,7 @@ namespace RE void SetCurrentPickREFR(stl::not_null a_refr) { using func_t = decltype(&Console::SetCurrentPickREFR); - REL::Relocation func{ REL::ID(2248551) }; + static REL::Relocation func{ REL::ID(2248551) }; return func(this, a_refr); } @@ -930,49 +930,49 @@ namespace RE void Begin3D() { using func_t = decltype(&Inventory3DManager::Begin3D); - REL::Relocation func{ REL::ID(662659) }; + static REL::Relocation func{ REL::ID(662659) }; return func(this); } void ClearModel() { using func_t = decltype(&Inventory3DManager::ClearModel); - REL::Relocation func{ REL::ID(63218) }; + static REL::Relocation func{ REL::ID(63218) }; return func(this); } void DisableRendering(const BSFixedString& a_userID) { using func_t = decltype(&Inventory3DManager::DisableRendering); - REL::Relocation func{ REL::ID(255893) }; + static REL::Relocation func{ REL::ID(255893) }; return func(this, a_userID); } void EnableRendering(const BSFixedString& a_userID) { using func_t = decltype(&Inventory3DManager::EnableRendering); - REL::Relocation func{ REL::ID(176578) }; + static REL::Relocation func{ REL::ID(176578) }; return func(this, a_userID); } void End3D() { using func_t = decltype(&Inventory3DManager::End3D); - REL::Relocation func{ REL::ID(1512675) }; + static REL::Relocation func{ REL::ID(1512675) }; return func(this); } void SetModelScale(float a_scale) { using func_t = decltype(&Inventory3DManager::SetModelScale); - REL::Relocation func{ REL::ID(1319701) }; + static REL::Relocation func{ REL::ID(1319701) }; return func(this, a_scale); } void SetModelScreenPosition(const NiPoint3& a_position, bool a_screenCoords) { using func_t = decltype(&Inventory3DManager::SetModelScreenPosition); - REL::Relocation func{ REL::ID(2967) }; + static REL::Relocation func{ REL::ID(2967) }; return func(this, a_position, a_screenCoords); } @@ -1085,14 +1085,14 @@ namespace RE void CheckAndSetItemForPlacement() { using func_t = decltype(&WorkshopMenu::CheckAndSetItemForPlacement); - REL::Relocation func{ REL::ID(1541862) }; + static REL::Relocation func{ REL::ID(1541862) }; return func(this); } void UpdateButtonText() { using func_t = decltype(&WorkshopMenu::UpdateButtonText); - REL::Relocation func{ REL::ID(1089189) }; + static REL::Relocation func{ REL::ID(1089189) }; return func(this); } @@ -1134,7 +1134,7 @@ namespace RE BSEventNotifyControl ProcessEvent(const PipboyValueChangedEvent& a_event, BSTEventSource* a_source) override { using func_t = decltype(&PipboySubMenu::ProcessEvent); - REL::Relocation func{ REL::ID(893703) }; + static REL::Relocation func{ REL::ID(893703) }; return func(this, a_event, a_source); } @@ -1158,7 +1158,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyStatsMenu::UpdateData); - REL::Relocation func{ REL::ID(332518) }; + static REL::Relocation func{ REL::ID(332518) }; return func(this); } @@ -1178,7 +1178,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboySpecialMenu::UpdateData); - REL::Relocation func{ REL::ID(1426810) }; + static REL::Relocation func{ REL::ID(1426810) }; return func(this); } }; @@ -1195,7 +1195,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyPerksMenu::UpdateData); - REL::Relocation func{ REL::ID(783380) }; + static REL::Relocation func{ REL::ID(783380) }; return func(this); } }; @@ -1212,7 +1212,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyInventoryMenu::UpdateData); - REL::Relocation func{ REL::ID(762897) }; + static REL::Relocation func{ REL::ID(762897) }; return func(this); } }; @@ -1229,7 +1229,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyQuestMenu::UpdateData); - REL::Relocation func{ REL::ID(1495929) }; + static REL::Relocation func{ REL::ID(1495929) }; return func(this); } }; @@ -1246,7 +1246,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyWorkshopMenu::UpdateData); - REL::Relocation func{ REL::ID(1370368) }; + static REL::Relocation func{ REL::ID(1370368) }; return func(this); } }; @@ -1263,7 +1263,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyLogMenu::UpdateData); - REL::Relocation func{ REL::ID(672256) }; + static REL::Relocation func{ REL::ID(672256) }; return func(this); } }; @@ -1290,7 +1290,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyMapMenu::UpdateData); - REL::Relocation func{ REL::ID(92696) }; + static REL::Relocation func{ REL::ID(92696) }; return func(this); } @@ -1316,7 +1316,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyRadioMenu::UpdateData); - REL::Relocation func{ REL::ID(713423) }; + static REL::Relocation func{ REL::ID(713423) }; return func(this); } @@ -1335,7 +1335,7 @@ namespace RE void UpdateData() override { using func_t = decltype(&PipboyPlayerInfoMenu::UpdateData); - REL::Relocation func{ REL::ID(426990) }; + static REL::Relocation func{ REL::ID(426990) }; return func(this); } }; @@ -1452,7 +1452,7 @@ namespace RE void IncrementSort() { using func_t = decltype(&ItemSorter::IncrementSort); - REL::Relocation func{ REL::ID(1307263) }; + static REL::Relocation func{ REL::ID(1307263) }; return func(this); } @@ -1540,7 +1540,7 @@ namespace RE void TakeAllItems() { using func_t = decltype(&ContainerMenu::TakeAllItems); - REL::Relocation func{ REL::ID(1323703) }; + static REL::Relocation func{ REL::ID(1323703) }; return func(this); } @@ -1614,21 +1614,21 @@ namespace RE void ClearTradingData() { using func_t = decltype(&BarterMenu::ClearTradingData); - REL::Relocation func{ REL::ID(1112285) }; + static REL::Relocation func{ REL::ID(1112285) }; return func(this); } void CompleteTrade() { using func_t = decltype(&BarterMenu::CompleteTrade); - REL::Relocation func{ REL::ID(379932) }; + static REL::Relocation func{ REL::ID(379932) }; return func(this); } [[nodiscard]] std::int64_t GetCapsOwedByPlayer() { using func_t = decltype(&BarterMenu::GetCapsOwedByPlayer); - REL::Relocation func{ REL::ID(672405) }; + static REL::Relocation func{ REL::ID(672405) }; return func(this); } @@ -1661,7 +1661,7 @@ namespace RE void ShowMessage() { using func_t = decltype(&MessageBoxMenu::ShowMessage); - REL::Relocation func{ REL::ID(442479) }; + static REL::Relocation func{ REL::ID(442479) }; return func(this); } @@ -1975,21 +1975,21 @@ namespace RE void BuildWeaponScrappingArray() { using func_t = decltype(&ExamineMenu::BuildWeaponScrappingArray); - REL::Relocation func{ REL::ID(646841) }; + static REL::Relocation func{ REL::ID(646841) }; return func(this); } [[nodiscard]] std::uint32_t GetSelectedIndex() { using func_t = decltype(&ExamineMenu::GetSelectedIndex); - REL::Relocation func{ REL::ID(776503) }; + static REL::Relocation func{ REL::ID(776503) }; return func(this); } void ShowConfirmMenu(ExamineConfirmMenu::InitData* a_data, ExamineConfirmMenu::ICallback* a_callback) { using func_t = decltype(&ExamineMenu::ShowConfirmMenu); - REL::Relocation func{ REL::ID(443081) }; + static REL::Relocation func{ REL::ID(443081) }; return func(this, a_data, a_callback); } @@ -2139,7 +2139,7 @@ namespace RE static void OpenLockpickingMenu(TESObjectREFR* a_lockedRef) { using func_t = decltype(&LockpickingMenu::OpenLockpickingMenu); - REL::Relocation func{ REL::ID(129892) }; + static REL::Relocation func{ REL::ID(129892) }; return func(a_lockedRef); } @@ -2199,14 +2199,14 @@ namespace RE static void OnEnterFurniture(ObjectRefHandle a_handle) { using func_t = decltype(&SitWaitMenu::OnEnterFurniture); - REL::Relocation func{ REL::ID(562238) }; + static REL::Relocation func{ REL::ID(562238) }; return func(a_handle); } static void OnExitFurniture() { using func_t = decltype(&SitWaitMenu::OnExitFurniture); - REL::Relocation func{ REL::ID(454795) }; + static REL::Relocation func{ REL::ID(454795) }; return func(); } @@ -2345,14 +2345,14 @@ namespace RE static void ShowHolotapeInPipboy(const BSFixedString& a_holotapePath) { using func_t = decltype(&HolotapeMenu::ShowHolotapeInPipboy); - REL::Relocation func{ REL::ID(217953) }; + static REL::Relocation func{ REL::ID(217953) }; return func(a_holotapePath); } static void ShowHolotapeInTerminal(const BSFixedString& a_holotapePath) { using func_t = decltype(&HolotapeMenu::ShowHolotapeInTerminal); - REL::Relocation func{ REL::ID(390509) }; + static REL::Relocation func{ REL::ID(390509) }; return func(a_holotapePath); } diff --git a/CommonLibF4/include/RE/Bethesda/ImageSpaceManager.h b/CommonLibF4/include/RE/Bethesda/ImageSpaceManager.h index 3ab8f038..dd6f4703 100644 --- a/CommonLibF4/include/RE/Bethesda/ImageSpaceManager.h +++ b/CommonLibF4/include/RE/Bethesda/ImageSpaceManager.h @@ -271,7 +271,7 @@ namespace RE [[nodiscard]] static ImageSpaceManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(2712627) }; + static REL::Relocation singleton{ REL::ID(2712627) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/ImageSpaceModifier.h b/CommonLibF4/include/RE/Bethesda/ImageSpaceModifier.h index 9af84ce7..a2cd7071 100644 --- a/CommonLibF4/include/RE/Bethesda/ImageSpaceModifier.h +++ b/CommonLibF4/include/RE/Bethesda/ImageSpaceModifier.h @@ -61,28 +61,28 @@ namespace RE static ImageSpaceModifierInstanceForm* Trigger(TESImageSpaceModifier* a_mod, float a_strength, NiAVObject* a_target) { using func_t = ImageSpaceModifierInstanceForm* (*)(TESImageSpaceModifier*, float, NiAVObject*); - REL::Relocation func{ REL::ID(179769) }; + static REL::Relocation func{ REL::ID(179769) }; return func(a_mod, a_strength, a_target); } static ImageSpaceModifierInstanceForm* Trigger(const BSFixedString& a_name) { using func_t = ImageSpaceModifierInstanceForm* (*)(const BSFixedString&); - REL::Relocation func{ REL::ID(1216312) }; + static REL::Relocation func{ REL::ID(1216312) }; return func(a_name); } static void Stop(TESImageSpaceModifier* a_mod) { using func_t = void (*)(TESImageSpaceModifier*); - REL::Relocation func{ REL::ID(217873) }; + static REL::Relocation func{ REL::ID(217873) }; return func(a_mod); } static void Stop(const BSFixedString& a_name) { using func_t = void (*)(const BSFixedString&); - REL::Relocation func{ REL::ID(549773) }; + static REL::Relocation func{ REL::ID(549773) }; return func(a_name); } diff --git a/CommonLibF4/include/RE/Bethesda/Interface3D.h b/CommonLibF4/include/RE/Bethesda/Interface3D.h index 50c27cfe..94b969ff 100644 --- a/CommonLibF4/include/RE/Bethesda/Interface3D.h +++ b/CommonLibF4/include/RE/Bethesda/Interface3D.h @@ -124,14 +124,14 @@ namespace RE static Renderer* Create(const BSFixedString& a_name, RE::UI_DEPTH_PRIORITY a_depth, float a_fov, bool a_alwaysRenderWhenEnabled) { using func_t = decltype(&Renderer::Create); - REL::Relocation func{ REL::ID(88488) }; + static REL::Relocation func{ REL::ID(88488) }; return func(a_name, a_depth, a_fov, a_alwaysRenderWhenEnabled); } [[nodiscard]] static Renderer* GetByName(const BSFixedString& a_name) { using func_t = decltype(&Renderer::GetByName); - REL::Relocation func{ REL::ID(140387) }; + static REL::Relocation func{ REL::ID(140387) }; return func(a_name); } @@ -142,7 +142,7 @@ namespace RE float a_dimmerVal) { using func_t = decltype(&Renderer::MainScreen_AddPointLight); - REL::Relocation func{ REL::ID(1335675) }; + static REL::Relocation func{ REL::ID(1335675) }; return func(this, a_translation, a_diffuse, a_radius, a_dimmerVal); } @@ -157,14 +157,14 @@ namespace RE bool a_castShadows) { using func_t = decltype(&Renderer::MainScreen_AddSpotLight); - REL::Relocation func{ REL::ID(1056093) }; + static REL::Relocation func{ REL::ID(1056093) }; return func(this, a_translation, a_lookAtPosition, a_lookAtObject, a_fov, a_diffuse, a_radius, a_dimmerVal, a_castShadows); } void MainScreen_ClearLights() { using func_t = decltype(&Renderer::MainScreen_ClearLights); - REL::Relocation func{ REL::ID(683530) }; + static REL::Relocation func{ REL::ID(683530) }; return func(this); } @@ -220,7 +220,7 @@ namespace RE void MainScreen_SetScreenAttached3D(NiAVObject* a_root3D) { using func_t = decltype(&Renderer::MainScreen_SetScreenAttached3D); - REL::Relocation func{ REL::ID(817727) }; + static REL::Relocation func{ REL::ID(817727) }; return func(this, a_root3D); } @@ -232,7 +232,7 @@ namespace RE void MainScreen_SetWorldAttached3D(NiAVObject* a_root3D) { using func_t = decltype(&Renderer::MainScreen_SetWorldAttached3D); - REL::Relocation func{ REL::ID(724778) }; + static REL::Relocation func{ REL::ID(724778) }; return func(this, a_root3D); } @@ -254,21 +254,21 @@ namespace RE float a_dimmerVal) { using func_t = decltype(&Renderer::Offscreen_AddLight); - REL::Relocation func{ REL::ID(1267198) }; + static REL::Relocation func{ REL::ID(1267198) }; return func(this, a_translation, a_diffuse, a_specular, a_dimmerVal); } void Offscreen_Clear3D() { using func_t = decltype(&Renderer::Offscreen_Clear3D); - REL::Relocation func{ REL::ID(1533262) }; + static REL::Relocation func{ REL::ID(1533262) }; return func(this); } void Offscreen_ClearLights() { using func_t = decltype(&Renderer::Offscreen_ClearLights); - REL::Relocation func{ REL::ID(1039253) }; + static REL::Relocation func{ REL::ID(1039253) }; return func(this); } @@ -280,21 +280,21 @@ namespace RE std::uint32_t Offscreen_GetRenderTargetHeight() { using func_t = decltype(&Renderer::Offscreen_GetRenderTargetHeight); - REL::Relocation func{ REL::ID(1280897) }; + static REL::Relocation func{ REL::ID(1280897) }; return func(this); } std::uint32_t Offscreen_GetRenderTargetWidth() { using func_t = decltype(&Renderer::Offscreen_GetRenderTargetWidth); - REL::Relocation func{ REL::ID(403273) }; + static REL::Relocation func{ REL::ID(403273) }; return func(this); } void Offscreen_Set3D(NiAVObject* a_3D) { using func_t = decltype(&Renderer::Offscreen_Set3D); - REL::Relocation func{ REL::ID(43983) }; + static REL::Relocation func{ REL::ID(43983) }; return func(this, a_3D); } @@ -316,7 +316,7 @@ namespace RE void Offscreen_SetDebugMode(bool a_on, bool a_small, std::uint32_t a_target) { using func_t = decltype(&Renderer::Offscreen_SetDebugMode); - REL::Relocation func{ REL::ID(1277879) }; + static REL::Relocation func{ REL::ID(1277879) }; return func(this, a_on, a_small, a_target); } @@ -327,7 +327,7 @@ namespace RE float a_dimmerVal) { using func_t = decltype(&Renderer::Offscreen_SetDirectionalLight); - REL::Relocation func{ REL::ID(987144) }; + static REL::Relocation func{ REL::ID(987144) }; return func(this, a_xyPlaneAngle, a_zAngle, a_diffuse, a_dimmerVal); } @@ -359,28 +359,28 @@ namespace RE void Enable(bool a_unhideGeometries = false) { using func_t = decltype(&Renderer::Enable); - REL::Relocation func{ REL::ID(326895) }; + static REL::Relocation func{ REL::ID(326895) }; return func(this, a_unhideGeometries); } void Disable() { using func_t = decltype(&Renderer::Disable); - REL::Relocation func{ REL::ID(938370) }; + static REL::Relocation func{ REL::ID(938370) }; return func(this); } void Release() { using func_t = decltype(&Renderer::Release); - REL::Relocation func{ REL::ID(74749) }; + static REL::Relocation func{ REL::ID(74749) }; return func(this); } void SetViewport(RE::Scaleform::GFx::Movie& a_ui, const NiRect& a_renderArea) { using func_t = decltype(&Renderer::SetViewport); - REL::Relocation func{ REL::ID(825410) }; + static REL::Relocation func{ REL::ID(825410) }; return func(this, a_ui, a_renderArea); } diff --git a/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h b/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h index c9f1b7fd..1648ebcf 100644 --- a/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h +++ b/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h @@ -24,7 +24,7 @@ namespace RE float a_compareDamage = FLT_MAX) { using func_t = decltype(&detail::AddItemCardInfoEntry); - REL::Relocation func{ REL::ID(489521) }; + static REL::Relocation func{ REL::ID(489521) }; return func(a_array, a_newEntry, a_textID, a_value, a_difference, a_totalDamage, a_compareDamage); } } @@ -51,7 +51,7 @@ namespace RE inline void GetEffectDisplayInfo(MagicItem* a_item, EffectItem* a_effect, float& a_magnitude, float& a_duration) { using func_t = decltype(&StatsMenuUtils::GetEffectDisplayInfo); - REL::Relocation func{ REL::ID(294691) }; + static REL::Relocation func{ REL::ID(294691) }; return func(a_item, a_effect, a_magnitude, a_duration); } } @@ -63,21 +63,21 @@ namespace RE inline void GetComparisonItems(const TESBoundObject* a_object, ComparisonItems& a_comparisonItems) { using func_t = decltype(&GetComparisonItems); - REL::Relocation func{ REL::ID(593818) }; + static REL::Relocation func{ REL::ID(593818) }; return func(a_object, a_comparisonItems); } inline void PlayPipboySound(const char* a_soundName) { using func_t = decltype(&PlayPipboySound); - REL::Relocation func{ REL::ID(1320952) }; + static REL::Relocation func{ REL::ID(1320952) }; return func(a_soundName); } inline void PlayMenuSound(const char* a_soundName) { using func_t = decltype(&PlayMenuSound); - REL::Relocation func{ REL::ID(1227993) }; + static REL::Relocation func{ REL::ID(1227993) }; return func(a_soundName); } } diff --git a/CommonLibF4/include/RE/Bethesda/ItemCrafted.h b/CommonLibF4/include/RE/Bethesda/ItemCrafted.h index 6d55f6c8..64df4567 100644 --- a/CommonLibF4/include/RE/Bethesda/ItemCrafted.h +++ b/CommonLibF4/include/RE/Bethesda/ItemCrafted.h @@ -20,21 +20,21 @@ namespace RE inline void NotifyOfItemCrafted(const TESFurniture* a_workbench, const BGSConstructibleObject* a_recipe) { using func_t = decltype(&NotifyOfItemCrafted); - REL::Relocation func{ REL::ID(2232809) }; + static REL::Relocation func{ REL::ID(2232809) }; return func(a_workbench, a_recipe); } inline void RegisterSink(BSTEventSink* a_sink) { using func_t = decltype(&RegisterSink); - REL::Relocation func{ REL::ID(2232807) }; + static REL::Relocation func{ REL::ID(2232807) }; return func(a_sink); } inline void UnregisterSink(BSTEventSink* a_sink) { using func_t = decltype(&UnregisterSink); - REL::Relocation func{ REL::ID(2232808) }; + static REL::Relocation func{ REL::ID(2232808) }; return func(a_sink); } } diff --git a/CommonLibF4/include/RE/Bethesda/MagicItems.h b/CommonLibF4/include/RE/Bethesda/MagicItems.h index a8c415cf..56aadbf4 100644 --- a/CommonLibF4/include/RE/Bethesda/MagicItems.h +++ b/CommonLibF4/include/RE/Bethesda/MagicItems.h @@ -31,7 +31,7 @@ namespace RE void GetDescription(BSStringT* a_buffer, const char* a_beginTagFormat, const char* a_endTagFormat, float a_magnitude, float a_duration) { using func_t = decltype(&EffectItem::GetDescription); - REL::Relocation func{ REL::ID(949839) }; + static REL::Relocation func{ REL::ID(949839) }; return func(this, a_buffer, a_beginTagFormat, a_endTagFormat, a_magnitude, a_duration); } diff --git a/CommonLibF4/include/RE/Bethesda/MemoryManager.h b/CommonLibF4/include/RE/Bethesda/MemoryManager.h index 63b1adf1..ff6378e7 100644 --- a/CommonLibF4/include/RE/Bethesda/MemoryManager.h +++ b/CommonLibF4/include/RE/Bethesda/MemoryManager.h @@ -124,14 +124,14 @@ namespace RE void* Allocate(std::size_t a_size, std::size_t a_alignment) { using func_t = decltype(&ScrapHeap::Allocate); - REL::Relocation func{ REL::ID(2267983) }; + static REL::Relocation func{ REL::ID(2267983) }; return func(this, a_size, a_alignment); } void Deallocate(void* a_mem) { using func_t = decltype(&ScrapHeap::Deallocate); - REL::Relocation func{ REL::ID(2267984) }; + static REL::Relocation func{ REL::ID(2267984) }; return func(this, a_mem); } @@ -171,14 +171,14 @@ namespace RE AutoScrapBuffer* Ctor() { using func_t = decltype(&AutoScrapBuffer::Ctor); - REL::Relocation func{ REL::ID(2267865) }; + static REL::Relocation func{ REL::ID(2267865) }; return func(this); } void Dtor() { using func_t = decltype(&AutoScrapBuffer::Dtor); - REL::Relocation func{ REL::ID(2267867) }; + static REL::Relocation func{ REL::ID(2267867) }; return func(this); } }; diff --git a/CommonLibF4/include/RE/Bethesda/MenuControls.h b/CommonLibF4/include/RE/Bethesda/MenuControls.h index 511c1e51..ce7b1d3d 100644 --- a/CommonLibF4/include/RE/Bethesda/MenuControls.h +++ b/CommonLibF4/include/RE/Bethesda/MenuControls.h @@ -22,7 +22,7 @@ namespace RE public: [[nodiscard]] static MenuControls* GetSingleton() { - REL::Relocation singleton{ REL::ID(520890) }; + static REL::Relocation singleton{ REL::ID(520890) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/MenuCursor.h b/CommonLibF4/include/RE/Bethesda/MenuCursor.h index da12fa01..2484d38f 100644 --- a/CommonLibF4/include/RE/Bethesda/MenuCursor.h +++ b/CommonLibF4/include/RE/Bethesda/MenuCursor.h @@ -15,14 +15,14 @@ namespace RE [[nodiscard]] static MenuCursor* GetSingleton() { - REL::Relocation singleton{ REL::ID(695696) }; + static REL::Relocation singleton{ REL::ID(695696) }; return *singleton; } void CenterCursor() { using func_t = decltype(&MenuCursor::CenterCursor); - REL::Relocation func{ REL::ID(1107298) }; + static REL::Relocation func{ REL::ID(1107298) }; return func(this); } @@ -40,21 +40,21 @@ namespace RE void RegisterCursor() { using func_t = decltype(&MenuCursor::RegisterCursor); - REL::Relocation func{ REL::ID(1318193) }; + static REL::Relocation func{ REL::ID(1318193) }; return func(this); } void SetCursorConstraintsRaw(std::uint32_t a_tlx, std::uint32_t a_tly, std::uint32_t a_width, std::uint32_t a_height) { using func_t = decltype(&MenuCursor::SetCursorConstraintsRaw); - REL::Relocation func{ REL::ID(907092) }; + static REL::Relocation func{ REL::ID(907092) }; return func(this, a_tlx, a_tly, a_width, a_height); } void UnregisterCursor() { using func_t = decltype(&MenuCursor::UnregisterCursor); - REL::Relocation func{ REL::ID(1225249) }; + static REL::Relocation func{ REL::ID(1225249) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h b/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h index 25cb9c05..422c42b0 100644 --- a/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h +++ b/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h @@ -13,7 +13,7 @@ namespace RE [[nodiscard]] static MenuTopicManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(520890) }; // TODO: Update + static REL::Relocation singleton{ REL::ID(520890) }; // TODO: Update return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/MessageMenuManager.h b/CommonLibF4/include/RE/Bethesda/MessageMenuManager.h index 03202f71..9589ae5c 100644 --- a/CommonLibF4/include/RE/Bethesda/MessageMenuManager.h +++ b/CommonLibF4/include/RE/Bethesda/MessageMenuManager.h @@ -88,7 +88,7 @@ namespace RE public: [[nodiscard]] static MessageMenuManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(959572) }; + static REL::Relocation singleton{ REL::ID(959572) }; return *singleton; } @@ -104,7 +104,7 @@ namespace RE bool a_ensureUnique = false) { using func_t = decltype(&MessageMenuManager::Create); - REL::Relocation func{ REL::ID(89563) }; + static REL::Relocation func{ REL::ID(89563) }; return func(this, a_headerText, a_bodyText, a_callback, a_warningContext, a_button1Text, a_button2Text, a_button3Text, a_button4Text, a_ensureUnique); } diff --git a/CommonLibF4/include/RE/Bethesda/PipboyInventoryUtils.h b/CommonLibF4/include/RE/Bethesda/PipboyInventoryUtils.h index e9408a60..3d61fadd 100644 --- a/CommonLibF4/include/RE/Bethesda/PipboyInventoryUtils.h +++ b/CommonLibF4/include/RE/Bethesda/PipboyInventoryUtils.h @@ -9,21 +9,21 @@ namespace RE inline bool DoSlotsOverlap(const TESObjectARMO* a_armor1, const TESObjectARMO* a_armor2) { using func_t = decltype(&DoSlotsOverlap); - REL::Relocation func{ REL::ID(1035436) }; + static REL::Relocation func{ REL::ID(1035436) }; return func(a_armor1, a_armor2); } inline void FillDamageTypeInfo(const BGSInventoryItem& a_item, const BGSInventoryItem::Stack* a_stack, BSScrapArray>& a_damageValuesPerType) { using func_t = decltype(&FillDamageTypeInfo); - REL::Relocation func{ REL::ID(928518) }; + static REL::Relocation func{ REL::ID(928518) }; return func(a_item, a_stack, a_damageValuesPerType); } inline void FillResistTypeInfo(const BGSInventoryItem& a_item, const BGSInventoryItem::Stack* a_stack, BSScrapArray>& a_resistValuesPerType, float a_scale) { using func_t = decltype(&FillResistTypeInfo); - REL::Relocation func{ REL::ID(1578434) }; + static REL::Relocation func{ REL::ID(1578434) }; return func(a_item, a_stack, a_resistValuesPerType, a_scale); } } diff --git a/CommonLibF4/include/RE/Bethesda/PipboyManager.h b/CommonLibF4/include/RE/Bethesda/PipboyManager.h index 3d716339..e0252d95 100644 --- a/CommonLibF4/include/RE/Bethesda/PipboyManager.h +++ b/CommonLibF4/include/RE/Bethesda/PipboyManager.h @@ -62,182 +62,182 @@ namespace RE [[nodiscard]] static PipboyManager* GetSingleton() { - REL::Relocation singleton{ REL::ID(553234) }; + static REL::Relocation singleton{ REL::ID(553234) }; return *singleton; } void AddMenuToPipboy(IMenu& a_menu, const NiRect& a_standVP, const NiRect& a_powerVP) { using func_t = decltype(&PipboyManager::AddMenuToPipboy); - REL::Relocation func{ REL::ID(394568) }; + static REL::Relocation func{ REL::ID(394568) }; return func(this, a_menu, a_standVP, a_powerVP); } void ClosedownPipboy() { using func_t = decltype(&PipboyManager::ClosedownPipboy); - REL::Relocation func{ REL::ID(731410) }; + static REL::Relocation func{ REL::ID(731410) }; return func(this); } void DisablePipboyShader() { using func_t = decltype(&PipboyManager::DisablePipboyShader); - REL::Relocation func{ REL::ID(662519) }; + static REL::Relocation func{ REL::ID(662519) }; return func(this); } void EnablePipboyShader() { using func_t = decltype(&PipboyManager::EnablePipboyShader); - REL::Relocation func{ REL::ID(157921) }; + static REL::Relocation func{ REL::ID(157921) }; return func(this); } void InitPipboy() { using func_t = decltype(&PipboyManager::InitPipboy); - REL::Relocation func{ REL::ID(1477369) }; + static REL::Relocation func{ REL::ID(1477369) }; return func(this); } void LowerPipboy(LOWER_REASON a_reason) { using func_t = decltype(&PipboyManager::LowerPipboy); - REL::Relocation func{ REL::ID(1444875) }; + static REL::Relocation func{ REL::ID(1444875) }; return func(this, a_reason); } void OnPipboyCloseAnim() { using func_t = decltype(&PipboyManager::OnPipboyCloseAnim); - REL::Relocation func{ REL::ID(1231000) }; + static REL::Relocation func{ REL::ID(1231000) }; return func(this); } void OnPipboyCloseAnimFailed() { using func_t = decltype(&PipboyManager::OnPipboyCloseAnimFailed); - REL::Relocation func{ REL::ID(1362084) }; + static REL::Relocation func{ REL::ID(1362084) }; return func(this); } void OnPipboyClosed() { using func_t = decltype(&PipboyManager::OnPipboyClosed); - REL::Relocation func{ REL::ID(592088) }; + static REL::Relocation func{ REL::ID(592088) }; return func(this); } void OnPipboyOpenAnim() { using func_t = decltype(&PipboyManager::OnPipboyOpenAnim); - REL::Relocation func{ REL::ID(1500318) }; + static REL::Relocation func{ REL::ID(1500318) }; return func(this); } void OnPipboyOpenAnimFailed() { using func_t = decltype(&PipboyManager::OnPipboyOpenAnimFailed); - REL::Relocation func{ REL::ID(702357) }; + static REL::Relocation func{ REL::ID(702357) }; return func(this); } void OnPipboyOpened() { using func_t = decltype(&PipboyManager::OnPipboyOpened); - REL::Relocation func{ REL::ID(1299608) }; + static REL::Relocation func{ REL::ID(1299608) }; return func(this); } void PlayItemAnimOnClose() { using func_t = decltype(&PipboyManager::PlayItemAnimOnClose); - REL::Relocation func{ REL::ID(377837) }; + static REL::Relocation func{ REL::ID(377837) }; return func(this); } void PlayPipboyCloseAnim(bool a_noAnim) { using func_t = decltype(&PipboyManager::PlayPipboyCloseAnim); - REL::Relocation func{ REL::ID(273927) }; + static REL::Relocation func{ REL::ID(273927) }; return func(this, a_noAnim); } void PlayPipboyGenericOpenAnim(const BSFixedString& a_menu, const BSFixedString& a_anim, bool a_noAnim) { using func_t = decltype(&PipboyManager::PlayPipboyGenericOpenAnim); - REL::Relocation func{ REL::ID(809076) }; + static REL::Relocation func{ REL::ID(809076) }; return func(this, a_menu, a_anim, a_noAnim); } void PlayPipboyLoadHolotapeAnim(BGSNote* a_holotape, bool a_noAnim) { using func_t = decltype(&PipboyManager::PlayPipboyLoadHolotapeAnim); - REL::Relocation func{ REL::ID(477096) }; + static REL::Relocation func{ REL::ID(477096) }; return func(this, a_holotape, a_noAnim); } void PlayPipboyOpenAnim(const RE::BSFixedString& a_menuName) { using func_t = decltype(&PipboyManager::PlayPipboyOpenAnim); - REL::Relocation func{ REL::ID(663900) }; + static REL::Relocation func{ REL::ID(663900) }; return func(this, a_menuName); } void PlayPipboyOpenTerminalAnim(BGSTerminal* a_terminal) { using func_t = decltype(&PipboyManager::PlayPipboyOpenTerminalAnim); - REL::Relocation func{ REL::ID(743427) }; + static REL::Relocation func{ REL::ID(743427) }; return func(this, a_terminal); } void ProcessLoweringReason() { using func_t = decltype(&PipboyManager::ProcessLoweringReason); - REL::Relocation func{ REL::ID(302903) }; + static REL::Relocation func{ REL::ID(302903) }; return func(this); } bool QPipboyActive() { using func_t = decltype(&PipboyManager::QPipboyActive); - REL::Relocation func{ REL::ID(470886) }; + static REL::Relocation func{ REL::ID(470886) }; return func(this); } void RaisePipboy() { using func_t = decltype(&PipboyManager::RaisePipboy); - REL::Relocation func{ REL::ID(726763) }; + static REL::Relocation func{ REL::ID(726763) }; return func(this); } void RefreshPipboyRenderSurface() { using func_t = decltype(&PipboyManager::RefreshPipboyRenderSurface); - REL::Relocation func{ REL::ID(81339) }; + static REL::Relocation func{ REL::ID(81339) }; return func(this); } void StartAnimationGraphListening() { using func_t = decltype(&PipboyManager::StartAnimationGraphListening); - REL::Relocation func{ REL::ID(714713) }; + static REL::Relocation func{ REL::ID(714713) }; return func(this); } void StopAnimationGraphListening() { using func_t = decltype(&PipboyManager::StopAnimationGraphListening); - REL::Relocation func{ REL::ID(621144) }; + static REL::Relocation func{ REL::ID(621144) }; return func(this); } void UpdateCursorConstraint(bool a_enable) { using func_t = decltype(&PipboyManager::UpdateCursorConstraint); - REL::Relocation func{ REL::ID(900802) }; + static REL::Relocation func{ REL::ID(900802) }; return func(this, a_enable); } diff --git a/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h b/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h index e05fb890..5f8c9932 100644 --- a/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h +++ b/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h @@ -244,14 +244,14 @@ namespace RE void ctor(bool a_suppressMessages, bool a_suppressAudio) { using func_t = decltype(&ScopedInventoryChangeMessageContext::ctor); - REL::Relocation func{ REL::ID(1512872) }; + static REL::Relocation func{ REL::ID(1512872) }; return func(this, a_suppressMessages, a_suppressAudio); } void dtor() { using func_t = decltype(&ScopedInventoryChangeMessageContext::dtor); - REL::Relocation func{ REL::ID(542100) }; + static REL::Relocation func{ REL::ID(542100) }; return func(this); } }; @@ -265,41 +265,41 @@ namespace RE [[nodiscard]] static PlayerCharacter* GetSingleton() { - REL::Relocation*> singleton{ REL::ID(2690919) }; + static REL::Relocation*> singleton{ REL::ID(2690919) }; return singleton->get(); } [[nodiscard]] static ActorHandle GetPlayerHandle() { - REL::Relocation singleton{ REL::ID(2698072) }; + static REL::Relocation singleton{ REL::ID(2698072) }; return *singleton; } DIFFICULTY_LEVEL GetDifficultyLevel() { using func_t = decltype(&PlayerCharacter::GetDifficultyLevel); - REL::Relocation func{ REL::ID(2233056) }; + static REL::Relocation func{ REL::ID(2233056) }; return func(this); } bool IsGodMode() { using func_t = decltype(&PlayerCharacter::IsGodMode); - REL::Relocation func{ REL::ID(2232986) }; + static REL::Relocation func{ REL::ID(2232986) }; return func(this); } bool IsHolotapePlaying(BGSNote* a_holotape) { using func_t = decltype(&PlayerCharacter::IsHolotapePlaying); - REL::Relocation func{ REL::ID(2233206) }; + static REL::Relocation func{ REL::ID(2233206) }; return func(this, a_holotape); } bool IsImmortal() { using func_t = decltype(&PlayerCharacter::IsImmortal); - REL::Relocation func{ REL::ID(2232988) }; + static REL::Relocation func{ REL::ID(2232988) }; return func(this); } @@ -308,7 +308,7 @@ namespace RE bool IsPipboyLightOn() { using func_t = decltype(&PlayerCharacter::IsPipboyLightOn); - REL::Relocation func{ REL::ID(426550) }; + static REL::Relocation func{ REL::ID(426550) }; return func(this); } @@ -317,70 +317,70 @@ namespace RE void PauseHolotape(BGSNote* a_holotape) { using func_t = decltype(&PlayerCharacter::PauseHolotape); - REL::Relocation func{ REL::ID(2233208) }; + static REL::Relocation func{ REL::ID(2233208) }; return func(this, a_holotape); } void PlayHolotape(BGSNote* a_holotape) { using func_t = decltype(&PlayerCharacter::PlayHolotape); - REL::Relocation func{ REL::ID(2233207) }; + static REL::Relocation func{ REL::ID(2233207) }; return func(this, a_holotape); } void QueueFastTravel(ObjectRefHandle a_marker, bool a_allowAutoSave) { using func_t = decltype(&PlayerCharacter::QueueFastTravel); - REL::Relocation func{ REL::ID(556824) }; + static REL::Relocation func{ REL::ID(556824) }; return func(this, a_marker, a_allowAutoSave); } void RemoveLastUsedPowerArmor() { using func_t = decltype(&PlayerCharacter::RemoveLastUsedPowerArmor); - REL::Relocation func{ REL::ID(1488486) }; + static REL::Relocation func{ REL::ID(1488486) }; return func(this); } void SelectPerk(TESFormID a_formID, std::int8_t a_rank = 0) { using func_t = decltype(&PlayerCharacter::SelectPerk); - REL::Relocation func{ REL::ID(1397326) }; + static REL::Relocation func{ REL::ID(1397326) }; return func(this, a_formID, a_rank); } void SetEscaping(bool a_flag, bool a_escaped) { using func_t = decltype(&PlayerCharacter::SetEscaping); - REL::Relocation func{ REL::ID(25528) }; + static REL::Relocation func{ REL::ID(25528) }; return func(this, a_flag, a_escaped); } void SetVATSCriticalCount(uint32_t a_critCount) { using func_t = decltype(&PlayerCharacter::SetVATSCriticalCount); - REL::Relocation func{ REL::ID(327338) }; + static REL::Relocation func{ REL::ID(327338) }; return func(this, a_critCount); } void ShowPipboyLight(bool a_show, bool a_skipEffects) { using func_t = decltype(&PlayerCharacter::ShowPipboyLight); - REL::Relocation func{ REL::ID(1304102) }; + static REL::Relocation func{ REL::ID(1304102) }; return func(this, a_show, a_skipEffects); } void SetLastDialogueInput(uint32_t dialogueOption) { using func_t = decltype(&PlayerCharacter::SetLastDialogueInput); - REL::Relocation func{ REL::ID(2233190) }; + static REL::Relocation func{ REL::ID(2233190) }; return func(this, dialogueOption); } void ClearPrison() { using func_t = decltype(&PlayerCharacter::ClearPrison); - REL::Relocation func{ REL::ID(2233196) }; + static REL::Relocation func{ REL::ID(2233196) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/PlayerControls.h b/CommonLibF4/include/RE/Bethesda/PlayerControls.h index 0a74687e..46d30012 100644 --- a/CommonLibF4/include/RE/Bethesda/PlayerControls.h +++ b/CommonLibF4/include/RE/Bethesda/PlayerControls.h @@ -154,21 +154,21 @@ namespace RE static PlayerControls* GetSingleton() { - REL::Relocation singleton{ REL::ID(544871) }; + static REL::Relocation singleton{ REL::ID(544871) }; return *singleton; } bool CanPerformAction(DEFAULT_OBJECT a_action) { using func_t = decltype(&PlayerControls::CanPerformAction); - REL::Relocation func{ REL::ID(565925) }; + static REL::Relocation func{ REL::ID(565925) }; return func(this, a_action); } bool DoAction(DEFAULT_OBJECT a_action, ActionInput::ACTIONPRIORITY a_priority) { using func_t = decltype(&PlayerControls::DoAction); - REL::Relocation func{ REL::ID(818081) }; + static REL::Relocation func{ REL::ID(818081) }; return func(this, a_action, a_priority); } @@ -206,7 +206,7 @@ namespace RE void DoRegisterHandler(PlayerInputHandler* a_handler, bool a_isHeldStateHandler) { using func_t = decltype(&PlayerControls::DoRegisterHandler); - REL::Relocation func{ REL::ID(177801) }; + static REL::Relocation func{ REL::ID(177801) }; return func(this, a_handler, a_isHeldStateHandler); } }; diff --git a/CommonLibF4/include/RE/Bethesda/ProcessLists.h b/CommonLibF4/include/RE/Bethesda/ProcessLists.h index e96713ae..22b20e73 100644 --- a/CommonLibF4/include/RE/Bethesda/ProcessLists.h +++ b/CommonLibF4/include/RE/Bethesda/ProcessLists.h @@ -24,14 +24,14 @@ namespace RE [[nodiscard]] static ProcessLists* GetSingleton() { - REL::Relocation singleton{ REL::ID(2688869) }; + static REL::Relocation singleton{ REL::ID(2688869) }; return *singleton; } [[nodiscard]] bool AreHostileActorsNear(BSScrapArray* a_hostileActorArray) { using func_t = decltype(&ProcessLists::AreHostileActorsNear); - REL::Relocation func{ REL::ID(2234105) }; + static REL::Relocation func{ REL::ID(2234105) }; return func(this, a_hostileActorArray); } @@ -72,14 +72,14 @@ namespace RE [[nodiscard]] bool IsActorTargetingREFinPackage(const TESObjectREFR* a_actor, PTYPE a_type, bool a_onlyHigh) { using func_t = decltype(&ProcessLists::IsActorTargetingREFinPackage); - REL::Relocation func{ REL::ID(2234033) }; + static REL::Relocation func{ REL::ID(2234033) }; return func(this, a_actor, a_type, a_onlyHigh); } [[nodiscard]] std::int16_t RequestHighestDetectionLevelAgainstActor(Actor* a_actor, std::uint32_t& a_LOSCount) { using func_t = decltype(&ProcessLists::RequestHighestDetectionLevelAgainstActor); - REL::Relocation func{ REL::ID(2234111) }; + static REL::Relocation func{ REL::ID(2234111) }; return func(this, a_actor, a_LOSCount); } diff --git a/CommonLibF4/include/RE/Bethesda/SWFToCodeFunctionHandler.h b/CommonLibF4/include/RE/Bethesda/SWFToCodeFunctionHandler.h index b8a4cc31..58ad8709 100644 --- a/CommonLibF4/include/RE/Bethesda/SWFToCodeFunctionHandler.h +++ b/CommonLibF4/include/RE/Bethesda/SWFToCodeFunctionHandler.h @@ -23,14 +23,14 @@ namespace RE void MapCodeMethodToASFunction(const char* a_functionName, std::int32_t a_functionID) { using func_t = decltype(&SWFToCodeFunctionHandler::MapCodeMethodToASFunction); - REL::Relocation func{ REL::ID(2287419) }; + static REL::Relocation func{ REL::ID(2287419) }; return func(this, a_functionName, a_functionID); } void RegisterCodeObject(Scaleform::GFx::Movie& a_movie, Scaleform::GFx::Value& a_menuObj) { using func_t = decltype(&SWFToCodeFunctionHandler::RegisterCodeObject); - REL::Relocation func{ REL::ID(2287415) }; + static REL::Relocation func{ REL::ID(2287415) }; return func(this, a_movie, a_menuObj); } }; diff --git a/CommonLibF4/include/RE/Bethesda/Script.h b/CommonLibF4/include/RE/Bethesda/Script.h index ae059509..fc12b240 100644 --- a/CommonLibF4/include/RE/Bethesda/Script.h +++ b/CommonLibF4/include/RE/Bethesda/Script.h @@ -259,13 +259,13 @@ namespace RE [[nodiscard]] static std::span GetConsoleFunctions() { - REL::Relocation functions{ REL::ID(901511) }; + static REL::Relocation functions{ REL::ID(901511) }; return { *functions }; } [[nodiscard]] static std::span GetScriptFunctions() { - REL::Relocation functions{ REL::ID(75173) }; + static REL::Relocation functions{ REL::ID(75173) }; return { *functions }; } @@ -304,28 +304,28 @@ namespace RE { static_assert((std::is_pointer_v && ...), "arguments must all be pointers"); using func_t = bool(const SCRIPT_PARAMETER*, const char*, std::uint32_t&, TESObjectREFR*, TESObjectREFR*, Script*, ScriptLocals*, ...); - REL::Relocation func{ REL::ID(2204298) }; + static REL::Relocation func{ REL::ID(2204298) }; return func(a_parameters, a_compiledParams, a_offset, a_refObject, a_container, a_script, a_scriptLocals, a_args...); } void CompileAndRun(ScriptCompiler* a_compiler, COMPILER_NAME a_compilerIndex, TESObjectREFR* a_ownerObject) { using func_t = decltype(&Script::CompileAndRun); - REL::Relocation func{ REL::ID(2204287) }; + static REL::Relocation func{ REL::ID(2204287) }; return func(this, a_compiler, a_compilerIndex, a_ownerObject); } static bool GetProcessScripts() { using func_t = decltype(&Script::GetProcessScripts); - REL::Relocation func{ REL::ID(2204310) }; + static REL::Relocation func{ REL::ID(2204310) }; return func(); } static void SetProcessScripts(bool a_processScripts) { using func_t = decltype(&Script::SetProcessScripts); - REL::Relocation func{ REL::ID(2204309) }; + static REL::Relocation func{ REL::ID(2204309) }; return func(a_processScripts); } diff --git a/CommonLibF4/include/RE/Bethesda/SendHUDMessage.h b/CommonLibF4/include/RE/Bethesda/SendHUDMessage.h index 33798b1f..6e96cd38 100644 --- a/CommonLibF4/include/RE/Bethesda/SendHUDMessage.h +++ b/CommonLibF4/include/RE/Bethesda/SendHUDMessage.h @@ -7,28 +7,28 @@ namespace RE inline void PopHUDMode(const HUDModeType& a_hudMode) { using func_t = decltype(&SendHUDMessage::PopHUDMode); - REL::Relocation func{ REL::ID(1495042) }; + static REL::Relocation func{ REL::ID(1495042) }; return func(a_hudMode); } inline void PushHUDMode(const HUDModeType& a_hudMode) { using func_t = decltype(&SendHUDMessage::PushHUDMode); - REL::Relocation func{ REL::ID(1321764) }; + static REL::Relocation func{ REL::ID(1321764) }; return func(a_hudMode); } inline void SetPowerArmorMode(bool a_inPowerArmor) { using func_t = decltype(&SendHUDMessage::SetPowerArmorMode); - REL::Relocation func{ REL::ID(361745) }; + static REL::Relocation func{ REL::ID(361745) }; return func(a_inPowerArmor); } inline void ShowHUDMessage(const char* a_message, const char* a_sound, bool a_throttle, bool a_warning) { using func_t = decltype(&SendHUDMessage::ShowHUDMessage); - REL::Relocation func{ REL::ID(2222440) }; + static REL::Relocation func{ REL::ID(2222440) }; return func(a_message, a_sound, a_throttle, a_warning); } } diff --git a/CommonLibF4/include/RE/Bethesda/Settings.h b/CommonLibF4/include/RE/Bethesda/Settings.h index 009a0551..24575948 100644 --- a/CommonLibF4/include/RE/Bethesda/Settings.h +++ b/CommonLibF4/include/RE/Bethesda/Settings.h @@ -339,13 +339,13 @@ namespace RE [[nodiscard]] static void InitCollection() { using func_t = decltype(&GameSettingCollection::InitCollection); - REL::Relocation func{ REL::ID(2188690) }; + static REL::Relocation func{ REL::ID(2188690) }; return func(); } [[nodiscard]] static GameSettingCollection* GetSingleton() { - REL::Relocation singleton{ REL::ID(2690301) }; + static REL::Relocation singleton{ REL::ID(2690301) }; return *singleton; } @@ -366,7 +366,7 @@ namespace RE [[nodiscard]] static INISettingCollection* GetSingleton() { - REL::Relocation singleton{ REL::ID(2704108) }; + static REL::Relocation singleton{ REL::ID(2704108) }; return *singleton; } @@ -391,7 +391,7 @@ namespace RE [[nodiscard]] static INIPrefSettingCollection* GetSingleton() { - REL::Relocation singleton{ REL::ID(2703234) }; + static REL::Relocation singleton{ REL::ID(2703234) }; return *singleton; } }; diff --git a/CommonLibF4/include/RE/Bethesda/Sky.h b/CommonLibF4/include/RE/Bethesda/Sky.h index 6f49f38d..0557128d 100644 --- a/CommonLibF4/include/RE/Bethesda/Sky.h +++ b/CommonLibF4/include/RE/Bethesda/Sky.h @@ -74,14 +74,14 @@ namespace RE [[nodiscard]] static Sky* GetSingleton() { using func_t = decltype(&Sky::GetSingleton); - REL::Relocation func{ REL::ID(484694) }; + static REL::Relocation func{ REL::ID(484694) }; return func(); } void ForceWeather(TESWeather* a_weather, bool a_override) { using func_t = decltype(&Sky::ForceWeather); - REL::Relocation func{ REL::ID(698558) }; + static REL::Relocation func{ REL::ID(698558) }; return func(this, a_weather, a_override); } @@ -96,7 +96,7 @@ namespace RE void ResetWeather() { using func_t = decltype(&Sky::ResetWeather); - REL::Relocation func{ REL::ID(6511) }; + static REL::Relocation func{ REL::ID(6511) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/SplineUtils.h b/CommonLibF4/include/RE/Bethesda/SplineUtils.h index 7db3151f..768cc5b4 100644 --- a/CommonLibF4/include/RE/Bethesda/SplineUtils.h +++ b/CommonLibF4/include/RE/Bethesda/SplineUtils.h @@ -9,14 +9,14 @@ namespace RE inline void DisconnectSpline(TESObjectREFR& a_spline) { using func_t = decltype(&DisconnectSpline); - REL::Relocation func{ REL::ID(750682) }; + static REL::Relocation func{ REL::ID(750682) }; return func(a_spline); } inline void ConnectSpline(TESObjectREFR* akEndpoint1, int32_t linkType1, TESObjectREFR* akEndpoint2, int32_t linkType2, TESObjectREFR* akWireRef) { using func_t = decltype(&ConnectSpline); - REL::Relocation func{ REL::ID(59311) }; + static REL::Relocation func{ REL::ID(59311) }; return func(akEndpoint1, linkType1, akEndpoint2, linkType2, akWireRef); } } diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h index a21c0993..5394a454 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h @@ -396,7 +396,7 @@ namespace RE [[nodiscard]] static BSTHashMap>& GetAlternateHeadPartListMap() { - REL::Relocation>*> map{ REL::ID(1306546), -0x8 }; + static REL::Relocation>*> map{ REL::ID(1306546), -0x8 }; return *map; } diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h index d1ca1e17..4ecc242e 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h @@ -102,7 +102,7 @@ namespace RE void ApplyMods(BSTSmartPointer& a_dest, const BGSObjectInstanceExtra* a_extra) const { using func_t = decltype(&TESBoundObject::ApplyMods); - REL::Relocation func{ REL::ID(2198325) }; + static REL::Relocation func{ REL::ID(2198325) }; return func(this, a_dest, a_extra); } @@ -630,14 +630,14 @@ namespace RE [[nodiscard]] MELEE_ATTACK_SPEED GetMeleeAttackSpeed() { using func_t = decltype(&TESObjectWEAP::GetMeleeAttackSpeed); - REL::Relocation func{ REL::ID(817670) }; + static REL::Relocation func{ REL::ID(817670) }; return func(this); } [[nodiscard]] static const char* GetMeleeAttackSpeedLabel(MELEE_ATTACK_SPEED a_speed) { using func_t = decltype(&TESObjectWEAP::GetMeleeAttackSpeedLabel); - REL::Relocation func{ REL::ID(178784) }; + static REL::Relocation func{ REL::ID(178784) }; return func(a_speed); } @@ -744,7 +744,7 @@ namespace RE [[nodiscard]] static bool GetReloadsWithAmmoRef(const TESAmmo* a_ammo) { using func_t = decltype(&TESAmmo::GetReloadsWithAmmoRef); - REL::Relocation func{ REL::ID(2197864) }; + static REL::Relocation func{ REL::ID(2197864) }; return func(a_ammo); } @@ -882,7 +882,7 @@ namespace RE bool CollidesWithSmallTransparentLayer() { using func_t = decltype(&BGSProjectile::CollidesWithSmallTransparentLayer); - REL::Relocation func{ REL::ID(2197620) }; + static REL::Relocation func{ REL::ID(2197620) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/TESCamera.h b/CommonLibF4/include/RE/Bethesda/TESCamera.h index 2eea9253..514655e1 100644 --- a/CommonLibF4/include/RE/Bethesda/TESCamera.h +++ b/CommonLibF4/include/RE/Bethesda/TESCamera.h @@ -174,7 +174,7 @@ namespace RE [[nodiscard]] static PlayerCamera* GetSingleton() { - REL::Relocation singleton{ REL::ID(1171980) }; + static REL::Relocation singleton{ REL::ID(1171980) }; return *singleton; } @@ -193,49 +193,49 @@ namespace RE TESCameraState* PopState() { using func_t = decltype(&PlayerCamera::PopState); - REL::Relocation func{ REL::ID(120998) }; + static REL::Relocation func{ REL::ID(120998) }; return func(this); } TESCameraState* PushState(CameraState a_state) { using func_t = decltype(&PlayerCamera::PushState); - REL::Relocation func{ REL::ID(746523) }; + static REL::Relocation func{ REL::ID(746523) }; return func(this, a_state); } void ToggleFreeCameraMode(bool a_freezeTime) { using func_t = decltype(&PlayerCamera::ToggleFreeCameraMode); - REL::Relocation func{ REL::ID(224913) }; + static REL::Relocation func{ REL::ID(224913) }; return func(this, a_freezeTime); } void SetState(TESCameraState* a_newstate) const { using func_t = decltype(&PlayerCamera::SetState); - REL::Relocation func{ REL::ID(858847) }; + static REL::Relocation func{ REL::ID(858847) }; return func(this, a_newstate); } void StartFurnitureMode(TESObjectREFR* a_furniture) { using func_t = decltype(&PlayerCamera::StartFurnitureMode); - REL::Relocation func{ REL::ID(10202) }; + static REL::Relocation func{ REL::ID(10202) }; return func(this, a_furniture); } void StartPipboyMode(bool a_forcePipboyModeCamera) { using func_t = decltype(&PlayerCamera::StartPipboyMode); - REL::Relocation func{ REL::ID(998069) }; + static REL::Relocation func{ REL::ID(998069) }; return func(this, a_forcePipboyModeCamera); } void StopPipboyMode() { using func_t = decltype(&PlayerCamera::StopPipboyMode); - REL::Relocation func{ REL::ID(811954) }; + static REL::Relocation func{ REL::ID(811954) }; return func(this); } diff --git a/CommonLibF4/include/RE/Bethesda/TESCondition.h b/CommonLibF4/include/RE/Bethesda/TESCondition.h index 71472948..890b2371 100644 --- a/CommonLibF4/include/RE/Bethesda/TESCondition.h +++ b/CommonLibF4/include/RE/Bethesda/TESCondition.h @@ -74,14 +74,14 @@ namespace RE [[nodiscard]] float GetComparisonValue() { using func_t = decltype(&TESConditionItem::GetComparisonValue); - REL::Relocation func{ REL::ID(2212007) }; + static REL::Relocation func{ REL::ID(2212007) }; return func(this); } [[nodiscard]] bool IsTrue(TESObjectREFR* a_actionRef, TESObjectREFR* a_targetRef) { using func_t = decltype(&TESConditionItem::IsTrue); - REL::Relocation func{ REL::ID(2212008) }; + static REL::Relocation func{ REL::ID(2212008) }; return func(this, a_actionRef, a_targetRef); } @@ -104,14 +104,14 @@ namespace RE [[nodiscard]] bool IsTrue(TESObjectREFR* a_actionRef, TESObjectREFR* a_targetRef) const { using func_t = decltype(&TESCondition::IsTrue); - REL::Relocation func{ REL::ID(2211989) }; + static REL::Relocation func{ REL::ID(2211989) }; return func(this, a_actionRef, a_targetRef); } [[nodiscard]] bool IsTrueForAllButFunction(ConditionCheckParams& a_paramData, SCRIPT_OUTPUT a_function) const { using func_t = decltype(&TESCondition::IsTrueForAllButFunction); - REL::Relocation func{ REL::ID(1182457) }; + static REL::Relocation func{ REL::ID(1182457) }; return func(this, a_paramData, a_function); } diff --git a/CommonLibF4/include/RE/Bethesda/TESDataHandler.h b/CommonLibF4/include/RE/Bethesda/TESDataHandler.h index c4844b8e..69124245 100644 --- a/CommonLibF4/include/RE/Bethesda/TESDataHandler.h +++ b/CommonLibF4/include/RE/Bethesda/TESDataHandler.h @@ -65,28 +65,28 @@ namespace RE public: [[nodiscard]] static TESDataHandler* GetSingleton() { - REL::Relocation singleton{ REL::ID(2688883) }; + static REL::Relocation singleton{ REL::ID(2688883) }; return *singleton; } [[nodiscard]] bool AddFormToDataHandler(TESForm* a_form) { using func_t = decltype(&TESDataHandler::AddFormToDataHandler); - REL::Relocation func{ REL::ID(2192271) }; + static REL::Relocation func{ REL::ID(2192271) }; return func(this, a_form); } [[nodiscard]] bool CheckModsLoaded(bool a_everModded) { using func_t = decltype(&TESDataHandler::CheckModsLoaded); - REL::Relocation func{ REL::ID(2192323) }; + static REL::Relocation func{ REL::ID(2192323) }; return func(this, a_everModded); } [[nodiscard]] ObjectRefHandle CreateReferenceAtLocation(NEW_REFR_DATA& a_data) { using func_t = decltype(&TESDataHandler::CreateReferenceAtLocation); - REL::Relocation func{ REL::ID(500304) }; + static REL::Relocation func{ REL::ID(500304) }; return func(this, a_data); } @@ -205,7 +205,7 @@ namespace RE bool IsFormIDInuse(TESFormID a_formID) { using func_t = decltype(&TESDataHandler::IsFormIDInuse); - REL::Relocation func{ REL::ID(2192351) }; + static REL::Relocation func{ REL::ID(2192351) }; return func(this, a_formID); } diff --git a/CommonLibF4/include/RE/Bethesda/TESFile.h b/CommonLibF4/include/RE/Bethesda/TESFile.h index 04be93ec..211b2a52 100644 --- a/CommonLibF4/include/RE/Bethesda/TESFile.h +++ b/CommonLibF4/include/RE/Bethesda/TESFile.h @@ -101,14 +101,14 @@ namespace RE [[nodiscard]] bool CloseTES(bool a_forceClose) { using func_t = decltype(&TESFile::CloseTES); - REL::Relocation func{ REL::ID(2192491) }; + static REL::Relocation func{ REL::ID(2192491) }; return func(this, a_forceClose); } [[nodiscard]] bool GetChunkData(void* a_data, std::uint32_t a_maxSize) { using func_t = bool (TESFile::*)(void*, uint32_t); - REL::Relocation func{ REL::ID(2192538) }; + static REL::Relocation func{ REL::ID(2192538) }; return func(this, a_data, a_maxSize); } @@ -131,35 +131,35 @@ namespace RE [[nodiscard]] std::uint32_t GetTESChunk() { using func_t = decltype(&TESFile::GetTESChunk); - REL::Relocation func{ REL::ID(2192536) }; + static REL::Relocation func{ REL::ID(2192536) }; return func(this); } [[nodiscard]] bool NextChunk() { using func_t = decltype(&TESFile::NextChunk); - REL::Relocation func{ REL::ID(2192537) }; + static REL::Relocation func{ REL::ID(2192537) }; return func(this); } [[nodiscard]] bool NextForm(bool a_skipIgnored) { using func_t = decltype(&TESFile::NextForm); - REL::Relocation func{ REL::ID(2192527) }; + static REL::Relocation func{ REL::ID(2192527) }; return func(this, a_skipIgnored); } [[nodiscard]] bool NextGroup() { using func_t = decltype(&TESFile::NextGroup); - REL::Relocation func{ REL::ID(2192522) }; + static REL::Relocation func{ REL::ID(2192522) }; return func(this); } [[nodiscard]] bool OpenTES(char* a_path, const char* a_filename, NiFile::OpenMode a_accessMode, bool a_lock) { using func_t = bool (TESFile::*)(char*, const char*, NiFile::OpenMode, bool); - REL::Relocation func{ REL::ID(2192490) }; + static REL::Relocation func{ REL::ID(2192490) }; return func(this, a_path, a_filename, a_accessMode, a_lock); } diff --git a/CommonLibF4/include/RE/Bethesda/TESForms.h b/CommonLibF4/include/RE/Bethesda/TESForms.h index a948780b..f7746b55 100644 --- a/CommonLibF4/include/RE/Bethesda/TESForms.h +++ b/CommonLibF4/include/RE/Bethesda/TESForms.h @@ -633,7 +633,7 @@ namespace RE std::int32_t operator()(const TESForm* a_arg1, const TESForm* a_arg2) { using func_t = decltype(&FormSortFunc::operator()); - REL::Relocation func{ REL::ID(705530) }; + static REL::Relocation func{ REL::ID(705530) }; return func(this, a_arg1, a_arg2); } }; @@ -716,7 +716,7 @@ namespace RE static void AddCompileIndex(std::uint32_t& a_id, TESFile* a_file) { using func_t = decltype(&TESForm::AddCompileIndex); - REL::Relocation func{ REL::ID(1315637) }; + static REL::Relocation func{ REL::ID(1315637) }; return func(a_id, a_file); } @@ -725,8 +725,8 @@ namespace RE BSTHashMap*, std::reference_wrapper> { - REL::Relocation**> allForms{ REL::ID(2689178) }; - REL::Relocation allFormsMapLock{ REL::ID(2689189) }; + static REL::Relocation**> allForms{ REL::ID(2689178) }; + static REL::Relocation allFormsMapLock{ REL::ID(2689189) }; return { *allForms, *allFormsMapLock }; } @@ -735,8 +735,8 @@ namespace RE BSTHashMap*, std::reference_wrapper> { - REL::Relocation**> allFormsByEditorID{ REL::ID(2689179) }; - REL::Relocation allFormsEditorIDMapLock{ REL::ID(2689190) }; + static REL::Relocation**> allFormsByEditorID{ REL::ID(2689179) }; + static REL::Relocation allFormsEditorIDMapLock{ REL::ID(2689190) }; return { *allFormsByEditorID, *allFormsEditorIDMapLock }; } @@ -748,7 +748,7 @@ namespace RE [[nodiscard]] TESFile* GetFile(std::int32_t a_index = -1) const { using func_t = decltype(&TESForm::GetFile); - REL::Relocation func{ REL::ID(2193103) }; + static REL::Relocation func{ REL::ID(2193103) }; return func(this, a_index); } @@ -792,14 +792,14 @@ namespace RE [[nodiscard]] static std::span GetFormEnumString() { - REL::Relocation functions{ REL::ID(1309967) }; + static REL::Relocation functions{ REL::ID(1309967) }; return { *functions }; } [[nodiscard]] static ENUM_FORM_ID GetFormTypeFromString(const char* a_formTypeString) { using func_t = decltype(&TESForm::GetFormTypeFromString); - REL::Relocation func{ REL::ID(2193108) }; + static REL::Relocation func{ REL::ID(2193108) }; return func(a_formTypeString); } @@ -879,7 +879,7 @@ namespace RE void SetTemporary() { using func_t = decltype(&TESForm::SetTemporary); - REL::Relocation func{ REL::ID(482454) }; + static REL::Relocation func{ REL::ID(482454) }; return func(this); } @@ -952,7 +952,7 @@ namespace RE [[nodiscard]] static auto GetTypedKeywords() -> std::optional, std::to_underlying(KeywordType::kTotal)>> { - REL::Relocation(*)[std::to_underlying(KeywordType::kTotal)]> keywords{ REL::ID(1095775) }; + static REL::Relocation(*)[std::to_underlying(KeywordType::kTotal)]> keywords{ REL::ID(1095775) }; if (*keywords) { return { *keywords }; } else { @@ -1492,63 +1492,63 @@ namespace RE [[nodiscard]] bhkWorld* GetbhkWorld() const { using func_t = decltype(&TESObjectCELL::GetbhkWorld); - REL::Relocation func{ REL::ID(1326073) }; + static REL::Relocation func{ REL::ID(1326073) }; return func(this); } [[nodiscard]] bool GetCantWaitHere() { using func_t = decltype(&TESObjectCELL::GetCantWaitHere); - REL::Relocation func{ REL::ID(2200287) }; + static REL::Relocation func{ REL::ID(2200287) }; return func(this); } [[nodiscard]] std::int32_t GetDataX() { using func_t = decltype(&TESObjectCELL::GetDataX); - REL::Relocation func{ REL::ID(2200213) }; + static REL::Relocation func{ REL::ID(2200213) }; return func(this); } [[nodiscard]] std::int32_t GetDataY() { using func_t = decltype(&TESObjectCELL::GetDataY); - REL::Relocation func{ REL::ID(2200214) }; + static REL::Relocation func{ REL::ID(2200214) }; return func(this); } [[nodiscard]] BGSEncounterZone* GetEncounterZone() const { using func_t = decltype(&TESObjectCELL::GetEncounterZone); - REL::Relocation func{ REL::ID(1414637) }; + static REL::Relocation func{ REL::ID(1414637) }; return func(this); } [[nodiscard]] BGSLocation* GetLocation() const { using func_t = decltype(&TESObjectCELL::GetLocation); - REL::Relocation func{ REL::ID(2200179) }; + static REL::Relocation func{ REL::ID(2200179) }; return func(this); } [[nodiscard]] TESForm* GetOwner() { using func_t = decltype(&TESObjectCELL::GetOwner); - REL::Relocation func{ REL::ID(910422) }; + static REL::Relocation func{ REL::ID(910422) }; return func(this); } [[nodiscard]] TESRegionList* GetRegionList(bool a_createIfMissing) { using func_t = decltype(&TESObjectCELL::GetRegionList); - REL::Relocation func{ REL::ID(2200265) }; + static REL::Relocation func{ REL::ID(2200265) }; return func(this, a_createIfMissing); } [[nodiscard]] NiAVObject* Pick(bhkPickData& pd) { using func_t = decltype(&TESObjectCELL::Pick); - REL::Relocation func{ REL::ID(434717) }; + static REL::Relocation func{ REL::ID(434717) }; return func(this, pd); } @@ -1719,7 +1719,7 @@ namespace RE const char* GetResponseText() { using func_t = decltype(&TESResponse::GetResponseText); - REL::Relocation func{ REL::ID(2208288) }; + static REL::Relocation func{ REL::ID(2208288) }; return func(this); } @@ -1777,21 +1777,21 @@ namespace RE TESTopicInfo* GetParentInfoGroup() { using func_t = decltype(&TESTopicInfo::GetParentInfoGroup); - REL::Relocation func{ REL::ID(2208435) }; + static REL::Relocation func{ REL::ID(2208435) }; return func(this); } CHARISMA_CHALLENGE_DIFFICULTY GetSpeechChallengeLevel() { using func_t = decltype(&TESTopicInfo::GetSpeechChallengeLevel); - REL::Relocation func{ REL::ID(2208441) }; + static REL::Relocation func{ REL::ID(2208441) }; return func(this); } CHARISMA_CHALLENGE_SUCCESS GetSuccessLevel() { using func_t = decltype(&TESTopicInfo::GetSuccessLevel); - REL::Relocation func{ REL::ID(2208444) }; + static REL::Relocation func{ REL::ID(2208444) }; return func(this); } @@ -2032,14 +2032,14 @@ namespace RE void AddScriptAddedForm(TESForm* a_form) { using func_t = decltype(&BGSListForm::AddScriptAddedForm); - REL::Relocation func{ REL::ID(1064874) }; + static REL::Relocation func{ REL::ID(1064874) }; return func(this, a_form); } [[nodiscard]] bool ContainsItem(const TESForm* a_form) { using func_t = decltype(&BGSListForm::ContainsItem); - REL::Relocation func{ REL::ID(688500) }; + static REL::Relocation func{ REL::ID(688500) }; return func(this, a_form); } @@ -2570,14 +2570,14 @@ namespace RE void AddButton(MESSAGEBOX_BUTTON* btn) { using func_t = decltype(&BGSMessage::AddButton); - REL::Relocation func{ REL::ID(236744) }; + static REL::Relocation func{ REL::ID(236744) }; return func(this, btn); } std::uint32_t GetConvertedDescription(BSFixedString& a_result) { using func_t = decltype(&BGSMessage::GetConvertedDescription); - REL::Relocation func{ REL::ID(8331) }; + static REL::Relocation func{ REL::ID(8331) }; return func(this, a_result); } diff --git a/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h b/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h index 0e72d174..aaa67bdf 100644 --- a/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h +++ b/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h @@ -189,28 +189,28 @@ namespace RE bool SetGraphVariableBool(const BSFixedString& a_variable, bool a_var) { using func_t = decltype(&IAnimationGraphManagerHolder::SetGraphVariableBool); - REL::Relocation func{ REL::ID(1437197) }; + static REL::Relocation func{ REL::ID(1437197) }; return func(this, a_variable, a_var); }; bool SetGraphVariableFloat(const BSFixedString& a_variable, float a_var) { using func_t = decltype(&IAnimationGraphManagerHolder::SetGraphVariableFloat); - REL::Relocation func{ REL::ID(27400) }; + static REL::Relocation func{ REL::ID(27400) }; return func(this, a_variable, a_var); }; bool SetGraphVariableInt(const BSFixedString& a_variable, int a_var) { using func_t = decltype(&IAnimationGraphManagerHolder::SetGraphVariableInt); - REL::Relocation func{ REL::ID(732926) }; + static REL::Relocation func{ REL::ID(732926) }; return func(this, a_variable, a_var); }; bool RevertAnimationGraphManager(bool a_performModifyInitialAnimationStateC = true) { using func_t = decltype(&IAnimationGraphManagerHolder::RevertAnimationGraphManager); - REL::Relocation func{ REL::ID(41382) }; + static REL::Relocation func{ REL::ID(41382) }; return func(this, a_performModifyInitialAnimationStateC); } }; @@ -279,7 +279,7 @@ namespace RE BGSObjectInstance* ctor(TESForm* a_object, TBO_InstanceData* a_instanceData) { using func_t = decltype(&BGSObjectInstance::ctor); - REL::Relocation func{ REL::ID(1095748) }; + static REL::Relocation func{ REL::ID(1095748) }; return func(this, a_object, a_instanceData); } }; @@ -345,7 +345,7 @@ namespace RE bool a_alwaysContinue = false) { using func_t = decltype(&BGSInventoryList::FindAndWriteStackDataForItem); - REL::Relocation func{ REL::ID(1354005) }; + static REL::Relocation func{ REL::ID(1354005) }; return func(this, a_object, a_compareFunc, a_writeFunc, a_objCompFn, a_alwaysContinue); } @@ -369,7 +369,7 @@ namespace RE void BuildFromContainer(const TESContainer* a_container) { using func_t = decltype(&BGSInventoryList::BuildFromContainer); - REL::Relocation func{ REL::ID(2194158) }; + static REL::Relocation func{ REL::ID(2194158) }; return func(this, a_container); } @@ -383,7 +383,7 @@ namespace RE void ctor(const TESContainer* a_container, std::uint32_t* a_owner) { using func_t = decltype(&BGSInventoryList::ctor); - REL::Relocation func{ REL::ID(845050) }; + static REL::Relocation func{ REL::ID(845050) }; return func(this, a_container, a_owner); } }; @@ -440,7 +440,7 @@ namespace RE void Dtor() { using func_t = decltype(&BIPOBJECT::Dtor); - REL::Relocation func{ REL::ID(765242) }; + static REL::Relocation func{ REL::ID(765242) }; return func(this); } }; @@ -478,14 +478,14 @@ namespace RE [[nodiscard]] LOCK_LEVEL GetLockLevel(TESObjectREFR* a_owner) { using func_t = decltype(&REFR_LOCK::GetLockLevel); - REL::Relocation func{ REL::ID(782953) }; + static REL::Relocation func{ REL::ID(782953) }; return func(this, a_owner); } void SetLocked(bool a_locked) { using func_t = decltype(&REFR_LOCK::SetLocked); - REL::Relocation func{ REL::ID(157617) }; + static REL::Relocation func{ REL::ID(157617) }; return func(this, a_locked); } @@ -666,28 +666,28 @@ namespace RE bool ActivateRef(TESObjectREFR* a_actionRef, TESBoundObject* a_objectToGet, std::int32_t a_count, bool a_defaultProcessingOnly, bool a_fromScript, bool a_looping) { using func_t = decltype(&TESObjectREFR::ActivateRef); - REL::Relocation func{ REL::ID(753531) }; + static REL::Relocation func{ REL::ID(753531) }; return func(this, a_actionRef, a_objectToGet, a_count, a_defaultProcessingOnly, a_fromScript, a_looping); } void AddInventoryItem(TESBoundObject* a_object, BSTSmartPointer a_extra, std::uint32_t a_count, TESObjectREFR* a_oldContainer, const INSTANCE_FILTER* a_filter, TESObjectREFR* a_overrideRef) { using func_t = decltype(&TESObjectREFR::AddInventoryItem); - REL::Relocation func{ REL::ID(78185) }; + static REL::Relocation func{ REL::ID(78185) }; return func(this, a_object, a_extra, a_count, a_oldContainer, a_filter, a_overrideRef); } void AddKeyword(BGSKeyword* kwd) { using func_t = decltype(&TESObjectREFR::AddKeyword); - REL::Relocation func{ REL::ID(2200860) }; + static REL::Relocation func{ REL::ID(2200860) }; return func(this, kwd); } void AddLockChange() { using func_t = decltype(&TESObjectREFR::AddLockChange); - REL::Relocation func{ REL::ID(1578706) }; + static REL::Relocation func{ REL::ID(1578706) }; return func(this); } @@ -701,7 +701,7 @@ namespace RE bool a_interfaceEffect = false) { using func_t = decltype(&TESObjectREFR::ApplyArtObject); - REL::Relocation func{ REL::ID(357908) }; + static REL::Relocation func{ REL::ID(357908) }; return func(this, a_art, a_time, a_facingRef, a_attachToCamera, a_inheritRotation, a_3D, a_interfaceEffect); } @@ -715,14 +715,14 @@ namespace RE bool a_interfaceEffect = false) { using func_t = decltype(&TESObjectREFR::ApplyEffectShader); - REL::Relocation func{ REL::ID(652173) }; + static REL::Relocation func{ REL::ID(652173) }; return func(this, a_art, a_time, a_facingRef, a_attachToCamera, a_inheritRotation, a_3D, a_interfaceEffect); } void Enable(bool a_resetInventory) { using func_t = decltype(&TESObjectREFR::Enable); - REL::Relocation func{ REL::ID(1396707) }; + static REL::Relocation func{ REL::ID(1396707) }; return func(this, a_resetInventory); } @@ -741,14 +741,14 @@ namespace RE [[nodiscard]] BGSLocation* GetCurrentLocation() const { using func_t = decltype(&TESObjectREFR::GetCurrentLocation); - REL::Relocation func{ REL::ID(2201163) }; + static REL::Relocation func{ REL::ID(2201163) }; return func(this); } [[nodiscard]] const char* GetDisplayFullName() { using func_t = decltype(&TESObjectREFR::GetDisplayFullName); - REL::Relocation func{ REL::ID(2201126) }; + static REL::Relocation func{ REL::ID(2201126) }; return func(this); } @@ -757,7 +757,7 @@ namespace RE [[nodiscard]] TESForm* GetOwner() { using func_t = decltype(&TESObjectREFR::GetOwner); - REL::Relocation func{ REL::ID(1323437) }; + static REL::Relocation func{ REL::ID(1323437) }; return func(this); } @@ -774,161 +774,161 @@ namespace RE [[nodiscard]] std::int64_t GetGoldAmount() { using func_t = decltype(&TESObjectREFR::GetGoldAmount); - REL::Relocation func{ REL::ID(564356) }; + static REL::Relocation func{ REL::ID(564356) }; return func(this); } [[nodiscard]] ObjectRefHandle GetHandle() { using func_t = decltype(&TESObjectREFR::GetHandle); - REL::Relocation func{ REL::ID(2201196) }; + static REL::Relocation func{ REL::ID(2201196) }; return func(this); } [[nodiscard]] bool GetHasOwner() { using func_t = decltype(&TESObjectREFR::GetHasOwner); - REL::Relocation func{ REL::ID(1016277) }; + static REL::Relocation func{ REL::ID(1016277) }; return func(this); } [[nodiscard]] std::uint32_t GetInventoryObjectCount(const TESBoundObject* a_object) { using func_t = decltype(&TESObjectREFR::GetInventoryObjectCount); - REL::Relocation func{ REL::ID(333415) }; + static REL::Relocation func{ REL::ID(333415) }; return func(this, a_object); } [[nodiscard]] TESObjectREFR* GetLinkedRef(BGSKeyword* a_keyword) { using func_t = decltype(&TESObjectREFR::GetLinkedRef); - REL::Relocation func{ REL::ID(897287) }; + static REL::Relocation func{ REL::ID(897287) }; return func(this, a_keyword); } [[nodiscard]] REFR_LOCK* GetLock() { using func_t = decltype(&TESObjectREFR::GetLock); - REL::Relocation func{ REL::ID(930785) }; + static REL::Relocation func{ REL::ID(930785) }; return func(this); } [[nodiscard]] float GetWeightInContainer() { using func_t = decltype(&TESObjectREFR::GetWeightInContainer); - REL::Relocation func{ REL::ID(1377567) }; + static REL::Relocation func{ REL::ID(1377567) }; return func(this); } [[nodiscard]] bool IsAnOwner(Actor* a_testOwner, bool a_useFaction, bool a_requiresOwner) { using func_t = decltype(&TESObjectREFR::IsAnOwner); - REL::Relocation func{ REL::ID(933798) }; + static REL::Relocation func{ REL::ID(933798) }; return func(this, a_testOwner, a_useFaction, a_requiresOwner); } [[nodiscard]] bool IsCrimeToActivate() { using func_t = decltype(&TESObjectREFR::IsCrimeToActivate); - REL::Relocation func{ REL::ID(836011) }; + static REL::Relocation func{ REL::ID(836011) }; return func(this); } [[nodiscard]] bool IsInWater() { using func_t = decltype(&TESObjectREFR::IsInWater); - REL::Relocation func{ REL::ID(315318) }; + static REL::Relocation func{ REL::ID(315318) }; return func(this); } [[nodiscard]] bool IsLeveledCreature() { using func_t = decltype(&TESObjectREFR::IsLeveledCreature); - REL::Relocation func{ REL::ID(2202655) }; + static REL::Relocation func{ REL::ID(2202655) }; return func(this); } void MarkAsDeleted() { using func_t = decltype(&TESObjectREFR::MarkAsDeleted); - REL::Relocation func{ REL::ID(192661) }; + static REL::Relocation func{ REL::ID(192661) }; return func(this); } void MoveRefToNewSpace(TESObjectCELL* a_interior, TESWorldSpace* a_world) { using func_t = decltype(&TESObjectREFR::MoveRefToNewSpace); - REL::Relocation func{ REL::ID(629658) }; + static REL::Relocation func{ REL::ID(629658) }; return func(this, a_interior, a_world); } void RemoveKeyword(BGSKeyword* kwd) { using func_t = decltype(&TESObjectREFR::RemoveKeyword); - REL::Relocation func{ REL::ID(281170) }; + static REL::Relocation func{ REL::ID(281170) }; return func(this, kwd); } void SetAngleOnReference(const NiPoint3& a_point) { using func_t = decltype(&TESObjectREFR::SetAngleOnReference); - REL::Relocation func{ REL::ID(1049748) }; + static REL::Relocation func{ REL::ID(1049748) }; return func(this, a_point); } void SetLinkedRef(Actor* a_actor, BGSKeyword* a_keyword) { using func_t = decltype(&TESObjectREFR::SetLinkedRef); - REL::Relocation func{ REL::ID(192840) }; + static REL::Relocation func{ REL::ID(192840) }; return func(this, a_actor, a_keyword); } void SetLocationOnReference(const NiPoint3& a_point) { using func_t = decltype(&TESObjectREFR::SetLocationOnReference); - REL::Relocation func{ REL::ID(1101832) }; + static REL::Relocation func{ REL::ID(1101832) }; return func(this, a_point); } void SetWantsDelete(bool a_delete) { using func_t = decltype(&TESObjectREFR::SetWantsDelete); - REL::Relocation func{ REL::ID(761346) }; + static REL::Relocation func{ REL::ID(761346) }; return func(this, a_delete); } void RebuildBendableSpline(bool rebuildCollision, NiAVObject* target) { using func_t = decltype(&TESObjectREFR::RebuildBendableSpline); - REL::Relocation func{ REL::ID(340319) }; + static REL::Relocation func{ REL::ID(340319) }; return func(this, rebuildCollision, target); } bool GetItemCount(uint32_t& count, TESForm* item, bool countComponent) { using func_t = decltype(&TESObjectREFR::GetItemCount); - REL::Relocation func{ REL::ID(635042) }; + static REL::Relocation func{ REL::ID(635042) }; return func(this, count, item, countComponent); } void UpdateReference3D() { using func_t = decltype(&TESObjectREFR::UpdateReference3D); - REL::Relocation func{ REL::ID(1568075) }; + static REL::Relocation func{ REL::ID(1568075) }; return func(this); } void GetObjectCenter(NiPoint3& center) { using func_t = decltype(&TESObjectREFR::GetObjectCenter); - REL::Relocation func{ REL::ID(777738) }; + static REL::Relocation func{ REL::ID(777738) }; return func(this, center); } void SetScale(float scale) { using func_t = decltype(&TESObjectREFR::SetScale); - REL::Relocation func{ REL::ID(817930) }; + static REL::Relocation func{ REL::ID(817930) }; return func(this, scale); } diff --git a/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h b/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h index 79777863..8d64fc21 100644 --- a/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h +++ b/CommonLibF4/include/RE/Bethesda/TESWorldSpace.h @@ -117,7 +117,7 @@ namespace RE if (root->worldWater) { return root->worldWater; } else { - REL::Relocation defaultWater{ REL::ID(289864) }; + static REL::Relocation defaultWater{ REL::ID(289864) }; return *defaultWater; } } diff --git a/CommonLibF4/include/RE/Bethesda/TaskQueueInterface.h b/CommonLibF4/include/RE/Bethesda/TaskQueueInterface.h index ddaf1721..5fe5cfb2 100644 --- a/CommonLibF4/include/RE/Bethesda/TaskQueueInterface.h +++ b/CommonLibF4/include/RE/Bethesda/TaskQueueInterface.h @@ -15,49 +15,49 @@ namespace RE public: static TaskQueueInterface* GetSingleton() { - REL::Relocation singleton{ REL::ID(7491) }; + static REL::Relocation singleton{ REL::ID(7491) }; return *singleton; } void QueueClosePipboy() { using func_t = decltype(&TaskQueueInterface::QueueClosePipboy); - REL::Relocation func{ REL::ID(69886) }; + static REL::Relocation func{ REL::ID(69886) }; return func(this); } void QueueRebuildBendableSpline(TESObjectREFR& a_ref, bool a_createPhysics, NiAVObject* a_childNode) { using func_t = decltype(&TaskQueueInterface::QueueRebuildBendableSpline); - REL::Relocation func{ REL::ID(198419) }; + static REL::Relocation func{ REL::ID(198419) }; return func(this, a_ref, a_createPhysics, a_childNode); } void QueueShow1stPerson(bool a_show1stPerson) { using func_t = decltype(&TaskQueueInterface::QueueShow1stPerson); - REL::Relocation func{ REL::ID(994377) }; + static REL::Relocation func{ REL::ID(994377) }; return func(this, a_show1stPerson); } void QueueShowPipboy(DEFAULT_OBJECT a_animType) { using func_t = decltype(&TaskQueueInterface::QueueShowPipboy); - REL::Relocation func{ REL::ID(1133684) }; + static REL::Relocation func{ REL::ID(1133684) }; return func(this, a_animType); } void QueueUpdate3D(TESObjectREFR* a_ref, std::uint32_t a_flags) { using func_t = decltype(&TaskQueueInterface::QueueUpdate3D); - REL::Relocation func{ REL::ID(581890) }; + static REL::Relocation func{ REL::ID(581890) }; return func(this, a_ref, a_flags); } void QueueWeaponFire(TESObjectWEAP* a_weapon, TESObjectREFR* a_refObject, BGSEquipIndex a_equipIndex, TESAmmo* a_ammo) { using func_t = decltype(&TaskQueueInterface::QueueWeaponFire); - REL::Relocation func{ REL::ID(15449) }; + static REL::Relocation func{ REL::ID(15449) }; return func(this, a_weapon, a_refObject, a_equipIndex, a_ammo); } diff --git a/CommonLibF4/include/RE/Bethesda/UI.h b/CommonLibF4/include/RE/Bethesda/UI.h index e97830e3..193cf512 100644 --- a/CommonLibF4/include/RE/Bethesda/UI.h +++ b/CommonLibF4/include/RE/Bethesda/UI.h @@ -56,7 +56,7 @@ namespace RE [[nodiscard]] bool CustomRendererHasQuads(const BSFixedString& a_customRendererName) { using func_t = decltype(&UI::CustomRendererHasQuads); - REL::Relocation func{ REL::ID(1401451) }; + static REL::Relocation func{ REL::ID(1401451) }; return func(this, a_customRendererName); } @@ -68,13 +68,13 @@ namespace RE [[nodiscard]] static BSReadWriteLock& GetMenuMapRWLock() { - REL::Relocation menuMapRWLock{ REL::ID(2707105) }; + static REL::Relocation menuMapRWLock{ REL::ID(2707105) }; return *menuMapRWLock; } [[nodiscard]] static UI* GetSingleton() { - REL::Relocation singleton{ REL::ID(2689028) }; + static REL::Relocation singleton{ REL::ID(2689028) }; return *singleton; } @@ -109,14 +109,14 @@ namespace RE void RefreshCursor() { using func_t = decltype(&UI::RefreshCursor); - REL::Relocation func{ REL::ID(1436639) }; + static REL::Relocation func{ REL::ID(1436639) }; return func(this); } void RegisterMenu(const char* a_menu, Create_t* a_create, StaticUpdate_t* a_staticUpdate = nullptr) { using func_t = decltype(&UI::RegisterMenu); - REL::Relocation func{ REL::ID(1519575) }; + static REL::Relocation func{ REL::ID(1519575) }; return func(this, a_menu, a_create, a_staticUpdate); } @@ -129,7 +129,7 @@ namespace RE void UpdateControllerType() { using func_t = decltype(&UI::UpdateControllerType); - REL::Relocation func{ REL::ID(175796) }; + static REL::Relocation func{ REL::ID(175796) }; return func(this); } @@ -165,7 +165,7 @@ namespace RE inline void UpdateGamepadDependentButtonCodes(bool a_usingGamepad) { using func_t = decltype(&UpdateGamepadDependentButtonCodes); - REL::Relocation func{ REL::ID(190238) }; + static REL::Relocation func{ REL::ID(190238) }; return func(a_usingGamepad); } } diff --git a/CommonLibF4/include/RE/Bethesda/UIMessage.h b/CommonLibF4/include/RE/Bethesda/UIMessage.h index 20e9ce8c..2b44e251 100644 --- a/CommonLibF4/include/RE/Bethesda/UIMessage.h +++ b/CommonLibF4/include/RE/Bethesda/UIMessage.h @@ -80,28 +80,28 @@ namespace RE static void SendUIBoolMessage(const BSFixedString& a_menuName, UI_MESSAGE_TYPE a_type, bool a_value) { using func_t = decltype(&BSUIMessageData::SendUIBoolMessage); - REL::Relocation func{ REL::ID(1388308) }; + static REL::Relocation func{ REL::ID(1388308) }; return func(a_menuName, a_type, a_value); } static void SendUIStringMessage(const BSFixedString& a_menuName, UI_MESSAGE_TYPE a_type, const BSFixedString& a_string) { using func_t = decltype(&BSUIMessageData::SendUIStringMessage); - REL::Relocation func{ REL::ID(1270833) }; + static REL::Relocation func{ REL::ID(1270833) }; return func(a_menuName, a_type, a_string); } static void SendUIPtrMessage(const BSFixedString& a_menuName, UI_MESSAGE_TYPE a_type, void* a_data) { using func_t = decltype(&BSUIMessageData::SendUIPtrMessage); - REL::Relocation func{ REL::ID(1374542) }; + static REL::Relocation func{ REL::ID(1374542) }; return func(a_menuName, a_type, a_data); } static void SendUIStringUIntMessage(const BSFixedString& a_menuName, UI_MESSAGE_TYPE a_type, const BSFixedString& a_fixedString, std::uint32_t a_data) { using func_t = decltype(&BSUIMessageData::SendUIStringUIntMessage); - REL::Relocation func{ REL::ID(99795) }; + static REL::Relocation func{ REL::ID(99795) }; return func(a_menuName, a_type, a_fixedString, a_data); } diff --git a/CommonLibF4/include/RE/Bethesda/UIMessageQueue.h b/CommonLibF4/include/RE/Bethesda/UIMessageQueue.h index cb637ee2..0abbc7d1 100644 --- a/CommonLibF4/include/RE/Bethesda/UIMessageQueue.h +++ b/CommonLibF4/include/RE/Bethesda/UIMessageQueue.h @@ -14,14 +14,14 @@ namespace RE public: [[nodiscard]] static UIMessageQueue* GetSingleton() { - REL::Relocation singleton{ REL::ID(2689091) }; + static REL::Relocation singleton{ REL::ID(2689091) }; return *singleton; } void AddMessage(const BSFixedString& a_menu, UI_MESSAGE_TYPE a_type) { using func_t = decltype(&UIMessageQueue::AddMessage); - REL::Relocation func{ REL::ID(2284929) }; + static REL::Relocation func{ REL::ID(2284929) }; return func(this, a_menu, a_type); } diff --git a/CommonLibF4/include/RE/Bethesda/Utilities.h b/CommonLibF4/include/RE/Bethesda/Utilities.h index ec7ea475..f97f1720 100644 --- a/CommonLibF4/include/RE/Bethesda/Utilities.h +++ b/CommonLibF4/include/RE/Bethesda/Utilities.h @@ -22,14 +22,14 @@ namespace RE float* a_distanceFraction) { using func_t = bool (*)(Actor*, BGSProjectile*, float, const NiPoint3&, const NiPoint3&, NiPoint3*, TESObjectREFR**, float*); - REL::Relocation func{ REL::ID(798616) }; + static REL::Relocation func{ REL::ID(798616) }; return func(a_actor, a_projectile, a_projectileSpeed, a_launchPos, a_targetPos, a_hitPos, a_collidee, a_distanceFraction); } inline bool CalculateProjectileLOS(Actor* a_actor, BGSProjectile* a_projectile, bhkPickData& a_pickData) { using func_t = bool (*)(Actor*, BGSProjectile*, bhkPickData&); - REL::Relocation func{ REL::ID(55339) }; + static REL::Relocation func{ REL::ID(55339) }; return func(a_actor, a_projectile, a_pickData); } @@ -42,7 +42,7 @@ namespace RE NiPoint3& a_trajectoryPos) { using func_t = decltype(&CalculateProjectileTrajectory); - REL::Relocation func{ REL::ID(1575156) }; + static REL::Relocation func{ REL::ID(1575156) }; return func(a_projectilePos, a_projectileVelocity, a_projectileGravity, a_targetPos, a_heading, a_trajectoryPos); } @@ -54,7 +54,7 @@ namespace RE inline bool WillEventChangeState(const TESObjectREFR& a_ref, const BSFixedString& a_evn) { using func_t = decltype(&WillEventChangeState); - REL::Relocation func{ REL::ID(35074) }; + static REL::Relocation func{ REL::ID(35074) }; return func(a_ref, a_evn); } } @@ -75,21 +75,21 @@ namespace RE inline bool GetActiveSyncInfo(const IAnimationGraphManagerHolder* a_graphHolder, ActiveSyncInfo& a_infoOut) { using func_t = decltype(&GetActiveSyncInfo); - REL::Relocation func{ REL::ID(1349978) }; + static REL::Relocation func{ REL::ID(1349978) }; return func(a_graphHolder, a_infoOut); } inline bool InitializeActorInstant(Actor& a_actor, bool a_update3D) { using func_t = decltype(&InitializeActorInstant); - REL::Relocation func{ REL::ID(672857) }; + static REL::Relocation func{ REL::ID(672857) }; return func(a_actor, a_update3D); } inline bool IsActiveGraphInTransition(const TESObjectREFR* a_refr) { using func_t = decltype(&IsActiveGraphInTransition); - REL::Relocation func{ REL::ID(839650) }; + static REL::Relocation func{ REL::ID(839650) }; return func(a_refr); } }; @@ -99,7 +99,7 @@ namespace RE inline void RemoveGrenadeTrajectory() { using func_t = decltype(&RemoveGrenadeTrajectory); - REL::Relocation func{ REL::ID(672186) }; + static REL::Relocation func{ REL::ID(672186) }; return func(); } } diff --git a/CommonLibF4/include/RE/Bethesda/VATS.h b/CommonLibF4/include/RE/Bethesda/VATS.h index 7e3dbf7d..a8f907de 100644 --- a/CommonLibF4/include/RE/Bethesda/VATS.h +++ b/CommonLibF4/include/RE/Bethesda/VATS.h @@ -48,7 +48,7 @@ namespace RE [[nodiscard]] static VATS* GetSingleton() { - REL::Relocation singleton{ REL::ID(570121) }; + static REL::Relocation singleton{ REL::ID(570121) }; return *singleton; } diff --git a/CommonLibF4/include/RE/Bethesda/Workshop.h b/CommonLibF4/include/RE/Bethesda/Workshop.h index 5c2fc3e0..01946594 100644 --- a/CommonLibF4/include/RE/Bethesda/Workshop.h +++ b/CommonLibF4/include/RE/Bethesda/Workshop.h @@ -115,7 +115,7 @@ namespace RE void Set(TESObjectREFR& a_refr) { using func_t = decltype(&PlacementItemData::Set); - REL::Relocation func{ REL::ID(1460935) }; + static REL::Relocation func{ REL::ID(1460935) }; return func(this, a_refr); } @@ -168,7 +168,7 @@ namespace RE bool FindAndSetSelectedNode(std::uint16_t a_row, std::uint32_t a_crc, std::uint16_t& a_outRow) { using func_t = decltype(&WorkshopMenuNode::FindAndSetSelectedNode); - REL::Relocation func{ REL::ID(1309368) }; + static REL::Relocation func{ REL::ID(1309368) }; return func(this, a_row, a_crc, a_outRow); } @@ -200,147 +200,147 @@ namespace RE [[nodiscard]] inline TESObjectREFR* FindNearestValidWorkshop(const TESObjectREFR& a_refr) { using func_t = decltype(&Workshop::FindNearestValidWorkshop); - REL::Relocation func{ REL::ID(2194970) }; + static REL::Relocation func{ REL::ID(2194970) }; return func(a_refr); } [[nodiscard]] inline bool FreeBuild() { using func_t = decltype(&Workshop::FreeBuild); - REL::Relocation func{ REL::ID(2194924) }; + static REL::Relocation func{ REL::ID(2194924) }; return func(); } [[nodiscard]] inline WorkshopMenuNode* GetSelectedWorkshopMenuNode(std::uint32_t a_row, std::uint32_t& a_column) { using func_t = decltype(&Workshop::GetSelectedWorkshopMenuNode); - REL::Relocation func{ REL::ID(2195024) }; + static REL::Relocation func{ REL::ID(2195024) }; return func(a_row, a_column); } inline void InitializePlacementReference(const ContextData& a_context, TESBoundObject& a_object) { using func_t = decltype(&Workshop::InitializePlacementReference); - REL::Relocation func{ REL::ID(1577199) }; + static REL::Relocation func{ REL::ID(1577199) }; return func(a_context, a_object); } [[nodiscard]] inline bool IsLocationWithinBuildableArea(const TESObjectREFR& a_workshop, const NiPoint3& a_location) { using func_t = decltype(&Workshop::IsLocationWithinBuildableArea); - REL::Relocation func{ REL::ID(990965) }; + static REL::Relocation func{ REL::ID(990965) }; return func(a_workshop, a_location); } inline bool PlaceCurrentReference(const ContextData& a_context) { using func_t = decltype(&Workshop::PlaceCurrentReference); - REL::Relocation func{ REL::ID(1058211) }; + static REL::Relocation func{ REL::ID(1058211) }; return func(a_context); } inline void RegisterForItemDestroyed(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::RegisterForItemDestroyed); - REL::Relocation func{ REL::ID(1367004) }; + static REL::Relocation func{ REL::ID(1367004) }; return func(a_sink); } inline void RegisterForItemMoved(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::RegisterForItemMoved); - REL::Relocation func{ REL::ID(835323) }; + static REL::Relocation func{ REL::ID(835323) }; return func(a_sink); } inline void RegisterForItemPlaced(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::RegisterForItemPlaced); - REL::Relocation func{ REL::ID(849008) }; + static REL::Relocation func{ REL::ID(849008) }; return func(a_sink); } inline void RegisterForWorkshopModeEvent(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::RegisterForWorkshopModeEvent); - REL::Relocation func{ REL::ID(275798) }; + static REL::Relocation func{ REL::ID(275798) }; return func(a_sink); } inline void RequestExitWorkshop(bool a_allowReEntry) { using func_t = decltype(&Workshop::RequestExitWorkshop); - REL::Relocation func{ REL::ID(209891) }; + static REL::Relocation func{ REL::ID(209891) }; return func(a_allowReEntry); } inline void ScrapReference(const ContextData& a_context, BSPointerHandleSmartPointer>& a_scrapRef, BSTArray>* a_rewards) { using func_t = decltype(&Workshop::ScrapReference); - REL::Relocation func{ REL::ID(636327) }; + static REL::Relocation func{ REL::ID(636327) }; return func(a_context, a_scrapRef, a_rewards); } inline void SetSelectedEditItem(ObjectRefHandle a_refr) { using func_t = decltype(&Workshop::SetSelectedEditItem); - REL::Relocation func{ REL::ID(2562) }; + static REL::Relocation func{ REL::ID(2562) }; return func(a_refr); } inline void StartWorkshop(TESObjectREFR* a_workshopRef) { using func_t = decltype(&Workshop::StartWorkshop); - REL::Relocation func{ REL::ID(171771) }; + static REL::Relocation func{ REL::ID(171771) }; return func(a_workshopRef); } inline void ToggleEditMode(const ContextData& a_context) { using func_t = decltype(&Workshop::ToggleEditMode); - REL::Relocation func{ REL::ID(1243386) }; + static REL::Relocation func{ REL::ID(1243386) }; return func(a_context); } inline void UnregisterForItemDestroyed(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::UnregisterForItemDestroyed); - REL::Relocation func{ REL::ID(1101379) }; + static REL::Relocation func{ REL::ID(1101379) }; return func(a_sink); } inline void UnregisterForItemMoved(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::UnregisterForItemMoved); - REL::Relocation func{ REL::ID(569432) }; + static REL::Relocation func{ REL::ID(569432) }; return func(a_sink); } inline void UnregisterForItemPlaced(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::UnregisterForItemPlaced); - REL::Relocation func{ REL::ID(583255) }; + static REL::Relocation func{ REL::ID(583255) }; return func(a_sink); } inline void UnregisterForWorkshopModeEvent(BSTEventSink* a_sink) { using func_t = decltype(&Workshop::UnregisterForWorkshopModeEvent); - REL::Relocation func{ REL::ID(9236) }; + static REL::Relocation func{ REL::ID(9236) }; return func(a_sink); } inline void UpdateActiveEdit(const ContextData& a_context, bool a_multiselect = false) { using func_t = decltype(&Workshop::UpdateActiveEdit); - REL::Relocation func{ REL::ID(69261) }; + static REL::Relocation func{ REL::ID(69261) }; return func(a_context, a_multiselect); } [[nodiscard]] inline bool WorkshopCanShowRecipe(BGSConstructibleObject* a_recipe, BGSKeyword* a_filter) { using func_t = decltype(&Workshop::WorkshopCanShowRecipe); - REL::Relocation func{ REL::ID(239190) }; + static REL::Relocation func{ REL::ID(239190) }; return func(a_recipe, a_filter); } diff --git a/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h b/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h index 0c930b15..cb9b0e76 100644 --- a/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h +++ b/CommonLibF4/include/RE/Bethesda/bhkCharacterController.h @@ -117,42 +117,42 @@ namespace RE void CopyMembers(bhkNPCollisionObject* from, NiCloningProcess& cp) { using func_t = decltype(&bhkNPCollisionObject::CopyMembers); - REL::Relocation func{ REL::ID(1558409) }; + static REL::Relocation func{ REL::ID(1558409) }; func(this, from, cp); } static bhkNPCollisionObject* Getbhk(bhkWorld* world, hknpBodyId& bodyId) { using func_t = decltype(&bhkNPCollisionObject::Getbhk); - REL::Relocation func{ REL::ID(730034) }; + static REL::Relocation func{ REL::ID(730034) }; return func(world, bodyId); } hknpShape* GetShape() { using func_t = decltype(&bhkNPCollisionObject::GetShape); - REL::Relocation func{ REL::ID(315427) }; + static REL::Relocation func{ REL::ID(315427) }; return func(this); } bool GetTransform(hkTransformf& transform) { using func_t = decltype(&bhkNPCollisionObject::GetTransform); - REL::Relocation func{ REL::ID(1508189) }; + static REL::Relocation func{ REL::ID(1508189) }; return func(this, transform); } void SetMotionType(hknpMotionPropertiesId::Preset type) { using func_t = decltype(&bhkNPCollisionObject::SetMotionType); - REL::Relocation func{ REL::ID(200912) }; + static REL::Relocation func{ REL::ID(200912) }; return func(this, type); } bool SetTransform(hkTransformf& transform) { using func_t = decltype(&bhkNPCollisionObject::SetTransform); - REL::Relocation func{ REL::ID(178085) }; + static REL::Relocation func{ REL::ID(178085) }; return func(this, transform); } diff --git a/CommonLibF4/include/RE/Bethesda/bhkPickData.h b/CommonLibF4/include/RE/Bethesda/bhkPickData.h index ef070831..9ffbb487 100644 --- a/CommonLibF4/include/RE/Bethesda/bhkPickData.h +++ b/CommonLibF4/include/RE/Bethesda/bhkPickData.h @@ -14,7 +14,7 @@ namespace RE bhkPickData() { typedef bhkPickData* func_t(bhkPickData*); - REL::Relocation func{ REL::ID(526783) }; + static REL::Relocation func{ REL::ID(526783) }; func(this); } @@ -23,63 +23,63 @@ namespace RE void SetStartEnd(const NiPoint3& start, const NiPoint3& end) { using func_t = decltype(&bhkPickData::SetStartEnd); - REL::Relocation func{ REL::ID(747470) }; + static REL::Relocation func{ REL::ID(747470) }; return func(this, start, end); } void Reset() { using func_t = decltype(&bhkPickData::Reset); - REL::Relocation func{ REL::ID(438299) }; + static REL::Relocation func{ REL::ID(438299) }; return func(this); } bool HasHit() { using func_t = decltype(&bhkPickData::HasHit); - REL::Relocation func{ REL::ID(1181584) }; + static REL::Relocation func{ REL::ID(1181584) }; return func(this); } float GetHitFraction() { using func_t = decltype(&bhkPickData::GetHitFraction); - REL::Relocation func{ REL::ID(476687) }; + static REL::Relocation func{ REL::ID(476687) }; return func(this); } int32_t GetAllCollectorRayHitSize() { using func_t = decltype(&bhkPickData::GetAllCollectorRayHitSize); - REL::Relocation func{ REL::ID(1288513) }; + static REL::Relocation func{ REL::ID(1288513) }; return func(this); } bool GetAllCollectorRayHitAt(uint32_t i, hknpCollisionResult& res) { using func_t = decltype(&bhkPickData::GetAllCollectorRayHitAt); - REL::Relocation func{ REL::ID(583997) }; + static REL::Relocation func{ REL::ID(583997) }; return func(this, i, res); } void SortAllCollectorHits() { using func_t = decltype(&bhkPickData::SortAllCollectorHits); - REL::Relocation func{ REL::ID(1274842) }; + static REL::Relocation func{ REL::ID(1274842) }; return func(this); } NiAVObject* GetNiAVObject() { using func_t = decltype(&bhkPickData::GetNiAVObject); - REL::Relocation func{ REL::ID(863406) }; + static REL::Relocation func{ REL::ID(863406) }; return func(this); } hknpBody* GetBody() { using func_t = decltype(&bhkPickData::GetBody); - REL::Relocation func{ REL::ID(1223055) }; + static REL::Relocation func{ REL::ID(1223055) }; return func(this); } diff --git a/CommonLibF4/include/RE/Havok/hkLifoAllocator.h b/CommonLibF4/include/RE/Havok/hkLifoAllocator.h index e3df6e41..2e7e50a9 100644 --- a/CommonLibF4/include/RE/Havok/hkLifoAllocator.h +++ b/CommonLibF4/include/RE/Havok/hkLifoAllocator.h @@ -19,35 +19,35 @@ namespace RE void* BlockAlloc(std::int32_t a_numBytesIn) override // 01 { using func_t = decltype(&hkLifoAllocator::BlockAlloc); - REL::Relocation func{ REL::ID(605837) }; + static REL::Relocation func{ REL::ID(605837) }; return func(this, a_numBytesIn); } void BlockFree(void* a_ptr, std::int32_t a_numBytesIn) override // 02 { using func_t = decltype(&hkLifoAllocator::BlockFree); - REL::Relocation func{ REL::ID(778687) }; + static REL::Relocation func{ REL::ID(778687) }; return func(this, a_ptr, a_numBytesIn); } void* BufAlloc(std::int32_t& a_reqNumBytesInOut) override // 03 { using func_t = decltype(&hkLifoAllocator::BufAlloc); - REL::Relocation func{ REL::ID(951267) }; + static REL::Relocation func{ REL::ID(951267) }; return func(this, a_reqNumBytesInOut); } void BufFree(void* a_ptr, std::int32_t a_numBytes) override // 04 { using func_t = decltype(&hkLifoAllocator::BufFree); - REL::Relocation func{ REL::ID(1123850) }; + static REL::Relocation func{ REL::ID(1123850) }; return func(this, a_ptr, a_numBytes); } void* BufRealloc(void* a_old, std::int32_t a_oldNumBytes, std::int32_t& a_reqNumBytesInOut) override // 05 { using func_t = decltype(&hkLifoAllocator::BufRealloc); - REL::Relocation func{ REL::ID(1296646) }; + static REL::Relocation func{ REL::ID(1296646) }; return func(this, a_old, a_oldNumBytes, a_reqNumBytesInOut); } @@ -63,14 +63,14 @@ namespace RE hkMemoryAllocator* a_internalAllocator) { using func_t = decltype(&hkLifoAllocator::Init); - REL::Relocation func{ REL::ID(1417289) }; + static REL::Relocation func{ REL::ID(1417289) }; return func(this, a_slabAllocator, a_largeAllocator, a_internalAllocator); } void Quit(hkMemoryAllocator** a_allocators) { using func_t = decltype(&hkLifoAllocator::Quit); - REL::Relocation func{ REL::ID(1058127) }; + static REL::Relocation func{ REL::ID(1058127) }; return func(this, a_allocators); } diff --git a/CommonLibF4/include/RE/Havok/hkMemoryRouter.h b/CommonLibF4/include/RE/Havok/hkMemoryRouter.h index 17236dcc..dfc2f314 100644 --- a/CommonLibF4/include/RE/Havok/hkMemoryRouter.h +++ b/CommonLibF4/include/RE/Havok/hkMemoryRouter.h @@ -19,13 +19,13 @@ namespace RE [[nodiscard]] static hkMemoryRouter* GetInstancePtr() { - REL::Relocation slot{ REL::ID(878080) }; + static REL::Relocation slot{ REL::ID(878080) }; return static_cast(REX::W32::TlsGetValue(*slot)); } static void ReplaceInstance(hkMemoryRouter* a_router) { - REL::Relocation slot{ REL::ID(878080) }; + static REL::Relocation slot{ REL::ID(878080) }; REX::W32::TlsSetValue(*slot, a_router); } diff --git a/CommonLibF4/include/RE/Havok/hknpClosestHitCollector.h b/CommonLibF4/include/RE/Havok/hknpClosestHitCollector.h index c64f5399..61084de7 100644 --- a/CommonLibF4/include/RE/Havok/hknpClosestHitCollector.h +++ b/CommonLibF4/include/RE/Havok/hknpClosestHitCollector.h @@ -16,7 +16,7 @@ namespace RE hknpClosestHitCollector() { typedef hknpClosestHitCollector* func_t(hknpClosestHitCollector*); - REL::Relocation func{ REL::ID(951692), 0x10 }; + static REL::Relocation func{ REL::ID(951692), 0x10 }; func(this); } diff --git a/CommonLibF4/include/RE/NetImmerse/NiAlphaProperty.h b/CommonLibF4/include/RE/NetImmerse/NiAlphaProperty.h index dffb75c2..e06184d5 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiAlphaProperty.h +++ b/CommonLibF4/include/RE/NetImmerse/NiAlphaProperty.h @@ -60,35 +60,35 @@ namespace RE void SetDestBlendMode(AlphaFunction f) { using func_t = decltype(&NiAlphaProperty::SetDestBlendMode); - REL::Relocation func{ REL::ID(725249) }; + static REL::Relocation func{ REL::ID(725249) }; return func(this, f); } void SetSrcBlendMode(AlphaFunction f) { using func_t = decltype(&NiAlphaProperty::SetSrcBlendMode); - REL::Relocation func{ REL::ID(976961) }; + static REL::Relocation func{ REL::ID(976961) }; return func(this, f); } void SetTestMode(TestFunction f) { using func_t = decltype(&NiAlphaProperty::SetTestMode); - REL::Relocation func{ REL::ID(976961), 0x20 }; + static REL::Relocation func{ REL::ID(976961), 0x20 }; return func(this, f); } void SetAlphaBlending(bool b) { using func_t = decltype(&NiAlphaProperty::SetAlphaBlending); - REL::Relocation func{ REL::ID(645586) }; + static REL::Relocation func{ REL::ID(645586) }; return func(this, b); } void SetAlphaTesting(bool b) { using func_t = decltype(&NiAlphaProperty::SetAlphaTesting); - REL::Relocation func{ REL::ID(645586), 0x20 }; + static REL::Relocation func{ REL::ID(645586), 0x20 }; return func(this, b); } diff --git a/CommonLibF4/include/RE/NetImmerse/NiController.h b/CommonLibF4/include/RE/NetImmerse/NiController.h index 2591342b..da9758ff 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiController.h +++ b/CommonLibF4/include/RE/NetImmerse/NiController.h @@ -25,14 +25,14 @@ namespace RE [[nodiscard]] static NiControllerManager* GetNiControllerManager(const NiObjectNET* a_object) { using func_t = decltype(&NiControllerManager::GetNiControllerManager); - REL::Relocation func{ REL::ID(1013515) }; + static REL::Relocation func{ REL::ID(1013515) }; return func(a_object); } [[nodiscard]] NiControllerSequence* GetSequenceByName(const BSFixedString& a_name) { using func_t = decltype(&NiControllerManager::GetSequenceByName); - REL::Relocation func{ REL::ID(846648) }; + static REL::Relocation func{ REL::ID(846648) }; return func(this, a_name); } @@ -77,7 +77,7 @@ namespace RE bool Activate(std::uint8_t a_priority, bool a_startOver, float a_weight, float a_easeInTime, NiControllerSequence* a_timeSyncSeq, bool a_transition) { using func_t = decltype(&NiControllerSequence::Activate); - REL::Relocation func{ REL::ID(829033) }; + static REL::Relocation func{ REL::ID(829033) }; return func(this, a_priority, a_startOver, a_weight, a_easeInTime, a_timeSyncSeq, a_transition); } diff --git a/CommonLibF4/include/RE/NetImmerse/NiNode.h b/CommonLibF4/include/RE/NetImmerse/NiNode.h index 74ed08eb..427b406e 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiNode.h +++ b/CommonLibF4/include/RE/NetImmerse/NiNode.h @@ -24,7 +24,7 @@ namespace RE children(a_numChildren) { stl::emplace_vtable(this); - REL::Relocation childrenVTable{ REL::ID(390064) }; + static REL::Relocation childrenVTable{ REL::ID(390064) }; reinterpret_cast(children) = childrenVTable.address(); } diff --git a/CommonLibF4/include/RE/NetImmerse/NiRTTI.h b/CommonLibF4/include/RE/NetImmerse/NiRTTI.h index 0581281c..781e0f6a 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiRTTI.h +++ b/CommonLibF4/include/RE/NetImmerse/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/CommonLibF4/include/RE/NetImmerse/NiRefObject.h b/CommonLibF4/include/RE/NetImmerse/NiRefObject.h index 54048230..c4f9c2d7 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiRefObject.h +++ b/CommonLibF4/include/RE/NetImmerse/NiRefObject.h @@ -13,14 +13,14 @@ namespace RE NiRefObject() { stl::emplace_vtable(this); - REL::Relocation objects{ REL::ID(1161724) }; + static REL::Relocation objects{ REL::ID(1161724) }; stl::atomic_ref myObjects{ *objects }; ++myObjects; } virtual ~NiRefObject() // 00 { - REL::Relocation objects{ REL::ID(1161724) }; + static REL::Relocation objects{ REL::ID(1161724) }; stl::atomic_ref myObjects{ *objects }; --myObjects; } diff --git a/CommonLibF4/include/RE/NetImmerse/NiTCollection.h b/CommonLibF4/include/RE/NetImmerse/NiTCollection.h index f478a70f..72ca9ffb 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiTCollection.h +++ b/CommonLibF4/include/RE/NetImmerse/NiTCollection.h @@ -5,14 +5,14 @@ namespace RE inline void* NiMalloc(std::size_t a_num) { using func_t = decltype(&NiMalloc); - REL::Relocation func{ REL::ID(974443) }; + static REL::Relocation func{ REL::ID(974443) }; return func(a_num); } inline void NiFree(void* a_ptr) { using func_t = decltype(&NiFree); - REL::Relocation func{ REL::ID(242362) }; + static REL::Relocation func{ REL::ID(242362) }; return func(a_ptr); } diff --git a/CommonLibF4/include/RE/NetImmerse/NiTexture.h b/CommonLibF4/include/RE/NetImmerse/NiTexture.h index 9a06fd55..4acd11e4 100644 --- a/CommonLibF4/include/RE/NetImmerse/NiTexture.h +++ b/CommonLibF4/include/RE/NetImmerse/NiTexture.h @@ -36,7 +36,7 @@ namespace RE static void SetAllowDegrade(bool a_allow) { using func_t = decltype(&NiTexture::SetAllowDegrade); - REL::Relocation func{ REL::ID(948181) }; + static REL::Relocation func{ REL::ID(948181) }; return func(a_allow); } diff --git a/CommonLibF4/include/RE/Scaleform/GFx/GFx_ASString.h b/CommonLibF4/include/RE/Scaleform/GFx/GFx_ASString.h index 7b6fa39d..f392130e 100644 --- a/CommonLibF4/include/RE/Scaleform/GFx/GFx_ASString.h +++ b/CommonLibF4/include/RE/Scaleform/GFx/GFx_ASString.h @@ -13,7 +13,7 @@ namespace RE::Scaleform::GFx [[nodiscard]] ASStringNode* CreateStringNode(const char* a_str) { using func_t = decltype(&ASStringManager::CreateStringNode); - REL::Relocation func{ REL::ID(419974) }; + static REL::Relocation func{ REL::ID(419974) }; return func(this, a_str); } diff --git a/CommonLibF4/include/RE/Scaleform/GFx/GFx_Loader.h b/CommonLibF4/include/RE/Scaleform/GFx/GFx_Loader.h index 5c541c79..1e8e4ca1 100644 --- a/CommonLibF4/include/RE/Scaleform/GFx/GFx_Loader.h +++ b/CommonLibF4/include/RE/Scaleform/GFx/GFx_Loader.h @@ -229,7 +229,7 @@ namespace RE::Scaleform::GFx [[nodiscard]] MovieDef* CreateMovie(const char* a_filename, Flags a_loadConstants = LoadConstants::kAll, std::size_t a_memoryArena = 0) { using func_t = decltype(&Loader::CreateMovie); - REL::Relocation func{ REL::ID(912291) }; + static REL::Relocation func{ REL::ID(912291) }; return func(this, a_filename, a_loadConstants, a_memoryArena); } diff --git a/CommonLibF4/include/RE/Scaleform/GFx/GFx_Player.h b/CommonLibF4/include/RE/Scaleform/GFx/GFx_Player.h index a2e59859..8ce27e41 100644 --- a/CommonLibF4/include/RE/Scaleform/GFx/GFx_Player.h +++ b/CommonLibF4/include/RE/Scaleform/GFx/GFx_Player.h @@ -544,77 +544,77 @@ namespace RE::Scaleform::GFx void ObjectAddRef(Value* a_val, void* a_obj) { using func_t = decltype(&ObjectInterface::ObjectRelease); - REL::Relocation func{ REL::ID(2286228) }; + static REL::Relocation func{ REL::ID(2286228) }; return func(this, a_val, a_obj); } void ObjectRelease(Value* a_val, void* a_obj) { using func_t = decltype(&ObjectInterface::ObjectRelease); - REL::Relocation func{ REL::ID(2286229) }; + static REL::Relocation func{ REL::ID(2286229) }; return func(this, a_val, a_obj); } bool HasMember(void* a_data, const char* a_name, bool a_isdobj) const { using func_t = decltype(&ObjectInterface::HasMember); - REL::Relocation func{ REL::ID(788691) }; + static REL::Relocation func{ REL::ID(788691) }; return func(this, a_data, a_name, a_isdobj); } std::uint32_t GetArraySize(void* a_data) const { using func_t = decltype(&ObjectInterface::GetArraySize); - REL::Relocation func{ REL::ID(2285791) }; + static REL::Relocation func{ REL::ID(2285791) }; return func(this, a_data); } bool GetMember(void* a_data, const char* a_name, Value* a_val, bool a_isdobj) const { using func_t = decltype(&ObjectInterface::GetMember); - REL::Relocation func{ REL::ID(2285936) }; + static REL::Relocation func{ REL::ID(2285936) }; return func(this, a_data, a_name, a_val, a_isdobj); } bool SetMember(void* a_data, const char* a_name, const Value& a_value, bool a_isdobj) { using func_t = decltype(&ObjectInterface::SetMember); - REL::Relocation func{ REL::ID(2286589) }; + static REL::Relocation func{ REL::ID(2286589) }; return func(this, a_data, a_name, a_value, a_isdobj); } bool Invoke(void* a_data, Value* a_result, const char* a_name, const Value* a_args, std::size_t a_numArgs, bool a_isdobj) { using func_t = decltype(&ObjectInterface::Invoke); - REL::Relocation func{ REL::ID(2286101) }; + static REL::Relocation func{ REL::ID(2286101) }; return func(this, a_data, a_result, a_name, a_args, a_numArgs, a_isdobj); } bool PushBack(void* a_data, const Value& a_value) { using func_t = decltype(&ObjectInterface::PushBack); - REL::Relocation func{ REL::ID(2286424) }; + static REL::Relocation func{ REL::ID(2286424) }; return func(this, a_data, a_value); } bool RemoveElements(void* a_data, std::uint32_t a_idx, std::int32_t a_count) { using func_t = decltype(&ObjectInterface::RemoveElements); - REL::Relocation func{ REL::ID(2286475) }; + static REL::Relocation func{ REL::ID(2286475) }; return func(this, a_data, a_idx, a_count); } void VisitMembers(void* a_data, ObjVisitor* a_visitor, bool a_isDObj) const { using func_t = decltype(&ObjectInterface::VisitMembers); - REL::Relocation func{ REL::ID(2286786) }; + static REL::Relocation func{ REL::ID(2286786) }; return func(this, a_data, a_visitor, a_isDObj); } bool GetDisplayInfo(void* a_data, DisplayInfo* a_info) const { using func_t = decltype(&ObjectInterface::GetDisplayInfo); - REL::Relocation func{ REL::ID(2285873) }; + static REL::Relocation func{ REL::ID(2285873) }; return func(this, a_data, a_info); } @@ -1246,7 +1246,7 @@ namespace RE::Scaleform::GFx void Release() { using func_t = decltype(&Movie::Release); - REL::Relocation func{ REL::ID(2287230) }; + static REL::Relocation func{ REL::ID(2287230) }; return func(this); } diff --git a/CommonLibF4/include/RE/Scaleform/Kernel/SF_Memory.h b/CommonLibF4/include/RE/Scaleform/Kernel/SF_Memory.h index c6e9d1ac..9ae76f5e 100644 --- a/CommonLibF4/include/RE/Scaleform/Kernel/SF_Memory.h +++ b/CommonLibF4/include/RE/Scaleform/Kernel/SF_Memory.h @@ -11,13 +11,13 @@ namespace RE::Scaleform public: static void SetGlobalHeap(MemoryHeap* a_heap) { - REL::Relocation heap{ REL::ID(939898) }; + static REL::Relocation heap{ REL::ID(939898) }; *heap = a_heap; } [[nodiscard]] static MemoryHeap* GetGlobalHeap() { - REL::Relocation heap{ REL::ID(939898) }; + static REL::Relocation heap{ REL::ID(939898) }; return *heap; } diff --git a/CommonLibF4/include/RE/Scaleform/Kernel/SF_SysAlloc.h b/CommonLibF4/include/RE/Scaleform/Kernel/SF_SysAlloc.h index 4f05ce84..a49a76d9 100644 --- a/CommonLibF4/include/RE/Scaleform/Kernel/SF_SysAlloc.h +++ b/CommonLibF4/include/RE/Scaleform/Kernel/SF_SysAlloc.h @@ -37,14 +37,14 @@ namespace RE::Scaleform bool InitHeapEngine(const void* a_heapDesc) override // 01 { using func_t = decltype(&SysAlloc::InitHeapEngine); - REL::Relocation func{ REL::ID(1047970) }; + static REL::Relocation func{ REL::ID(1047970) }; return func(this, a_heapDesc); } bool ShutdownHeapEngine() override // 02 { using func_t = decltype(&SysAlloc::ShutdownHeapEngine); - REL::Relocation func{ REL::ID(1207169) }; + static REL::Relocation func{ REL::ID(1207169) }; return func(this); } diff --git a/CommonLibF4/include/RE/msvc/typeinfo.h b/CommonLibF4/include/RE/msvc/typeinfo.h index aa659914..e79ae1e0 100644 --- a/CommonLibF4/include/RE/msvc/typeinfo.h +++ b/CommonLibF4/include/RE/msvc/typeinfo.h @@ -12,7 +12,7 @@ namespace RE::msvc [[nodiscard]] const char* name() const noexcept { using func_t = const char* (*)(const type_info*, __type_info_node*) noexcept; - REL::Relocation func{ REL::ID(1419793) }; + static REL::Relocation func{ REL::ID(1419793) }; return (*func)(this, std::addressof(get_root_node())); } @@ -21,7 +21,7 @@ namespace RE::msvc private: [[nodiscard]] static __type_info_node& get_root_node() noexcept { - REL::Relocation<__type_info_node*> root{ REL::ID(161235) }; + static REL::Relocation<__type_info_node*> root{ REL::ID(161235) }; return *root; }