Skip to content

Commit

Permalink
refactor: remove offset use in files
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Jul 23, 2024
1 parent db1e020 commit 891eb56
Show file tree
Hide file tree
Showing 70 changed files with 171 additions and 171 deletions.
4 changes: 2 additions & 2 deletions include/RE/B/BGSEntryPointFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace RE
static std::uint32_t GetArgumentCount(ENTRY_POINT_FUNCTION_TYPE a_entryPointFunctionType)
{
if (a_entryPointFunctionType < ENTRY_POINT_FUNCTION_TYPE::kTotal) {
REL::Relocation<std::uint32_t*> entryPointFunctionTypeArgumentCount{ Offset::BGSEntryPointFunction::EntryPointFunctionTypeArgumentCount };
REL::Relocation<std::uint32_t*> entryPointFunctionTypeArgumentCount{ REL::ID(369210) };
return entryPointFunctionTypeArgumentCount.get()[a_entryPointFunctionType];
}

Expand All @@ -75,7 +75,7 @@ namespace RE
static EntryPointFunction* GetEntryPointFunction(ENTRY_POINT_FUNCTION a_entryPointFunction)
{
if (a_entryPointFunction < ENTRY_POINT_FUNCTION::kTotal) {
REL::Relocation<EntryPointFunction*> entryPointFunctions{ Offset::BGSEntryPointFunction::EntryPointFunctions };
REL::Relocation<EntryPointFunction*> entryPointFunctions{ REL::ID(369178) };
return &entryPointFunctions.get()[a_entryPointFunction];
}

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

inline static TLSData* GetStaticTLSData()
{
REL::Relocation<std::uint32_t*> tlsIndex{ Offset::TlsIndex };
REL::Relocation<std::uint32_t*> tlsIndex{ RELOCATION_ID(528600, 415542) };
auto tlsDataArray = reinterpret_cast<TLSData**>(__readgsqword(0x58));
return tlsDataArray[*tlsIndex];
}
Expand Down
2 changes: 1 addition & 1 deletion src/RE/A/AIProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ namespace RE
void AIProcess::Update3DModel_Impl(Actor* a_actor)
{
using func_t = decltype(&AIProcess::Update3DModel_Impl);
REL::Relocation<func_t> func{ Offset::AIProcess::Update3DModel };
REL::Relocation<func_t> func{ RELOCATION_ID(38404, 39395) };
return func(this, a_actor);
}

Expand Down
24 changes: 12 additions & 12 deletions src/RE/A/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace RE
bool Actor::AddSpell(SpellItem* a_spell)
{
using func_t = decltype(&Actor::AddSpell);
REL::Relocation<func_t> func{ Offset::Actor::AddSpell };
REL::Relocation<func_t> func{ RELOCATION_ID(37771, 38716) };
return func(this, a_spell);
}

Expand Down Expand Up @@ -211,14 +211,14 @@ namespace RE
void Actor::DispelWornItemEnchantments()
{
using func_t = decltype(&Actor::DispelWornItemEnchantments);
REL::Relocation<func_t> func{ Offset::Actor::DispelWornItemEnchantments };
REL::Relocation<func_t> func{ RELOCATION_ID(33828, 34620) };
return func(this);
}

void Actor::DoReset3D(bool a_updateWeight)
{
using func_t = decltype(&Actor::DoReset3D);
REL::Relocation<func_t> func{ Offset::Actor::DoReset3D };
REL::Relocation<func_t> func{ RELOCATION_ID(39181, 40255) };
return func(this, a_updateWeight);
}

Expand Down Expand Up @@ -493,7 +493,7 @@ namespace RE
std::uint16_t Actor::GetLevel() const
{
using func_t = decltype(&Actor::GetLevel);
REL::Relocation<func_t> func{ Offset::Actor::GetLevel };
REL::Relocation<func_t> func{ RELOCATION_ID(36344, 37334) };
return func(this);
}

Expand Down Expand Up @@ -686,7 +686,7 @@ namespace RE
bool Actor::HasPerk(BGSPerk* a_perk) const
{
using func_t = decltype(&Actor::HasPerk);
REL::Relocation<func_t> func{ Offset::Actor::HasPerk };
REL::Relocation<func_t> func{ RELOCATION_ID(36690, 37698) };
return func(this, a_perk);
}

Expand Down Expand Up @@ -810,7 +810,7 @@ namespace RE
bool Actor::IsGhost() const
{
using func_t = decltype(&Actor::IsGhost);
REL::Relocation<func_t> func{ Offset::Actor::GetGhost };
REL::Relocation<func_t> func{ RELOCATION_ID(36286, 37275) };
return func(this);
}

Expand All @@ -822,7 +822,7 @@ namespace RE
bool Actor::IsHostileToActor(Actor* a_actor)
{
using func_t = decltype(&Actor::IsHostileToActor);
REL::Relocation<func_t> func{ Offset::Actor::GetHostileToActor };
REL::Relocation<func_t> func{ RELOCATION_ID(36537, 37537) };
return func(this, a_actor);
}

Expand Down Expand Up @@ -893,7 +893,7 @@ namespace RE
bool Actor::IsRunning() const
{
using func_t = decltype(&Actor::IsRunning);
REL::Relocation<func_t> func{ Offset::Actor::IsRunning };
REL::Relocation<func_t> func{ RELOCATION_ID(36252, 37234) };
return func(this);
}

Expand Down Expand Up @@ -997,7 +997,7 @@ namespace RE
std::int32_t Actor::RequestDetectionLevel(Actor* a_target, DETECTION_PRIORITY a_priority)
{
using func_t = decltype(&Actor::RequestDetectionLevel);
REL::Relocation<func_t> func{ Offset::Actor::RequestDetectionLevel };
REL::Relocation<func_t> func{ RELOCATION_ID(36748, 37764) };
return func(this, a_target, a_priority);
}

Expand Down Expand Up @@ -1085,7 +1085,7 @@ namespace RE
void Actor::SwitchRace(TESRace* a_race, bool a_player)
{
using func_t = decltype(&Actor::SwitchRace);
REL::Relocation<func_t> func{ Offset::Actor::SwitchRace };
REL::Relocation<func_t> func{ RELOCATION_ID(36901, 37925) };
return func(this, a_race, a_player);
}

Expand All @@ -1099,7 +1099,7 @@ namespace RE
void Actor::UpdateArmorAbility(TESForm* a_armor, ExtraDataList* a_extraData)
{
using func_t = decltype(&Actor::UpdateArmorAbility);
REL::Relocation<func_t> func{ Offset::Actor::UpdateArmorAbility };
REL::Relocation<func_t> func{ RELOCATION_ID(37802, 38751) };
return func(this, a_armor, a_extraData);
}

Expand Down Expand Up @@ -1167,7 +1167,7 @@ namespace RE
void Actor::UpdateWeaponAbility(TESForm* a_weapon, ExtraDataList* a_extraData, bool a_leftHand)
{
using func_t = decltype(&Actor::UpdateWeaponAbility);
REL::Relocation<func_t> func{ Offset::Actor::UpdateWeaponAbility };
REL::Relocation<func_t> func{ RELOCATION_ID(37803, 38752) };
return func(this, a_weapon, a_extraData, a_leftHand);
}

Expand Down
6 changes: 3 additions & 3 deletions src/RE/A/ActorEquipManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ namespace RE
{
ActorEquipManager* ActorEquipManager::GetSingleton()
{
REL::Relocation<ActorEquipManager**> singleton{ Offset::ActorEquipManager::Singleton };
REL::Relocation<ActorEquipManager**> singleton{ RELOCATION_ID(514494, 400636) };
return *singleton;
}

void ActorEquipManager::EquipObject(Actor* a_actor, TESBoundObject* a_object, ExtraDataList* a_extraData, std::uint32_t a_count, const BGSEquipSlot* a_slot, bool a_queueEquip, bool a_forceEquip, bool a_playSounds, bool a_applyNow)
{
using func_t = decltype(&ActorEquipManager::EquipObject);
REL::Relocation<func_t> func{ Offset::ActorEquipManager::EquipObject };
REL::Relocation<func_t> func{ RELOCATION_ID(37938, 38894) };
return func(this, a_actor, a_object, a_extraData, a_count, a_slot, a_queueEquip, a_forceEquip, a_playSounds, a_applyNow);
}

Expand All @@ -32,7 +32,7 @@ namespace RE
bool ActorEquipManager::UnequipObject(Actor* a_actor, TESBoundObject* a_object, ExtraDataList* a_extraData, std::uint32_t a_count, const BGSEquipSlot* a_slot, bool a_queueEquip, bool a_forceEquip, bool a_playSounds, bool a_applyNow, const BGSEquipSlot* a_slotToReplace)
{
using func_t = decltype(&ActorEquipManager::UnequipObject);
REL::Relocation<func_t> func{ Offset::ActorEquipManager::UnequipObject };
REL::Relocation<func_t> func{ RELOCATION_ID(37945, 38901) };
return func(this, a_actor, a_object, a_extraData, a_count, a_slot, a_queueEquip, a_forceEquip, a_playSounds, a_applyNow, a_slotToReplace);
}
}
2 changes: 1 addition & 1 deletion src/RE/A/ActorValueOwner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace RE
float ActorValueOwner::GetClampedActorValue(ActorValue a_akValue) const
{
using func_t = decltype(&ActorValueOwner::GetClampedActorValue);
REL::Relocation<func_t> func{ Offset::ActorValueOwner::GetClampedActorValue };
REL::Relocation<func_t> func{ RELOCATION_ID(26616, 27284) };
return func(this, a_akValue);
}
}
2 changes: 1 addition & 1 deletion src/RE/B/BGSFootstepManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace RE
{
BGSFootstepManager* BGSFootstepManager::GetSingleton()
{
REL::Relocation<BGSFootstepManager**> singleton{ Offset::BGSFootstepManager::Singleton };
REL::Relocation<BGSFootstepManager**> singleton{ RELOCATION_ID(517045, 401262) };
return *singleton;
}
}
2 changes: 1 addition & 1 deletion src/RE/B/BGSListForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace RE
void BGSListForm::AddForm(TESForm* a_form)
{
using func_t = decltype(&BGSListForm::AddForm);
REL::Relocation<func_t> func{ Offset::BGSListForm::AddForm };
REL::Relocation<func_t> func{ RELOCATION_ID(20470, 20913) };
return func(this, a_form);
}

Expand Down
6 changes: 3 additions & 3 deletions src/RE/B/BGSSaveLoadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace RE
{
BGSSaveLoadManager* BGSSaveLoadManager::GetSingleton()
{
REL::Relocation<BGSSaveLoadManager**> singleton{ Offset::BGSSaveLoadManager::Singleton };
REL::Relocation<BGSSaveLoadManager**> singleton{ RELOCATION_ID(516860, 403340) };
return *singleton;
}

Expand Down Expand Up @@ -42,14 +42,14 @@ namespace RE
bool BGSSaveLoadManager::Save_Impl(std::int32_t a_deviceID, std::uint32_t a_outputStats, const char* a_fileName)
{
using func_t = decltype(&BGSSaveLoadManager::Save_Impl);
REL::Relocation<func_t> func{ Offset::BGSSaveLoadManager::Save };
REL::Relocation<func_t> func{ RELOCATION_ID(34818, 35727) };
return func(this, a_deviceID, a_outputStats, a_fileName);
}

bool BGSSaveLoadManager::Load_Impl(const char* a_fileName, std::int32_t a_deviceID, std::uint32_t a_outputStats, bool a_checkForMods)
{
using func_t = decltype(&BGSSaveLoadManager::Load_Impl);
REL::Relocation<func_t> func{ Offset::BGSSaveLoadManager::Load };
REL::Relocation<func_t> func{ RELOCATION_ID(34819, 35728) };
return func(this, a_fileName, a_deviceID, a_outputStats, a_checkForMods);
}
}
4 changes: 2 additions & 2 deletions src/RE/B/BGSStoryTeller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ namespace RE
void BGSStoryTeller::BeginShutDownQuest(TESQuest* a_quest)
{
using func_t = decltype(&BGSStoryTeller::BeginShutDownQuest);
REL::Relocation<func_t> func{ Offset::BGSStoryTeller::BeginShutDownQuest };
REL::Relocation<func_t> func{ RELOCATION_ID(31718, 32486) };
return func(this, a_quest);
}

void BGSStoryTeller::BeginStartUpQuest(TESQuest* a_quest)
{
using func_t = decltype(&BGSStoryTeller::BeginStartUpQuest);
REL::Relocation<func_t> func{ Offset::BGSStoryTeller::BeginStartUpQuest };
REL::Relocation<func_t> func{ RELOCATION_ID(31717, 32485) };
return func(this, a_quest);
}
}
8 changes: 4 additions & 4 deletions src/RE/B/BSAtomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,28 @@ namespace RE
void BSReadWriteLock::LockForRead()
{
using func_t = decltype(&BSReadWriteLock::LockForRead);
REL::Relocation<func_t> func{ Offset::BSReadWriteLock::LockForRead };
REL::Relocation<func_t> func{ RELOCATION_ID(66976, 68233) };
func(this);
}

void BSReadWriteLock::UnlockForRead()
{
using func_t = decltype(&BSReadWriteLock::UnlockForRead);
REL::Relocation<func_t> func{ Offset::BSReadWriteLock::UnlockForRead };
REL::Relocation<func_t> func{ RELOCATION_ID(66982, 68239) };
func(this);
}

void BSReadWriteLock::LockForWrite()
{
using func_t = decltype(&BSReadWriteLock::LockForWrite);
REL::Relocation<func_t> func{ Offset::BSReadWriteLock::LockForWrite };
REL::Relocation<func_t> func{ RELOCATION_ID(66977, 68234) };
func(this);
}

void BSReadWriteLock::UnlockForWrite()
{
using func_t = decltype(&BSReadWriteLock::UnlockForWrite);
REL::Relocation<func_t> func{ Offset::BSReadWriteLock::UnlockForWrite };
REL::Relocation<func_t> func{ RELOCATION_ID(66983, 68240) };
func(this);
}

Expand Down
4 changes: 2 additions & 2 deletions src/RE/B/BSAudioManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RE
BSAudioManager* BSAudioManager::GetSingleton()
{
using func_t = decltype(&BSAudioManager::GetSingleton);
REL::Relocation<func_t> func{ Offset::BSAudioManager::GetSingleton };
REL::Relocation<func_t> func{ RELOCATION_ID(66391, 67652) };
return func();
}

Expand All @@ -29,7 +29,7 @@ namespace RE
bool BSAudioManager::BuildSoundDataFromDescriptor(BSSoundHandle& a_soundHandle, BSISoundDescriptor* a_descriptor, std::uint32_t a_flags)
{
using func_t = decltype(&BSAudioManager::BuildSoundDataFromDescriptor);
REL::Relocation<func_t> func{ Offset::BSAudioManager::BuildSoundDataFromDescriptor };
REL::Relocation<func_t> func{ RELOCATION_ID(66404, 67666) };
return func(this, a_soundHandle, a_descriptor, a_flags);
}

Expand Down
2 changes: 1 addition & 1 deletion src/RE/B/BSInputDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace RE
{
BSInputDeviceManager* BSInputDeviceManager::GetSingleton()
{
REL::Relocation<BSInputDeviceManager**> singleton{ Offset::BSInputDeviceManager::Singleton };
REL::Relocation<BSInputDeviceManager**> singleton{ RELOCATION_ID(516574, 402776) };
return *singleton;
}

Expand Down
8 changes: 4 additions & 4 deletions src/RE/B/BSResourceNiBinaryStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace RE
void BSResourceNiBinaryStream::seek(std::int32_t a_numBytes)
{
using func_t = decltype(&BSResourceNiBinaryStream::seek);
REL::Relocation<func_t> func{ Offset::BSResourceNiBinaryStream::Seek };
REL::Relocation<func_t> func{ RELOCATION_ID(69640, 71018) };
return func(this, a_numBytes);
}

Expand All @@ -52,21 +52,21 @@ namespace RE
void BSResourceNiBinaryStream::set_endian_swap(bool a_doSwap)
{
using func_t = decltype(&BSResourceNiBinaryStream::set_endian_swap);
REL::Relocation<func_t> func{ Offset::BSResourceNiBinaryStream::SetEndianSwap };
REL::Relocation<func_t> func{ RELOCATION_ID(69643, 71021) };
return func(this, a_doSwap);
}

BSResourceNiBinaryStream* BSResourceNiBinaryStream::ctor(const char* a_name, bool a_writeable, BSResource::Location* a_optionalStart)
{
using func_t = decltype(&BSResourceNiBinaryStream::ctor);
REL::Relocation<func_t> func{ Offset::BSResourceNiBinaryStream::Ctor };
REL::Relocation<func_t> func{ RELOCATION_ID(69636, 71014) };
return func(this, a_name, a_writeable, a_optionalStart);
}

void BSResourceNiBinaryStream::dtor()
{
using func_t = decltype(&BSResourceNiBinaryStream::dtor);
REL::Relocation<func_t> func{ Offset::BSResourceNiBinaryStream::Dtor };
REL::Relocation<func_t> func{ RELOCATION_ID(69638, 71016) };
return func(this);
}
}
2 changes: 1 addition & 1 deletion src/RE/B/BSScriptObjectBindPolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace RE
void ObjectBindPolicy::BindObject(BSTSmartPointer<Object>& a_objectPtr, VMHandle a_handle)
{
using func_t = decltype(&ObjectBindPolicy::BindObject);
REL::Relocation<func_t> func{ Offset::BSScript::ObjectBindPolicy::BindObject };
REL::Relocation<func_t> func{ RELOCATION_ID(97379, 104184) };
return func(this, a_objectPtr, a_handle);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/RE/B/BSSoundHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace RE
bool BSSoundHandle::IsValid() const
{
using func_t = decltype(&BSSoundHandle::IsValid);
REL::Relocation<func_t> func{ Offset::BSSoundHandle::IsValid };
REL::Relocation<func_t> func{ RELOCATION_ID(66360, 67621) };
return func(this);
}

Expand All @@ -57,14 +57,14 @@ namespace RE
bool BSSoundHandle::SetPosition(NiPoint3 a_pos)
{
using func_t = decltype(&BSSoundHandle::SetPosition);
REL::Relocation<func_t> func{ Offset::BSSoundHandle::SetPosition };
REL::Relocation<func_t> func{ RELOCATION_ID(66370, 67631) };
return func(this, a_pos);
}

void BSSoundHandle::SetObjectToFollow(NiAVObject* a_node)
{
using func_t = decltype(&BSSoundHandle::SetObjectToFollow);
REL::Relocation<func_t> func{ Offset::BSSoundHandle::SetObjectToFollow };
REL::Relocation<func_t> func{ RELOCATION_ID(66375, 67636) };
return func(this, a_node);
}

Expand All @@ -85,21 +85,21 @@ namespace RE
bool BSSoundHandle::Stop()
{
using func_t = decltype(&BSSoundHandle::Stop);
REL::Relocation<func_t> func{ Offset::BSSoundHandle::Stop };
REL::Relocation<func_t> func{ RELOCATION_ID(66358, 67619) };
return func(this);
}

bool BSSoundHandle::Play()
{
using func_t = decltype(&BSSoundHandle::Play);
REL::Relocation<func_t> func{ Offset::BSSoundHandle::Play };
REL::Relocation<func_t> func{ RELOCATION_ID(66355, 67616) };
return func(this);
}

bool BSSoundHandle::Pause()
{
using func_t = decltype(&BSSoundHandle::Pause);
REL::Relocation<func_t> func{ Offset::BSSoundHandle::Pause };
REL::Relocation<func_t> func{ RELOCATION_ID(66357, 67618) };
return func(this);
}
}
Loading

0 comments on commit 891eb56

Please sign in to comment.