From 6d5cd9a3c04f2a7ee04fbb3032d8bd7ee31c7307 Mon Sep 17 00:00:00 2001 From: Bobbyclue <97621924+Bobbyclue@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:06:08 -0400 Subject: [PATCH] feat: swap REL::Offset to REL::ID usage (#99) --- CommonLibSF/include/RE/A/Actor.h | 2 +- CommonLibSF/include/RE/A/ActorValues.h | 2 +- CommonLibSF/include/RE/B/BGSEntryPoint.h | 2 +- CommonLibSF/include/RE/B/BSStringPool.h | 8 +++---- CommonLibSF/include/RE/C/ConsoleLog.h | 4 ++-- CommonLibSF/include/RE/F/FORM_ENUM_STRING.h | 2 +- .../include/RE/I/INIPrefSettingCollection.h | 2 +- .../include/RE/I/INISettingCollection.h | 2 +- CommonLibSF/include/RE/N/NativeFunction.h | 4 ++-- CommonLibSF/include/RE/N/NativeFunctionBase.h | 10 ++++----- CommonLibSF/include/RE/RTTI.h | 2 +- CommonLibSF/include/RE/S/Script.h | 4 ++-- CommonLibSF/include/RE/T/TESForm.h | 4 ++-- CommonLibSF/include/RE/U/UI.h | 4 ++-- CommonLibSF/src/RE/P/PlayerCamera.cpp | 10 ++++----- CommonLibSF/src/RE/T/TESObjectREFR.cpp | 22 +++++++++---------- 16 files changed, 42 insertions(+), 42 deletions(-) diff --git a/CommonLibSF/include/RE/A/Actor.h b/CommonLibSF/include/RE/A/Actor.h index e273f383..4be4406e 100644 --- a/CommonLibSF/include/RE/A/Actor.h +++ b/CommonLibSF/include/RE/A/Actor.h @@ -19,7 +19,7 @@ namespace RE inline static Actor* PlayerCharacter() { - static REL::Relocation singleton{ REL::Offset(0x05595BA8) }; + static REL::Relocation singleton{ REL::ID(865059) }; return *singleton; } diff --git a/CommonLibSF/include/RE/A/ActorValues.h b/CommonLibSF/include/RE/A/ActorValues.h index a0432e5e..8863fd3d 100644 --- a/CommonLibSF/include/RE/A/ActorValues.h +++ b/CommonLibSF/include/RE/A/ActorValues.h @@ -36,7 +36,7 @@ namespace RE [[nodiscard]] static ActorValue* GetSingleton() { using func_t = decltype(&ActorValue::GetSingleton); - REL::Relocation func{ REL::Offset(0x00824D90) }; + REL::Relocation func{ REL::ID(516248) }; return func(); } diff --git a/CommonLibSF/include/RE/B/BGSEntryPoint.h b/CommonLibSF/include/RE/B/BGSEntryPoint.h index c822d4c3..a6a6d5d0 100644 --- a/CommonLibSF/include/RE/B/BGSEntryPoint.h +++ b/CommonLibSF/include/RE/B/BGSEntryPoint.h @@ -267,7 +267,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::Offset(0x01AF0C5C) }; + REL::Relocation func{ REL::ID(110912) }; return func(a_entryPoint, a_perkOwner, a_args...); } } diff --git a/CommonLibSF/include/RE/B/BSStringPool.h b/CommonLibSF/include/RE/B/BSStringPool.h index f1198169..79d797a9 100644 --- a/CommonLibSF/include/RE/B/BSStringPool.h +++ b/CommonLibSF/include/RE/B/BSStringPool.h @@ -16,7 +16,7 @@ namespace RE static void release(Entry*& a_entry) { using func_t = decltype(&Entry::release); - REL::Relocation func{ REL::Offset(0x00836C2C) }; + REL::Relocation func{ REL::ID(36754) }; return func(a_entry); } @@ -108,7 +108,7 @@ namespace RE static BucketTable& GetSingleton() { using func_t = decltype(&BucketTable::GetSingleton); - REL::Relocation func{ REL::Offset(0x0314A870) }; + REL::Relocation func{ REL::ID(198241) }; return func(); } @@ -126,7 +126,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::Offset(0x03149530) }; + REL::Relocation func{ REL::ID(198219) }; return func(a_result, a_string, a_caseSensitive); } @@ -134,7 +134,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::Offset(0x03149D40) }; + REL::Relocation func{ REL::ID(198220) }; return func(a_result, a_string, a_caseSensitive); } } diff --git a/CommonLibSF/include/RE/C/ConsoleLog.h b/CommonLibSF/include/RE/C/ConsoleLog.h index b27e5093..322a1efe 100644 --- a/CommonLibSF/include/RE/C/ConsoleLog.h +++ b/CommonLibSF/include/RE/C/ConsoleLog.h @@ -10,7 +10,7 @@ namespace RE // BSTSDM [[nodiscard]] static ConsoleLog* GetSingleton() { - static REL::Relocation singleton{ REL::Offset(0x058F7A90) }; + static REL::Relocation singleton{ REL::ID(879277) }; return *singleton; } @@ -25,7 +25,7 @@ namespace RE void VPrint(const char* a_fmt, std::va_list a_args) { using func_t = decltype(&ConsoleLog::VPrint); - REL::Relocation func{ REL::Offset(0x02883978) }; + REL::Relocation func{ REL::ID(166358) }; func(this, a_fmt, a_args); } }; diff --git a/CommonLibSF/include/RE/F/FORM_ENUM_STRING.h b/CommonLibSF/include/RE/F/FORM_ENUM_STRING.h index 1db897f3..87404506 100644 --- a/CommonLibSF/include/RE/F/FORM_ENUM_STRING.h +++ b/CommonLibSF/include/RE/F/FORM_ENUM_STRING.h @@ -9,7 +9,7 @@ namespace RE public: [[nodiscard]] static std::span GetFormEnumString() { - REL::Relocation formEnumString{ REL::Offset(0x50146A0) }; + REL::Relocation formEnumString{ REL::ID(761416) }; return { *formEnumString }; } diff --git a/CommonLibSF/include/RE/I/INIPrefSettingCollection.h b/CommonLibSF/include/RE/I/INIPrefSettingCollection.h index a666bf29..5aa6455e 100644 --- a/CommonLibSF/include/RE/I/INIPrefSettingCollection.h +++ b/CommonLibSF/include/RE/I/INIPrefSettingCollection.h @@ -11,7 +11,7 @@ namespace RE [[nodiscard]] static INIPrefSettingCollection* GetSingleton() { - REL::Relocation singleton{ REL::Offset(0x05913BB8) }; + REL::Relocation singleton{ REL::ID(885866) }; return *singleton; } diff --git a/CommonLibSF/include/RE/I/INISettingCollection.h b/CommonLibSF/include/RE/I/INISettingCollection.h index cd3f9c13..99aff445 100644 --- a/CommonLibSF/include/RE/I/INISettingCollection.h +++ b/CommonLibSF/include/RE/I/INISettingCollection.h @@ -11,7 +11,7 @@ namespace RE [[nodiscard]] static INISettingCollection* GetSingleton() { - REL::Relocation singleton{ REL::Offset(0x05913B98) }; + REL::Relocation singleton{ REL::ID(885862) }; return *singleton; } diff --git a/CommonLibSF/include/RE/N/NativeFunction.h b/CommonLibSF/include/RE/N/NativeFunction.h index ab03dd08..d078c936 100644 --- a/CommonLibSF/include/RE/N/NativeFunction.h +++ b/CommonLibSF/include/RE/N/NativeFunction.h @@ -13,14 +13,14 @@ namespace RE NativeFunction(const char* a_name, const char* a_className, bool a_isStatic, std::uint32_t a_numParams) { using func_t = std::add_pointer_t; - REL::Relocation func{ REL::Offset(0x03076DE8) }; + REL::Relocation func{ REL::ID(196396) }; func(this, a_name, a_className, a_isStatic, a_numParams); } virtual ~NativeFunction() { using func_t = std::add_pointer_t; - REL::Relocation func{ REL::Offset(0x03076EA4) }; + REL::Relocation func{ REL::ID(196398) }; func(this); } diff --git a/CommonLibSF/include/RE/N/NativeFunctionBase.h b/CommonLibSF/include/RE/N/NativeFunctionBase.h index 729ef365..ae5a7130 100644 --- a/CommonLibSF/include/RE/N/NativeFunctionBase.h +++ b/CommonLibSF/include/RE/N/NativeFunctionBase.h @@ -59,7 +59,7 @@ namespace RE virtual std::uint64_t* GetParam(std::uint32_t a_idx, BSFixedString* a_nameOut, std::uint64_t* a_typeOut) { using func_t = std::add_pointer_t; - REL::Relocation func{ REL::Offset(0x0307728C) }; + REL::Relocation func{ REL::ID(196404) }; return func(&_params, a_idx, a_nameOut, a_typeOut); } virtual std::uint64_t GetNumParams2(void) override { return _params.unk0A; } @@ -73,13 +73,13 @@ namespace RE virtual std::uint32_t Invoke(std::uint64_t a_unk0, std::uint64_t a_unk1, VMClassRegistry* a_registry, VMState* a_unk3) override { using func_t = decltype(&NativeFunctionBase::Invoke); - REL::Relocation func{ REL::Offset(0x03076F64) }; + REL::Relocation func{ REL::ID(196401) }; return func(this, a_unk0, a_unk1, a_registry, a_unk3); } virtual BSFixedString* Unk_10(void) override { using func_t = decltype(&NativeFunctionBase::Unk_10); - REL::Relocation func{ REL::Offset(0x030772F4) }; + REL::Relocation func{ REL::ID(196407) }; return func(this); } virtual bool Unk_11(std::uint32_t a_unk0, std::uint32_t* a_unk1) override @@ -104,13 +104,13 @@ namespace RE virtual bool GetParamInfo(std::uint32_t a_idx, void* a_out) override { using func_t = decltype(&NativeFunctionBase::GetParamInfo); - REL::Relocation func{ REL::Offset(0x03077390) }; + REL::Relocation func{ REL::ID(196409) }; return func(this, a_idx, a_out); } virtual void* Unk_15(std::uint64_t a_arg0, std::uint64_t a_arg1) { using func_t = decltype(&NativeFunctionBase::Unk_15); - REL::Relocation func{ REL::Offset(0x030772FC) }; + REL::Relocation func{ REL::ID(196408) }; return func(this, a_arg0, a_arg1); } virtual bool GetUnk41(void) override { return _isCallableFromTasklet; } diff --git a/CommonLibSF/include/RE/RTTI.h b/CommonLibSF/include/RE/RTTI.h index ba373666..6b9b17cc 100644 --- a/CommonLibSF/include/RE/RTTI.h +++ b/CommonLibSF/include/RE/RTTI.h @@ -138,7 +138,7 @@ namespace RE inline void* RTDynamicCast(void* a_inptr, std::int32_t a_vfDelta, void* a_srcType, void* a_targetType, std::int32_t a_isReference) { using func_t = decltype(&RTDynamicCast); - REL::Relocation func{ REL::Offset(0x034C7500) }; + REL::Relocation func{ REL::ID(211916) }; return func(a_inptr, a_vfDelta, a_srcType, a_targetType, a_isReference); } diff --git a/CommonLibSF/include/RE/S/Script.h b/CommonLibSF/include/RE/S/Script.h index 39447211..a194de6f 100644 --- a/CommonLibSF/include/RE/S/Script.h +++ b/CommonLibSF/include/RE/S/Script.h @@ -158,13 +158,13 @@ namespace RE inline static SCRIPT_FUNCTION GetFirstScriptCommand() { - static REL::Relocation chunk{ REL::Offset(0x05511F30) }; + static REL::Relocation chunk{ REL::ID(841467) }; return chunk.get(); } inline static SCRIPT_FUNCTION GetFirstConsoleCommand() { - static REL::Relocation chunk{ REL::Offset(0x055056C0) }; + static REL::Relocation chunk{ REL::ID(841465) }; return chunk.get(); } diff --git a/CommonLibSF/include/RE/T/TESForm.h b/CommonLibSF/include/RE/T/TESForm.h index b7c5337f..1a316e7c 100644 --- a/CommonLibSF/include/RE/T/TESForm.h +++ b/CommonLibSF/include/RE/T/TESForm.h @@ -123,14 +123,14 @@ namespace RE [[nodiscard]] static TESForm* LookupByID(std::uint32_t a_formID) { using func_t = decltype(&TESForm::LookupByID); - REL::Relocation func{ REL::Offset(0x014D7DB0) }; + REL::Relocation func{ REL::ID(86125) }; return func(a_formID); } [[nodiscard]] static TESForm* LookupByEditorID(const char* a_editorID) { using func_t = decltype(&TESForm::LookupByEditorID); - REL::Relocation func{ REL::Offset(0x014D7F0C) }; + REL::Relocation func{ REL::ID(86127) }; return func(a_editorID); } diff --git a/CommonLibSF/include/RE/U/UI.h b/CommonLibSF/include/RE/U/UI.h index 313883b5..29dd5216 100644 --- a/CommonLibSF/include/RE/U/UI.h +++ b/CommonLibSF/include/RE/U/UI.h @@ -5,14 +5,14 @@ namespace RE public: inline static UI* GetSingleton() { - static REL::Relocation singleton{ REL::Offset(0x056EE0D0) }; + static REL::Relocation singleton{ REL::ID(878339) }; return *singleton; } bool IsMenuOpen(const BSFixedString& a_name) { using func_t = decltype(&UI::IsMenuOpen); - REL::Relocation func{ REL::Offset(0x02E7095C) }; + REL::Relocation func{ REL::ID(187048) }; return func(this, a_name); } }; diff --git a/CommonLibSF/src/RE/P/PlayerCamera.cpp b/CommonLibSF/src/RE/P/PlayerCamera.cpp index b5f0be44..3ba8332e 100644 --- a/CommonLibSF/src/RE/P/PlayerCamera.cpp +++ b/CommonLibSF/src/RE/P/PlayerCamera.cpp @@ -4,21 +4,21 @@ namespace RE { PlayerCamera* PlayerCamera::GetSingleton() { - REL::Relocation singleton{ REL::Offset(0x058F1978) }; + REL::Relocation singleton{ REL::ID(878523) }; return *singleton; } void PlayerCamera::ForceFirstPerson() { using func_t = decltype(&PlayerCamera::ForceFirstPerson); - REL::Relocation func{ REL::Offset(0x0286A798) }; + REL::Relocation func{ REL::ID(166029) }; return func(this); } void PlayerCamera::ForceThirdPerson() { using func_t = decltype(&PlayerCamera::ForceThirdPerson); - REL::Relocation func{ REL::Offset(0x0286A850) }; + REL::Relocation func{ REL::ID(166031) }; return func(this); } @@ -35,14 +35,14 @@ namespace RE void PlayerCamera::SetCameraState(CameraState a_cameraState) { using func_t = decltype(&PlayerCamera::SetCameraState); - REL::Relocation func{ REL::Offset(0x0286BCBC) }; + REL::Relocation func{ REL::ID(166078) }; return func(this, a_cameraState); } bool PlayerCamera::QCameraEquals(CameraState a_cameraState) const { using func_t = decltype(&PlayerCamera::QCameraEquals); - REL::Relocation func{ REL::Offset(0x0286BDC8) }; + REL::Relocation func{ REL::ID(166081) }; return func(this, a_cameraState); } } diff --git a/CommonLibSF/src/RE/T/TESObjectREFR.cpp b/CommonLibSF/src/RE/T/TESObjectREFR.cpp index 57df0fe6..9ddbf03f 100644 --- a/CommonLibSF/src/RE/T/TESObjectREFR.cpp +++ b/CommonLibSF/src/RE/T/TESObjectREFR.cpp @@ -5,77 +5,77 @@ namespace RE BGSLocation* TESObjectREFR::GetCurrentLocation() { using func_t = decltype(&TESObjectREFR::GetCurrentLocation); - REL::Relocation func{ REL::Offset(0x01A0505C) }; + REL::Relocation func{ REL::ID(106554) }; return func(this); } TESObjectREFR* TESObjectREFR::GetLinkedRef(BGSKeyword* a_keyword) { using func_t = decltype(&TESObjectREFR::GetLinkedRef); - REL::Relocation func{ REL::Offset(0x1A379E4) }; + REL::Relocation func{ REL::ID(107578) }; return func(this, a_keyword); } TESWorldSpace* TESObjectREFR::GetParentWorldSpace() { using func_t = decltype(&TESObjectREFR::GetParentWorldSpace); - REL::Relocation func{ REL::Offset(0x01A093BC) }; + REL::Relocation func{ REL::ID(106696) }; return func(this); } TESObjectREFR* TESObjectREFR::GetSpaceship(bool a_arg1) { using func_t = decltype(&TESObjectREFR::GetSpaceship); - REL::Relocation func{ REL::Offset(0x02B3A714) }; + REL::Relocation func{ REL::ID(173851) }; return func(this, a_arg1); } TESObjectREFR* TESObjectREFR::GetSpaceshipParentDock() { using func_t = decltype(&TESObjectREFR::GetSpaceshipParentDock); - REL::Relocation func{ REL::Offset(0x02B53DC0) }; + REL::Relocation func{ REL::ID(174134) }; return func(this); } Actor* TESObjectREFR::GetSpaceshipPilot() { using func_t = decltype(&TESObjectREFR::GetSpaceshipPilot); - REL::Relocation func{ REL::Offset(0x02B39D74) }; + REL::Relocation func{ REL::ID(173834) }; return func(this); } std::int32_t TESObjectREFR::GetValue() { using func_t = decltype(&TESObjectREFR::GetValue); - REL::Relocation func{ REL::Offset(0x01A38790) }; + REL::Relocation func{ REL::ID(107605)}; return func(this); } bool TESObjectREFR::HasKeyword(BGSKeyword* a_keyword) { using func_t = decltype(&TESObjectREFR::HasKeyword); - REL::Relocation func{ REL::Offset(0x0139EDB8) }; + REL::Relocation func{ REL::ID(80343) }; return func(this, a_keyword); } bool TESObjectREFR::IsCrimeToActivate() { using func_t = decltype(&TESObjectREFR::IsCrimeToActivate); - REL::Relocation func{ REL::Offset(0x01A0DC60) }; + REL::Relocation func{ REL::ID(106755) }; return func(this); } bool TESObjectREFR::IsInSpace(bool a_arg1) { using func_t = decltype(&TESObjectREFR::IsInSpace); - REL::Relocation func{ REL::Offset(0x01A0E1C8) }; + REL::Relocation func{ REL::ID(106767) }; return func(this, a_arg1); } bool TESObjectREFR::IsSpaceshipDocked() { using func_t = decltype(&TESObjectREFR::IsSpaceshipDocked); - REL::Relocation func{ REL::Offset(0x2B557C8) }; + REL::Relocation func{ REL::ID(174146) }; return func(this); }