Skip to content

Commit

Permalink
feat: add SF_HEAP_REDEFINE_NEW to some structs, Leveled object decodi…
Browse files Browse the repository at this point in the history
…ng, change baseListCount to std::uint8 and other RE (#243)
  • Loading branch information
TommInfinite authored Apr 2, 2024
1 parent 6f870a4 commit 3ef44ee
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 16 deletions.
5 changes: 4 additions & 1 deletion CommonLibSF/include/RE/A/AVMData.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "RE/B/BSFixedString.h"
#include "RE/C/Color.h"
#include "RE/M/MemoryManager.h"

namespace RE
{
Expand All @@ -18,10 +19,12 @@ namespace RE

struct Entry
{
SF_HEAP_REDEFINE_NEW(AVMData::Entry);

BSFixedString name; // 00
BSFixedString texturePath; // 08
Color color; // 10
std::uint32_t intensity; // 14
std::uint32_t intensity; // 14 In existing game entries is set to 64 for AVMD(confirmed for BGSAVMData(form) )
};

// members
Expand Down
4 changes: 4 additions & 0 deletions CommonLibSF/include/RE/B/BGSMessage.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#pragma once

#include "RE/B/BSTArray.h"
#include "RE/M/MemoryManager.h"
#include "RE/T/TESCondition.h"
#include "RE/T/TESDescription.h"
#include "RE/T/TESForm.h"
#include "RE/T/TESFullName.h"


namespace RE
{
class TESObjectREFR;
Expand All @@ -30,6 +32,8 @@ namespace RE
struct MESSAGEBOX_BUTTON
{
public:
SF_HEAP_REDEFINE_NEW(MESSAGEBOX_BUTTON);

// members
BSFixedString text; // 00
BSFixedString unk08; // 08
Expand Down
20 changes: 18 additions & 2 deletions CommonLibSF/include/RE/B/BGSMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,25 @@ namespace RE::BGSMod
struct Data
{
public:

enum class IncludesFlag
{
kNone = 0,
kOptional = 1 << 0,
kDontUseAll = 1 << 1
};

struct Include
{
RE::BGSMod::Attachment::Mod* mod;
std::uint8_t level;
stl::enumeration<IncludesFlag, std::uint8_t> flags;
};
static_assert(sizeof(Include) == 0x10);

// members
BSTArray<void*> includes; // 00
BSTArray<void*> properties; // 10
BSTArray<Include> includes; // 00
BSTArray<void*> properties; // 10
};
static_assert(sizeof(Data) == 0x20);

Expand Down
12 changes: 6 additions & 6 deletions CommonLibSF/include/RE/B/BGSPlanetData.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ namespace RE
~PlanetData() override; // 00

// members
BGSSurface::Tree* surfaceTree; // 30
std::uint64_t unk38; // 38
std::uint32_t unk40; // 40
std::uint32_t unk44; // 44
std::uint32_t unk48; // 48
std::uint32_t unk4C; // 4C
BGSSurface::Tree* surfaceTree; // 30
float unk38; // 38
float temperatureCelcius; // 3C
float density; // 40
float periAngleInDegrees; // 44
std::uint32_t resourceCreationSpeed; // 48
};
static_assert(sizeof(PlanetData) == 0x50);
}
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/E/EffectItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace RE
class EffectItem
{
public:
SF_HEAP_REDEFINE_NEW(EffectItem);

// members
EffectItemData data; // 00
EffectSetting* effectSetting; // 10
Expand Down
4 changes: 2 additions & 2 deletions CommonLibSF/include/RE/S/Script.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ namespace RE

enum
{
kNumConsoleCommands = 0x0245,
kNumScriptCommands = 0x03C0,
kNumConsoleCommands = 0x0244,
kNumScriptCommands = 0x03C1,

kConsoleOpBase = 0x0100,
kScriptOpBase = 0x1000,
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/T/TESContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace RE
struct ContainerObject
{
public:
SF_HEAP_REDEFINE_NEW(ContainerObject);

// members
std::int32_t count; // 00
TESBoundObject* obj; // 08
Expand Down
3 changes: 3 additions & 0 deletions CommonLibSF/include/RE/T/TESFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ namespace RE
{
public:
SF_RTTI_VTABLE(TESFile);

std::uint8_t pad0[0x38]; //0
char fileName[260]; //38
};
}
8 changes: 5 additions & 3 deletions CommonLibSF/include/RE/T/TESLeveledList.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ namespace RE
struct LEVELED_OBJECT
{
public:
SF_HEAP_REDEFINE_NEW(LEVELED_OBJECT);

// members
TESForm* form; // 00
ContainerItemExtra* itemExtra; // 08
TESCondition* conditions; // 10
std::uint16_t count; // 18
std::uint16_t level; // 1A
std::uint8_t unk1C; // 1C
std::uint8_t chanceNone; // 1C
std::uint8_t unk1D; // 1D
};
static_assert(sizeof(LEVELED_OBJECT) == 0x20);
Expand Down Expand Up @@ -65,11 +67,11 @@ namespace RE
BSTArray<BSTTuple3<TESForm*, BGSCurveForm, BGSTypedFormValuePair::SharedVal>>* keywordChances; // 30
LEVELED_OBJECT* leveledLists; // 38
LEVELED_OBJECT** scriptAddedLists; // 40
std::int8_t scriptListCount; // 48
std::int8_t scriptListCount; // 48
std::uint32_t unk4C; // 4C
stl::enumeration<Flag, std::uint8_t> flags; // 50
std::uint8_t unk51; // 51
std::int8_t baseListCount; // 52
std::uint8_t baseListCount; // 52
std::uint8_t unk53; // 53
std::uint8_t unk54; // 54
BSFixedString overrideName; // 58
Expand Down
9 changes: 8 additions & 1 deletion CommonLibSF/include/RE/T/TESNPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ namespace RE
[[nodiscard]] bool HasKeyword(std::string_view a_editorID);
[[nodiscard]] bool IsInFaction(TESFaction* a_faction) const;

struct MorphWeight
{
float thin;
float muscular;
float fat;
};

// members
BGSAttachParentArray attachParents; // 2E8
std::uint32_t unk308; // 308
Expand All @@ -66,7 +73,7 @@ namespace RE
std::uint32_t unk334; // 334
TESRace* originalRace; // 338
TESNPC* faceNPC; // 340
NiPoint3 morphWeight; // 348
MorphWeight morphWeight; // 348
float height; // 354
float heightMax; // 358
std::uint32_t unk35C; // 35C
Expand Down
9 changes: 8 additions & 1 deletion CommonLibSF/include/RE/T/TESRace.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ namespace RE
class TESObjectWEAP;
class TESQuest;

struct MorphWeight
{
float thin;
float muscular;
float fat;
};

struct RACE_DATA
{
std::uint32_t unk00; // 00
Expand All @@ -58,7 +65,7 @@ namespace RE
std::uint32_t unk58; // 58
std::uint32_t unk5C; // 5C
float height[SEXES::kTotal]; // 60
NiPoint3 weight[SEXES::kTotal]; // 68
MorphWeight weight[SEXES::kTotal]; // 68
std::uint64_t unk80; // 80
std::int32_t unk88; // 88
std::int32_t unk8C; // 8C
Expand Down

0 comments on commit 3ef44ee

Please sign in to comment.