Skip to content

Commit 1323ad2

Browse files
committed
refactor: src restructuring
1 parent 104aba5 commit 1323ad2

51 files changed

Lines changed: 728 additions & 778 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.
File renamed without changes.
File renamed without changes.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ add_library(
3030
"${PROJECT_NAME}"
3131
STATIC
3232
${SOURCES}
33-
res/.clang-format
34-
res/CommonLibF4.natvis
33+
.clang-format
34+
res/commonlibf4.natvis
3535
)
3636

3737
add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}")

res/cmake/sourcelist.cmake

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,44 +1370,48 @@ set(SOURCES
13701370
src/F4SE/InputMap.cpp
13711371
src/F4SE/Interfaces.cpp
13721372
src/F4SE/Logger.cpp
1373-
src/RE/Bethesda/Actor.cpp
1374-
src/RE/Bethesda/BGSInventoryItem.cpp
1375-
src/RE/Bethesda/BSExtraData.cpp
1376-
src/RE/Bethesda/BSResource.cpp
1377-
src/RE/Bethesda/BSResource/Stream.cpp
1378-
src/RE/Bethesda/BSResource/StreamBase.cpp
1379-
src/RE/Bethesda/BSResourceNiBinaryStream.cpp
1380-
src/RE/Bethesda/BSScaleformManager.cpp
1381-
src/RE/Bethesda/BSScript.cpp
1382-
src/RE/Bethesda/BSScript/Array.cpp
1383-
src/RE/Bethesda/BSScript/Internal/VirtualMachine.cpp
1384-
src/RE/Bethesda/BSScript/Object.cpp
1385-
src/RE/Bethesda/BSScript/ObjectTypeInfo.cpp
1386-
src/RE/Bethesda/BSScript/PackedInstructionStream.cpp
1387-
src/RE/Bethesda/BSScript/StackFrame.cpp
1388-
src/RE/Bethesda/BSScript/Struct.cpp
1389-
src/RE/Bethesda/BSScript/StructTypeInfo.cpp
1390-
src/RE/Bethesda/BSScript/TypeInfo.cpp
1391-
src/RE/Bethesda/BSScript/Variable.cpp
1392-
src/RE/Bethesda/BSVisit.cpp
1393-
src/RE/Bethesda/CRC.cpp
1394-
src/RE/Bethesda/Calendar.cpp
1395-
src/RE/Bethesda/FormComponents.cpp
1396-
src/RE/Bethesda/IMenu.cpp
1397-
src/RE/Bethesda/MenuCursor.cpp
1398-
src/RE/Bethesda/PlayerCharacter.cpp
1399-
src/RE/Bethesda/TESBoundAnimObjects.cpp
1400-
src/RE/Bethesda/TESForms.cpp
1401-
src/RE/Bethesda/TESObjectREFRs.cpp
1373+
src/RE/A/Actor.cpp
1374+
src/RE/A/Array.cpp
1375+
src/RE/B/BGSInventoryItem.cpp
1376+
src/RE/B/BGSKeywordForm.cpp
1377+
src/RE/B/BGSLocation.cpp
1378+
src/RE/B/BGSObjectInstanceExtra.cpp
1379+
src/RE/B/BSResource.cpp
1380+
src/RE/B/BSResourceNiBinaryStream.cpp
1381+
src/RE/B/BSScaleformManager.cpp
1382+
src/RE/B/BSVisit.cpp
1383+
src/RE/C/Calendar.cpp
1384+
src/RE/E/ExtraInstanceData.cpp
14021385
src/RE/Fallout.cpp
1403-
src/RE/NetImmerse/NiAVObject.cpp
1404-
src/RE/NetImmerse/NiBinaryStream.cpp
1405-
src/RE/NetImmerse/NiMatrix3.cpp
1406-
src/RE/NetImmerse/NiObjectNET.cpp
1407-
src/RE/NetImmerse/NiPoint.cpp
1408-
src/RE/NetImmerse/NiRect.cpp
1409-
src/RE/NetImmerse/NiTransform.cpp
1410-
src/RE/Scaleform/GFx/GFx_Player.cpp
1386+
src/RE/G/GFxPlayer.cpp
1387+
src/RE/I/InventoryInterface.cpp
1388+
src/RE/M/MenuCursor.cpp
1389+
src/RE/N/NiAVObject.cpp
1390+
src/RE/N/NiBinaryStream.cpp
1391+
src/RE/N/NiMatrix3.cpp
1392+
src/RE/N/NiObjectNET.cpp
1393+
src/RE/N/NiPoint2.cpp
1394+
src/RE/N/NiPoint3.cpp
1395+
src/RE/N/NiPoint4.cpp
1396+
src/RE/N/NiRect.cpp
1397+
src/RE/N/NiTransform.cpp
1398+
src/RE/O/Object.cpp
1399+
src/RE/O/ObjectTypeInfo.cpp
1400+
src/RE/P/PackedInstructionStream.cpp
1401+
src/RE/P/PlayerCharacter.cpp
1402+
src/RE/S/StackFrame.cpp
1403+
src/RE/S/Stream.cpp
1404+
src/RE/S/StreamBase.cpp
1405+
src/RE/S/Struct.cpp
1406+
src/RE/S/StructTypeInfo.cpp
1407+
src/RE/T/TESFullName.cpp
1408+
src/RE/T/TESNPC.cpp
1409+
src/RE/T/TESObjectCELL.cpp
1410+
src/RE/T/TESValueForm.cpp
1411+
src/RE/T/TypeInfo.cpp
1412+
src/RE/V/Variable.cpp
1413+
src/RE/V/VirtualMachine.cpp
1414+
src/RE/W/WorkbenchMenuBase.cpp
14111415
src/REL/HookObject.cpp
14121416
src/REL/HookStore.cpp
14131417
src/REL/IAT.cpp
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#include "RE/Bethesda/Actor.h"
2-
3-
#include "RE/Bethesda/TESBoundAnimObjects.h"
4-
#include "RE/Bethesda/TESBoundObjects.h"
1+
#include "RE/A/Actor.h"
52

63
namespace RE
74
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "RE/Bethesda/BSScript/Array.h"
1+
#include "RE/A/Array.h"
22

33
namespace RE
44
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "RE/Bethesda/BGSInventoryItem.h"
1+
#include "RE/B/BGSInventoryItem.h"
22

33
namespace RE
44
{
Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
#include "RE/Bethesda/FormComponents.h"
2-
3-
#include "RE/Bethesda/BSTHashMap.h"
4-
#include "RE/Bethesda/FormUtil.h"
5-
#include "RE/Bethesda/TESBoundAnimObjects.h"
6-
#include "RE/Bethesda/TESForms.h"
1+
#include "RE/B/BGSKeywordForm.h"
72

83
namespace RE
94
{
@@ -91,56 +86,4 @@ namespace RE
9186
}
9287
return false;
9388
}
94-
95-
std::string_view TESFullName::GetFullName(const TESForm& a_form, bool a_strict)
96-
{
97-
if (const auto fullName = a_form.As<TESFullName>(); fullName) {
98-
const auto name = fullName->GetFullName();
99-
return name ? name : ""sv;
100-
} else {
101-
if (a_strict) {
102-
switch (a_form.GetFormType()) {
103-
case ENUM_FORM_ID::kKYWD: // BGSKeyword
104-
case ENUM_FORM_ID::kLCRT: // BGSLocationRefType
105-
case ENUM_FORM_ID::kAACT: // BGSAction
106-
case ENUM_FORM_ID::kLIGH: // TESObjectLIGH
107-
case ENUM_FORM_ID::kSTAT: // TESObjectSTAT
108-
case ENUM_FORM_ID::kSCOL: // BGSStaticCollection
109-
case ENUM_FORM_ID::kMSTT: // BGSMovableStatic
110-
case ENUM_FORM_ID::kFLST: // BGSListForm
111-
break;
112-
default:
113-
return ""sv;
114-
}
115-
}
116-
117-
const auto& map = GetSparseFullNameMap();
118-
const auto it = map.find(std::addressof(a_form));
119-
return it != map.end() ? it->second : ""sv;
120-
}
121-
}
122-
123-
void TESFullName::SetFullName(TESForm& a_form, std::string_view a_fullName)
124-
{
125-
const auto full = a_form.As<TESFullName>();
126-
if (full) {
127-
full->fullName = a_fullName;
128-
if (const auto actor = a_form.As<TESActorBase>(); actor) {
129-
actor->AddChange(CHANGE_TYPES::kActorBaseFullName);
130-
} else if (const auto cell = a_form.As<TESObjectCELL>(); cell) {
131-
cell->AddChange(CHANGE_TYPES::kCellFullname);
132-
} else {
133-
a_form.AddChange(CHANGE_TYPES::kBaseObjectFullName);
134-
}
135-
}
136-
}
137-
138-
void TESValueForm::SetFormValue(TESForm& a_form, std::int32_t a_value)
139-
{
140-
const auto val = a_form.As<TESValueForm>();
141-
if (val) {
142-
val->value = a_value;
143-
a_form.AddChange(CHANGE_TYPES::kBaseObjectValue);
144-
}
145-
}
14689
}

src/RE/B/BGSLocation.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "RE/B/BGSLocation.h"
2+
3+
namespace RE
4+
{
5+
bool BGSLocation::IsChild(const BGSLocation* a_possibleChild) const
6+
{
7+
if (a_possibleChild) {
8+
for (auto it = a_possibleChild->parentLoc; it; it = it->parentLoc) {
9+
if (this == it) {
10+
return true;
11+
}
12+
}
13+
}
14+
return false;
15+
}
16+
17+
bool BGSLocation::IsParent(const BGSLocation* a_possibleParent) const
18+
{
19+
if (a_possibleParent) {
20+
for (auto it = parentLoc; it; it = it->parentLoc) {
21+
if (a_possibleParent == it) {
22+
return true;
23+
}
24+
}
25+
}
26+
return false;
27+
}
28+
}

0 commit comments

Comments
 (0)