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

feat: add SF_HEAP_REDEFINE_NEW to some structs,Leveled object decoding, change baseListCount to std::uint8 and other RE #243

Merged
merged 21 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 16 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
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
3 changes: 3 additions & 0 deletions CommonLibSF/include/RE/B/BGSMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "RE/T/TESDescription.h"
#include "RE/T/TESForm.h"
#include "RE/T/TESFullName.h"
#include "RE/M/MemoryManager.h"
TommInfinite marked this conversation as resolved.
Show resolved Hide resolved

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

// members
BSFixedString text; // 00
BSFixedString unk08; // 08
Expand Down
17 changes: 16 additions & 1 deletion CommonLibSF/include/RE/B/BGSMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@ namespace RE::BGSMod
{
public:
// members
TommInfinite marked this conversation as resolved.
Show resolved Hide resolved
BSTArray<void*> includes; // 00
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);

BSTArray<Include> includes; // 00
BSTArray<void*> properties; // 10
TommInfinite marked this conversation as resolved.
Show resolved Hide resolved
};
static_assert(sizeof(Data) == 0x20);
Expand Down
10 changes: 5 additions & 5 deletions CommonLibSF/include/RE/B/BGSPlanetData.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ namespace RE

// 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
float unk38; // 38
float temperatureCelcius; //3C
float density; //40
float periAngleInDegrees;//44
std::uint32_t resourceCreationSpeed; // 48
TommInfinite marked this conversation as resolved.
Show resolved Hide resolved
};
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
4 changes: 4 additions & 0 deletions CommonLibSF/include/RE/T/TESFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ namespace RE
{
public:
SF_RTTI_VTABLE(TESFile);

std::uint8_t pad0[0x38];
char fileName[260];
//
qudix marked this conversation as resolved.
Show resolved Hide resolved
};
}
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
Loading