Skip to content
Draft
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
22 changes: 22 additions & 0 deletions include/RE/A/AIProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "RE/B/BSSimpleList.h"
#include "RE/D/DEFAULT_OBJECT.h"
#include "RE/N/NiPoint3.h"
#include "RE/R/RESET_3D_FLAGS.h"

namespace RE
{
Expand Down Expand Up @@ -177,6 +178,27 @@ namespace RE
return func(this);
}

void Set3DUpdateFlag(RESET_3D_FLAGS a_flags)
{
using func_t = decltype(&AIProcess::Set3DUpdateFlag);
static REL::Relocation<func_t> func{ ID::AIProcess::Set3DUpdateFlag };
return func(this, a_flags);
}

void Apply3DUpdateFlag(Actor* a_actor, RESET_3D_FLAGS a_flags)
{
using func_t = decltype(&AIProcess::Apply3DUpdateFlag);
static REL::Relocation<func_t> func{ ID::AIProcess::Apply3DUpdateFlag };
return func(this, a_actor, a_flags);
}

void Update3DModel(Actor* a_actor, bool a_queueUpdate)
{
using func_t = decltype(&AIProcess::Update3DModel);
static REL::Relocation<func_t> func{ ID::AIProcess::Update3DModel };
return func(this, a_actor, a_queueUpdate);
}

// members
MiddleLowProcessData* middleLow; // 00
MiddleHighProcessData* middleHigh; // 08
Expand Down
80 changes: 75 additions & 5 deletions include/RE/B/BGSCharacterTint.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,16 @@ namespace RE
kTakesSkinTone = 0x4
};

virtual ~Entry(); // 00
Entry() { REX::EMPLACE_VTABLE(this); }
virtual ~Entry() = default; // 00

F4_HEAP_REDEFINE_NEW(Entry);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LooksMenu needs to construct new instances of these entries, thus I added the new operators and made the parent class non-abstract.


// add
virtual float GetDefaultValue() { return 0.0F; } // 01
virtual void InitItem(TESForm* a_owner); // 02
virtual void CopyData(BGSCharacterTint::Template::Entry* a_copy); // 03
virtual void LoadImpl(TESFile* a_file) = 0; // 04
virtual void LoadImpl(TESFile* a_file); // 04

// members
BGSLocalizedString name; // 08
Expand All @@ -92,6 +95,9 @@ namespace RE
class Group
{
public:
Entry* GetTemplateBySlot(BGSCharacterTint::EntrySlot a_slot);
Entry* GetTemplateByUniqueID(std::uint16_t a_id);

// members
BGSLocalizedString name; // 00
std::uint32_t id; // 08
Expand All @@ -103,18 +109,39 @@ namespace RE
class Groups
{
public:
Entry* GetTemplateBySlot(BGSCharacterTint::EntrySlot a_slot);
Entry* GetTemplateByUniqueID(std::uint16_t a_id);

// members
BSTArray<Group*> groups; // 00
};
static_assert(sizeof(Groups) == 0x18);

class __declspec(novtable) Mask :
public Entry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__Template__Mask };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Template__Mask };

Mask() { REX::EMPLACE_VTABLE(this); }

// Members
BSFixedString maskTextureName;
BGSCharacterTint::BlendOp blendOp;
std::uint32_t unk2C;
};
static_assert(sizeof(Mask) == 0x30);

class __declspec(novtable) Palette :
public Entry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__Template__Palette };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Template__Palette };

Palette() { REX::EMPLACE_VTABLE(this); }

class ColorValue
{
public:
Expand All @@ -125,12 +152,32 @@ namespace RE
};
static_assert(sizeof(ColorValue) == 0x18);

ColorValue* GetColorDataBySwatchID(std::uint16_t a_id);

// Members
BSFixedString maskTextureName;
std::uint32_t defaultIndex;
BSTArray<ColorValue> colorValues;
};
static_assert(sizeof(Palette) == 0x48);

class __declspec(novtable) TextureSet :
public Entry
{
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__Template__TextureSet };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Template__TextureSet };

TextureSet() { REX::EMPLACE_VTABLE(this); }

// Members
BSFixedString diffuse;
BSFixedString normal;
BSFixedString specular;
BGSCharacterTint::BlendOp blendOp;
float defaultValue;
};
static_assert(sizeof(TextureSet) == 0x40);
}

class __declspec(novtable) Entry
Expand All @@ -139,14 +186,21 @@ namespace RE
static constexpr auto RTTI{ RTTI::BGSCharacterTint__Entry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Entry };

virtual ~Entry(); // 00
Entry() { REX::EMPLACE_VTABLE(this); }
virtual ~Entry() = default; // 00

F4_HEAP_REDEFINE_NEW(Entry);

virtual bool GetIsIdentical(const Entry* entry); // 08
virtual bool CopyData(const Entry entry); // 10
virtual bool SetFromTemplateDefault(const Template::Entry* entry); // 18
virtual bool GetMatchesTemplateDefault(const Template::Entry* entry); // 20
virtual EntryType GetType(); // 28

[[nodiscard]] static Entry* CreateCharacterTintEntry(std::uint32_t a_id) noexcept;
static void ClearCharacterTints(class Entries* a_src) noexcept;
static void CopyCharacterTints(class Entries* a_dst, class Entries* a_src) noexcept;

// Members
Entry* templateEntry; // 08
std::uint16_t idLink; // 10
Expand All @@ -167,6 +221,8 @@ namespace RE
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__MaskEntry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__MaskEntry };

MaskEntry() { REX::EMPLACE_VTABLE(this); }
};
static_assert(sizeof(MaskEntry) == 0x18);

Expand All @@ -177,9 +233,21 @@ namespace RE
static constexpr auto RTTI{ RTTI::BGSCharacterTint__PaletteEntry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__PaletteEntry };

PaletteEntry() { REX::EMPLACE_VTABLE(this); }

// members
std::uint32_t tintingColor; // 18
std::uint16_t swatchID; // 1C
union
{
struct
{
std::uint8_t r;
std::uint8_t g;
std::uint8_t b;
std::uint8_t x;
} tintingChannels;
std::uint32_t tintingColor;
}; // 18
std::uint16_t swatchID; // 1C
};
static_assert(sizeof(PaletteEntry) == 0x20);

Expand All @@ -189,6 +257,8 @@ namespace RE
public:
static constexpr auto RTTI{ RTTI::BGSCharacterTint__TextureSetEntry };
static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__TextureSetEntry };

TextureSetEntry() { REX::EMPLACE_VTABLE(this); }
};
static_assert(sizeof(TextureSetEntry) == 0x18);
}
Expand Down
14 changes: 14 additions & 0 deletions include/RE/B/BGSChargenUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ namespace RE
};
static_assert(sizeof(UndoData) == 0x70);

[[nodiscard]] static BGSChargenUtils* GetSingleton()
{
static REL::Relocation<std::uint32_t*> characterIndex{ ID::BGSChargenUtils::CharacterIndex };
static REL::Relocation<BGSChargenUtils***> singleton{ ID::BGSChargenUtils::Singleton };
return *singleton ? (*singleton)[*characterIndex] : nullptr;
}

void LoadPreset(std::uint32_t a_presetIndex)
{
using func_t = decltype(&BGSChargenUtils::LoadPreset);
static REL::Relocation<func_t> func{ ID::BGSChargenUtils::LoadPreset };
return func(this, a_presetIndex);
}

// members
Actor* targetActor; // 058
TESNPC* targetNPC; // 060
Expand Down
7 changes: 7 additions & 0 deletions include/RE/B/BGSColorForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ namespace RE
// members
union
{
struct
{
std::uint8_t r;
std::uint8_t g;
std::uint8_t b;
std::uint8_t x;
} channels;
std::uint32_t color;
float remappingIndex;
}; // 30
Expand Down
9 changes: 9 additions & 0 deletions include/RE/B/BGSInventoryItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ namespace RE
[[nodiscard]] std::uint32_t GetCount() const noexcept { return count; }
[[nodiscard]] bool IsEquipped() const noexcept { return flags.any(Flag::kSlotMask); }

bool Visit(const std::function<bool(Stack*)> f)
{
if (f(this) && nextStack)
return nextStack->Visit(f);
return true; // Continue
}

// members
BSTSmartPointer<Stack> nextStack; // 10
BSTSmartPointer<ExtraDataList> extra; // 18
Expand Down Expand Up @@ -252,4 +259,6 @@ namespace RE
BSTSmartPointer<Stack> stackData; // 08
};
static_assert(sizeof(BGSInventoryItem) == 0x10);

REX_DEFINE_ENUM_CLASS_FLAGS(BGSInventoryItem::Stack::Flag);
}
43 changes: 43 additions & 0 deletions include/RE/B/BSEffectShaderMaterial.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#pragma once

#include "RE/B/BSShaderMaterial.h"

namespace RE
{
class __declspec(novtable) BSEffectShaderMaterial :
public BSShaderMaterial // 00
{
public:
static constexpr auto RTTI{ RTTI::BSEffectShaderMaterial };
static constexpr auto VTABLE{ VTABLE::BSEffectShaderMaterial };

// members
float falloffStartAngle; // 38
float falloffStopAngle; // 3C
float falloffStartOpacity; // 40
float falloffStopOpacity; // 44
NiColorA baseColor; // 48 - Alpha is Material Alpha
NiPointer<NiTexture> baseTexture; // 58
NiPointer<NiTexture> grayscaleTexture; // 60
NiPointer<NiTexture> environmentMapTexture; // 68
NiPointer<NiTexture> environmentMapMaskTexture; // 70
NiPointer<NiTexture> normalTexture; // 78
float softDepth; // 80
float baseColorScale; // 84
BSFixedString baseTextureName; // 88
BSFixedString grayscaleTextureName; // 90
BSFixedString envMapTextureName; // 98
BSFixedString envMapMaskTextureName; // A0
BSFixedString normalTextureName; // A8
union
{
float environmentMaskScale; // B0
float refractionPower; // B0 - Needs kShaderFlags_Refraction
};
std::uint8_t uTextureClampMode; // B4
std::uint8_t uLightingInfluence; // B5 - divided by 255
std::uint8_t uEnvironmentMapMinLOD; // B6
std::uint8_t unkB7; // B7

@ZenoArrows ZenoArrows Aug 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I based the names on F4SE for now, should be double-checked and ideally figure out what unkB7 is.

};
static_assert(sizeof(BSEffectShaderMaterial) == 0xB8);
}
39 changes: 39 additions & 0 deletions include/RE/B/BSEffectShaderProperty.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

#include "RE/B/BSShaderProperty.h"
#include "RE/N/NiColor.h"

namespace RE
{
class BSParticleShaderCubeEmitter;

class __declspec(novtable) BSEffectShaderProperty :
public BSShaderProperty // 00
{
public:
static constexpr auto RTTI{ RTTI::BSEffectShaderProperty };
static constexpr auto VTABLE{ VTABLE::BSEffectShaderProperty };
static constexpr auto Ni_RTTI{ Ni_RTTI::BSEffectShaderProperty };

BSEffectShaderProperty()
{
REX::EMPLACE_VTABLE(this);
ctor();
}

// members
BSParticleShaderCubeEmitter* envCubeEmitter; // 70
NiColor* externalEmitColor; // 78
std::uint32_t baseTextureIndex; // 80
float unk84; // 84

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I based the names on F4SE for now, should be double-checked and ideally figure out what unk84 is.


private:
void ctor()
{
using func_t = decltype(&BSEffectShaderProperty::ctor);
static REL::Relocation<func_t> func{ ID::BSEffectShaderProperty::ctor };
return func(this);
}
};
static_assert(sizeof(BSEffectShaderProperty) == 0x88);
}
16 changes: 16 additions & 0 deletions include/RE/B/BSFaceGenUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

namespace RE
{
struct BSFaceGenPendingHeadData;

namespace BSTextureArray
{
class StaticTextureIndexed;
Expand All @@ -23,5 +25,19 @@ namespace RE
std::uint32_t stamp; // 234
};
static_assert(sizeof(FaceGenData) == 0x238);

inline void StartFaceCustomizationGenerationForNPC(TESNPC* a_npc, const BSTArray<BGSCharacterTint::Entry*>& a_entries, FaceGenData* a_faceGenData, void* a_customizationBuffer, std::uint32_t a_uiLoadingPriority, bool a_bForceMaxLayers)
{
using func_t = decltype(&BSFaceGenUtils::StartFaceCustomizationGenerationForNPC);
static REL::Relocation<func_t> func{ ID::BSFaceGenUtils::StartFaceCustomizationGenerationForNPC };
func(a_npc, a_entries, a_faceGenData, a_customizationBuffer, a_uiLoadingPriority, a_bForceMaxLayers);
}

inline void PrepareHeadPartForShaders(BSFaceGenNiNode* a_node, BGSHeadPart* a_headPart, TESNPC* a_npc, BSFaceGenPendingHeadData* a_pendingHeadData)
{
using func_t = decltype(&BSFaceGenUtils::PrepareHeadPartForShaders);
static REL::Relocation<func_t> func{ ID::BSFaceGenUtils::PrepareHeadPartForShaders };
func(a_node, a_headPart, a_npc, a_pendingHeadData);
}
}
}
2 changes: 1 addition & 1 deletion include/RE/B/BSGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RE
{
namespace BSSkin
{
class Instance;
class Instance : public NiObject {};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LooksMenu doesn't actually interact with this object other than assigning it from one class to another, but that does mean we need a stub implementation that'll at least allow us to track the reference count.

}

class BSCombinedTriShape;
Expand Down
Loading