Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove redundant Offsets.h includes, use offsets in Misc.cpp, rename RE::Offset to RE::ID #175

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CommonLibSF/include/RE/A/ActorValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "RE/B/BSTArray.h"
#include "RE/B/BSTSingleton.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down Expand Up @@ -38,7 +37,7 @@ namespace RE
[[nodiscard]] static ActorValue* GetSingleton()
{
using func_t = decltype(&ActorValue::GetSingleton);
REL::Relocation<func_t> func{ Offset::ActorValue::GetSingleton };
REL::Relocation<func_t> func{ ID::ActorValue::GetSingleton };
return func();
}

Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/B/BGSObjectInstance.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "RE/B/BSTSmartPointer.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down
10 changes: 4 additions & 6 deletions CommonLibSF/include/RE/B/BSStringPool.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "RE/Offsets.h"

namespace RE
{
struct BSStringPool
Expand All @@ -18,7 +16,7 @@ namespace RE
static void release(Entry*& a_entry)
{
using func_t = decltype(&Entry::release);
REL::Relocation<func_t> func{ Offset::BSStringPool::Entry::release };
REL::Relocation<func_t> func{ ID::BSStringPool::Entry::release };
return func(a_entry);
}

Expand Down Expand Up @@ -87,7 +85,7 @@ namespace RE
static BucketTable& GetSingleton()
{
using func_t = decltype(&BucketTable::GetSingleton);
REL::Relocation<func_t> func{ Offset::BSStringPool::BucketTable::GetSingleton };
REL::Relocation<func_t> func{ ID::BSStringPool::BucketTable::GetSingleton };
return func();
}

Expand All @@ -105,15 +103,15 @@ namespace RE
inline void GetEntry<char>(BSStringPool::Entry*& a_result, const char* a_string, bool a_caseSensitive)
{
using func_t = decltype(&GetEntry<char>);
REL::Relocation<func_t> func{ Offset::BSStringPool::GetEntry_char_ };
REL::Relocation<func_t> func{ ID::BSStringPool::GetEntry_char_ };
return func(a_result, a_string, a_caseSensitive);
}

template <>
inline void GetEntry<wchar_t>(BSStringPool::Entry*& a_result, const wchar_t* a_string, bool a_caseSensitive)
{
using func_t = decltype(&GetEntry<wchar_t>);
REL::Relocation<func_t> func{ Offset::BSStringPool::GetEntry_wchar_t_ };
REL::Relocation<func_t> func{ ID::BSStringPool::GetEntry_wchar_t_ };
return func(a_result, a_string, a_caseSensitive);
}
}
7 changes: 3 additions & 4 deletions CommonLibSF/include/RE/B/BSTEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "RE/B/BSTArray.h"
#include "RE/B/BSTSingleton.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down Expand Up @@ -54,19 +53,19 @@ namespace RE
void Notify(void* a_event)
{
using func_t = decltype(&BSTEventSource::Notify);
REL::Relocation<func_t> func{ Offset::BSTEventSource::Notify };
REL::Relocation<func_t> func{ ID::BSTEventSource::Notify };
return func(this, a_event);
}
void RegisterSink(BSTEventSink<Event>* a_sink)
{
using func_t = decltype(&BSTEventSource::RegisterSink);
REL::Relocation<func_t> func{ Offset::BSTEventSource::RegisterSink };
REL::Relocation<func_t> func{ ID::BSTEventSource::RegisterSink };
return func(this, a_sink);
}
void UnregisterSink(BSTEventSink<Event>* a_sink)
{
using func_t = decltype(&BSTEventSource::UnregisterSink);
REL::Relocation<func_t> func{ Offset::BSTEventSource::UnregisterSink };
REL::Relocation<func_t> func{ ID::BSTEventSource::UnregisterSink };
return func(this, a_sink);
}

Expand Down
2 changes: 0 additions & 2 deletions CommonLibSF/include/RE/C/ConsoleLog.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "RE/Offsets.h"

namespace RE
{
class ConsoleLog
Expand Down
7 changes: 3 additions & 4 deletions CommonLibSF/include/RE/E/ExtraDataList.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "RE/B/BSIntrusiveRefCounted.h"
#include "RE/B/BSLock.h"
#include "RE/E/ExtraDataTypes.h"
#include "RE/Offsets.h"

namespace RE
{
Expand All @@ -14,14 +13,14 @@ namespace RE
void AddExtra(BSExtraData* a_extra)
{
using func_t = decltype(&BaseExtraList::AddExtra);
REL::Relocation<func_t> func{ Offset::BaseExtraList::AddExtra };
REL::Relocation<func_t> func{ ID::BaseExtraList::AddExtra };
return func(this, a_extra);
}

[[nodiscard]] BSExtraData* GetByType(ExtraDataType a_type) const noexcept
{
using func_t = decltype(&BaseExtraList::GetByType);
REL::Relocation<func_t> func{ Offset::BaseExtraList::GetByType };
REL::Relocation<func_t> func{ ID::BaseExtraList::GetByType };
return func(this, a_type);
}

Expand Down Expand Up @@ -67,7 +66,7 @@ namespace RE
[[nodiscard]] bool HasType(ExtraDataType a_type) const noexcept
{
using func_t = bool (*)(const ExtraDataList*, ExtraDataType);
REL::Relocation<func_t> func{ Offset::ExtraDataList::HasType };
REL::Relocation<func_t> func{ ID::ExtraDataList::HasType };
return func(this, a_type);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#pragma once

#include "REL/Relocation.h"

namespace RE::Offset
namespace RE::ID
{
namespace Actor
{
Expand Down
8 changes: 3 additions & 5 deletions CommonLibSF/include/RE/M/MemoryManager.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "RE/Offsets.h"

namespace RE
{
class MemoryManager
Expand All @@ -10,21 +8,21 @@ namespace RE
[[nodiscard]] static MemoryManager* GetSingleton()
{
using func_t = decltype(&MemoryManager::GetSingleton);
const REL::Relocation<func_t> func{ Offset::MemoryManager::GetSingleton };
const REL::Relocation<func_t> func{ ID::MemoryManager::GetSingleton };
return func();
}

[[nodiscard]] void* Allocate(std::size_t a_size, std::uint32_t a_alignment, bool a_alignmentRequired)
{
using func_t = decltype(&MemoryManager::Allocate);
const REL::Relocation<func_t> func{ Offset::MemoryManager::Allocate };
const REL::Relocation<func_t> func{ ID::MemoryManager::Allocate };
return func(this, a_size, a_alignment, a_alignmentRequired);
}

void Free(void* a_ptr, bool a_alignmentRequired)
{
using func_t = decltype(&MemoryManager::Free);
const REL::Relocation<func_t> func{ Offset::MemoryManager::Free };
const REL::Relocation<func_t> func{ ID::MemoryManager::Free };
return func(this, a_ptr, a_alignmentRequired);
}
};
Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/N/NativeFunctionBase.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "RE/I/IFunction.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/R/RegSettingCollection.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include "RE/Offsets.h"
#include "RE/S/Setting.h"
#include "RE/S/SettingCollectionList.h"

Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/RTTI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include "RE/Offsets.h"
// NOTE: this has not been updated

struct __type_info_node;
Expand Down
2 changes: 0 additions & 2 deletions CommonLibSF/include/RE/S/ScaleformGFxValue.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "RE/Offsets.h"

namespace RE::Scaleform::GFx
{
class MovieImpl;
Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/S/Script.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "RE/B/BSStringT.h"
#include "RE/B/BSTList.h"
#include "RE/Offsets.h"
#include "RE/T/TESForm.h"
#include "RE/T/TESQuest.h"

Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/Starfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
#include "RE/N/NativeFunctionBase.h"
#include "RE/N/NiPoint3.h"
#include "RE/N/NiSmartPointer.h"
#include "RE/Offsets.h"
#include "RE/Offsets_NiRTTI.h"
#include "RE/Offsets_RTTI.h"
#include "RE/Offsets_VTABLE.h"
Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/T/TESCellFullyLoadedEvent.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "RE/B/BSTEvent.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/T/TESContainerChangedEvent.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "RE/B/BSTEvent.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/T/TESDataHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "RE/B/BSTList.h"
#include "RE/F/FormTypes.h"
#include "RE/N/NiSmartPointer.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/T/TESDeathEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "RE/B/BSTEvent.h"
#include "RE/N/NiSmartPointer.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down
7 changes: 3 additions & 4 deletions CommonLibSF/include/RE/T/TESForm.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "RE/B/BSReflection.h"
#include "RE/Offsets.h"
#include "RE/T/TESFile.h"
#include "RE/T/TESFormRefCount.h"

Expand Down Expand Up @@ -143,21 +142,21 @@ namespace RE
std::uint64_t DecRefCount() const
{
using func_t = decltype(&TESForm::DecRefCount);
REL::Relocation<func_t> func{ Offset::TESForm::DecRefCount };
REL::Relocation<func_t> func{ ID::TESForm::DecRefCount };
return func(this);
}

[[nodiscard]] static TESForm* LookupByID(std::uint32_t a_formID)
{
using func_t = decltype(&TESForm::LookupByID);
REL::Relocation<func_t> func{ Offset::TESForm::LookupByID };
REL::Relocation<func_t> func{ ID::TESForm::LookupByID };
return func(a_formID);
}

[[nodiscard]] static TESForm* LookupByEditorID(const char* a_editorID)
{
using func_t = decltype(&TESForm::LookupByEditorID);
REL::Relocation<func_t> func{ Offset::TESForm::LookupByEditorID };
REL::Relocation<func_t> func{ ID::TESForm::LookupByEditorID };
return func(a_editorID);
}

Expand Down
1 change: 0 additions & 1 deletion CommonLibSF/include/RE/T/TESObjectLoadedEvent.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "RE/B/BSTEvent.h"
#include "RE/Offsets.h"

namespace RE
{
Expand Down
2 changes: 0 additions & 2 deletions CommonLibSF/include/RE/U/UI.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "RE/Offsets.h"

namespace RE
{
class IMenu;
Expand Down
2 changes: 1 addition & 1 deletion CommonLibSF/include/SFSE/Impl/PCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ namespace REL

#include "REL/REL.h"

#include "RE/Offsets.h"
#include "RE/IDs.h"
#include "RE/Offsets_NiRTTI.h"
#include "RE/Offsets_RTTI.h"
#include "RE/Offsets_VTABLE.h"
Expand Down
3 changes: 1 addition & 2 deletions CommonLibSF/src/RE/A/Actor.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include "RE/A/Actor.h"
#include "RE/Offsets.h"

namespace RE
{
bool Actor::IsHostileToActor(Actor* a_actor)
{
using func_t = decltype(&Actor::IsHostileToActor);
REL::Relocation<func_t> func{ Offset::Actor::IsHostileToActor };
REL::Relocation<func_t> func{ ID::Actor::IsHostileToActor };
return func(this, a_actor);
}
}
7 changes: 3 additions & 4 deletions CommonLibSF/src/RE/A/ActorEquipManager.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
#include "RE/A/ActorEquipManager.h"
#include "RE/Offsets.h"

namespace RE
{
ActorEquipManager* ActorEquipManager::GetSingleton()
{
REL::Relocation<ActorEquipManager**> singleton{ Offset::ActorEquipManager::singleton };
REL::Relocation<ActorEquipManager**> singleton{ ID::ActorEquipManager::singleton };
return *singleton;
}

bool ActorEquipManager::EquipObject(Actor* a_actor, const BGSObjectInstance& a_object, const BGSEquipSlot* a_slot, bool a_queueEquip, bool a_forceEquip, bool a_playSounds, bool a_applyNow, bool a_locked)
{
using func_t = decltype(&ActorEquipManager::EquipObject);
REL::Relocation<func_t> func{ Offset::ActorEquipManager::EquipObject };
REL::Relocation<func_t> func{ ID::ActorEquipManager::EquipObject };
return func(this, a_actor, a_object, a_slot, a_queueEquip, a_forceEquip, a_playSounds, a_applyNow, a_locked);
}

bool ActorEquipManager::UnequipObject(Actor* a_actor, const BGSObjectInstance& a_object, const BGSEquipSlot* a_slot, bool a_queueUnequip, bool a_forceUnequip, bool a_playSounds, bool a_applyNow, const BGSEquipSlot* a_slotBeingReplaced)
{
using func_t = decltype(&ActorEquipManager::UnequipObject);
REL::Relocation<func_t> func{ Offset::ActorEquipManager::UnequipObject };
REL::Relocation<func_t> func{ ID::ActorEquipManager::UnequipObject };
return func(this, a_actor, a_object, a_slot, a_queueUnequip, a_forceUnequip, a_playSounds, a_applyNow, a_slotBeingReplaced);
}
}
Loading