Skip to content

Commit

Permalink
Misc RE
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Apr 21, 2024
1 parent 26015a0 commit 5306dc2
Show file tree
Hide file tree
Showing 27 changed files with 305 additions and 100 deletions.
2 changes: 2 additions & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,7 @@ set(SOURCES
include/RE/I/IngredientItem.h
include/RE/I/InputDevices.h
include/RE/I/InputEvent.h
include/RE/I/InterfaceLightSchemes.h
include/RE/I/InterfaceStrings.h
include/RE/I/InteriorData.h
include/RE/I/Inventory.h
Expand Down Expand Up @@ -1220,6 +1221,7 @@ set(SOURCES
include/RE/N/NiAllocator.h
include/RE/N/NiAlphaProperty.h
include/RE/N/NiAnimationKey.h
include/RE/N/NiBillboardNode.h
include/RE/N/NiBinaryStream.h
include/RE/N/NiBoneMatrixSetterI.h
include/RE/N/NiBooleanExtraData.h
Expand Down
4 changes: 2 additions & 2 deletions include/RE/B/BSLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ namespace RE
std::uint32_t unk040; // 040
bool pointLight; // 044
bool ambientLight; // 045
bool unk046; // 046
bool dynamic; // 046
bool portalStrict; // 047
NiPointer<NiLight> light; // 048
NiPoint3 worldTranslate; // 050
std::uint32_t unk05C; // 05C
std::uint8_t unk060; // 060
bool affectLand; // 061
std::uint8_t unk062; // 062
bool affectWater; // 062
bool neverFades; // 063
std::uint32_t unk064; // 064
std::uint64_t unk068; // 068
Expand Down
2 changes: 1 addition & 1 deletion include/RE/C/CombatController.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace RE
bool ignoringCombat; // 42
bool inactive; // 43
AITimer unk44; // 44
float unk4C; // 4C
float lowMovementDelta; // 4C
BSTArray<CombatAimController*> aimControllers; // 50
#ifdef SKYRIM_SUPPORT_AE
mutable BSSpinLock aimControllerLock; // 68
Expand Down
6 changes: 3 additions & 3 deletions include/RE/C/CombatGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ namespace RE
BSPathingLOSGridMap* gridMap; // 0E0
AITimer searchUpdateTimer; // 0E8
AITimer searchAreaUpdateTimer; // 0F0
AITimeStamp unkF8; // 0F8
AITimeStamp searchStartedTimeStamp; // 0F8
ActorHandle targetToSearchFor; // 0FC
BGSWorldLocation searchTargetLoc; // 100
float searchRadius; // 118
std::uint32_t unk11C; // 11C
std::uint32_t pad11C; // 11C
BSTArray<CombatSearchLocation> searchLocations; // 120
BSTArray<CombatSearchDoor> searchDoors; // 138
std::uint32_t unk150; // 150 - count
std::uint32_t initializedMemberCount; // 150 - count
std::uint32_t fleeCount; // 154
std::uint32_t fightCount; // 158
std::uint8_t musicState; // 15C
Expand Down
27 changes: 14 additions & 13 deletions include/RE/C/CombatManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "RE/A/AITimeStamp.h"
#include "RE/A/AITimer.h"
#include "RE/B/BSAtomic.h"
#include "RE/B/BSPointerHandle.h"
#include "RE/B/BSTHashMap.h"
#include "RE/N/NiSmartPointer.h"
#include "RE/N/NiTArray.h"
Expand Down Expand Up @@ -30,19 +31,19 @@ namespace RE
}

// members
NiTPrimitiveArray<CombatGroup*> combatGroups; // 00
mutable BSReadWriteLock lock; // 18
std::uint64_t unk20; // 20
CombatThreatMap* combatThreatMap; // 28
std::uint64_t unk30; // 30
std::uint64_t unk38; // 38
std::uint64_t unk40; // 40
float unk48; // 48
AITimer musicStopTimer; // 4C
AITimer musicUpdateTimer; // 54
std::uint32_t combatCount; // 5C
std::uint32_t groupCount; // 60
std::uint32_t unk64; // 64
NiTPrimitiveArray<CombatGroup*> combatGroups; // 00
mutable BSReadWriteLock lock; // 18
BSTHashMap<ActorHandle, std::uint64_t>* localActorTargetingMap; // 20
CombatThreatMap* combatThreatMap; // 28
std::uint64_t unk30; // 30
std::uint64_t unk38; // 38
std::uint64_t unk40; // 40
AITimeStamp musicStartedTimeStamp; // 48
AITimer musicStopTimer; // 4C
AITimer musicUpdateTimer; // 54
std::uint32_t combatCount; // 5C
std::uint32_t groupCount; // 60
std::uint32_t unk64; // 64
};
static_assert(sizeof(CombatManager) == 0x68);
}
1 change: 1 addition & 0 deletions include/RE/C/ConstructibleObjectMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace RE
{
public:
inline static constexpr auto RTTI = RTTI_CraftingSubMenus__ConstructibleObjectMenu;
inline static constexpr auto VTABLE = VTABLE_CraftingSubMenus__ConstructibleObjectMenu;

class CreationConfirmCallback : public IMessageBoxCallback
{
Expand Down
1 change: 1 addition & 0 deletions include/RE/C/CraftingMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace RE
{
public:
inline static constexpr auto RTTI = RTTI_CraftingMenu;
inline static constexpr auto VTABLE = VTABLE_CraftingMenu;
constexpr static std::string_view MENU_NAME = "Crafting Menu";

~CraftingMenu() override; // 00
Expand Down
8 changes: 8 additions & 0 deletions include/RE/C/CraftingSubMenu.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "RE/A/ActorValues.h"
#include "RE/B/BSFixedString.h"
#include "RE/B/BSTEvent.h"
#include "RE/F/FxDelegateHandler.h"
Expand Down Expand Up @@ -31,6 +32,13 @@ namespace RE
virtual void Unk_06(void); // 06 - { return; }
virtual void SetItemCardInfo(ItemCard* a_itemCard); // 07 - { return; }

void UpdateCraftingInfo(ActorValue a_actorValue)
{
using func_t = decltype(&UpdateCraftingInfo);
REL::Relocation<func_t> func{ RELOCATION_ID(50461, 51364) };
return func(this, a_actorValue);
}

// members
GFxMovieView* view; // 018
TESFurniture* furniture; // 020
Expand Down
18 changes: 18 additions & 0 deletions include/RE/I/InterfaceLightSchemes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

namespace RE
{
enum class INTERFACE_LIGHT_SCHEME
{
kJournal = 0,
kInventory,
kInventoryMagic,
kBook,
kLoading,
kUnk05,
kStats,
kLockpicking,

kTotal = 8
};
}
55 changes: 29 additions & 26 deletions include/RE/I/Inventory3DManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "RE/B/BSTSingleton.h"
#include "RE/B/BSTSmartPointer.h"
#include "RE/E/ExtraDataList.h"
#include "RE/I/InterfaceLightSchemes.h"
#include "RE/M/MenuEventHandler.h"
#include "RE/N/NiPoint3.h"
#include "RE/N/NiSmartPointer.h"
Expand All @@ -20,10 +21,11 @@ namespace RE
{
public:
// members
TESForm* itemBase; // 00 - smart ptr
TESBoundObject* modelObj; // 08
NiPointer<NiAVObject> spModel; // 10
std::uint64_t unk18; // 18
TESForm* itemBase; // 00 - smart ptr
TESBoundObject* modelObj; // 08
NiPointer<NiAVObject> spModel; // 10
INTERFACE_LIGHT_SCHEME lightScheme; // 18
float boundRadius; // 1C
};
static_assert(sizeof(LoadedInventoryModel) == 0x20);

Expand All @@ -36,30 +38,31 @@ namespace RE

static Inventory3DManager* GetSingleton();

void UpdateItem3D(InventoryEntryData* a_objDesc);
void UpdateMagic3D(TESForm* a_form, std::uint32_t a_arg2);
void Clear3D();
std::uint32_t Render();
void UpdateItem3D(InventoryEntryData* a_objDesc);
void UpdateMagic3D(TESForm* a_form, std::uint32_t a_arg2);
void Clear3D();
void Render();
bool ToggleItemZoom();

// members
std::uint8_t unk011; // 011
std::uint16_t unk012; // 012
NiPoint3 itemPosCopy; // 014
NiPoint3 itemPos; // 020
float itemScaleCopy; // 02C
float itemScale; // 030
std::uint32_t unk034; // 034
TESObjectREFR* tempRef; // 038
ExtraDataList originalExtra; // 040
BSTSmallArray<LoadedInventoryModel, 7> loadedModels; // 058
std::uint32_t unk148; // 148
float zoomProgress; // 14C - 1 if zoomed in, 0 if not, in-between during transition
BSTSmartPointer<NewInventoryMenuItemLoadTask> loadTask; // 150
std::uint8_t unk158; // 158
std::uint8_t unk159; // 159
std::uint8_t unk15A; // 15A
std::uint8_t pad15B; // 15B
std::uint32_t pad15C; // 15C
std::uint8_t unk011; // 011
std::uint16_t unk012; // 012
NiPoint3 itemPosCopy; // 014
NiPoint3 itemPos; // 020
float itemScaleCopy; // 02C
float itemScale; // 030
INTERFACE_LIGHT_SCHEME currentLightScheme; // 034 - kInventory or kInventoryMagic
TESObjectREFR* tempRef; // 038
ExtraDataList originalExtra; // 040
BSTSmallArray<LoadedInventoryModel, 7> loadedModels; // 058
float zoomDistance; // 148
float zoomProgress; // 14C - 1 if zoomed in, 0 if not, in-between during transition
BSTSmartPointer<NewInventoryMenuItemLoadTask> loadTask; // 150
bool enableUserInput; // 158
std::uint8_t unk159; // 159
bool startedZoom; // 15A
std::uint8_t pad15B; // 15B
std::uint32_t pad15C; // 15C
};
#ifndef SKYRIM_SUPPORT_AE
static_assert(sizeof(Inventory3DManager) == 0x160);
Expand Down
1 change: 1 addition & 0 deletions include/RE/M/MagicMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace RE
{
public:
inline static constexpr auto RTTI = RTTI_MagicMenu;
inline static constexpr auto VTABLE = VTABLE_MagicMenu;
constexpr static std::string_view MENU_NAME = "MagicMenu";

~MagicMenu() override; // 00
Expand Down
57 changes: 57 additions & 0 deletions include/RE/N/NiBillboardNode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#include "RE/N/NiNode.h"

namespace RE
{
class NiBillboardNode : public NiNode
{
public:
inline static constexpr auto RTTI = RTTI_NiBillboardNode;
inline static constexpr auto Ni_RTTI = NiRTTI_NiBillboardNode;

enum
{
FACE_MODE_POS = 0,
FACE_MODE_MASK = 7,
};

enum class FaceMode
{
kAlwaysFaceCamera,
kRotateAboutUp,
kRigidFaceCamera,
kAlwaysFaceCenter,
kRigidFaceCenter,
kBSRotateAboutUp
};

~NiBillboardNode() override; // 00

// override (NiNode)
const NiRTTI* GetRTTI() const override; // 02
NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17
void LoadBinary(NiStream& a_stream) override; // 18
void LinkObject(NiStream& a_stream) override; // 19
bool RegisterStreamables(NiStream& a_stream) override; // 1A
void SaveBinary(NiStream& a_stream) override; // 1B
bool IsEqual(NiObject* a_object) override; // 1C
void UpdateWorldBound() override; // 2F
void UpdateWorldData(NiUpdateData* a_data) override; // 30
void OnVisible(NiCullingProcess& a_process) override; // 34

[[nodiscard]] FaceMode GetMode() const
{
return static_cast<FaceMode>(userFlags & FACE_MODE_MASK);
}

void SetMode(FaceMode a_mode)
{
userFlags = (std::to_underlying(a_mode) << FACE_MODE_POS) | userFlags & ~FACE_MODE_MASK;
}

// members
std::uint16_t userFlags; // 128
};
static_assert(sizeof(NiBillboardNode) == 0x130);
}
2 changes: 2 additions & 0 deletions include/RE/N/NiCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ namespace RE
void UpdateWorldBound() override; // 2F - { return; }
void UpdateWorldData(NiUpdateData* a_data) override; // 30

bool WorldPtToScreenPt3(const NiPoint3& a_point, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance);

static bool BoundInFrustum(const NiBound& a_bound, NiCamera* a_camera);
static bool NodeInFrustum(NiAVObject* a_node, NiCamera* a_camera);
static bool PointInFrustum(const NiPoint3& a_point, NiCamera* a_camera, float a_radius);
Expand Down
2 changes: 1 addition & 1 deletion include/RE/N/NiLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace RE
NiColor diffuse; // 11C
NiPoint3 radius; // 128
float fade; // 134
std::uint32_t unk138; // 138
std::uint64_t unk138; // 138
};
static_assert(sizeof(NiLight) == 0x140);
}
1 change: 1 addition & 0 deletions include/RE/N/NiPoint3.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace RE
const float& operator[](std::size_t a_idx) const;
bool operator==(const NiPoint3& a_rhs) const;
bool operator!=(const NiPoint3& a_rhs) const;
bool operator<(const NiPoint3& a_rhs) const;
NiPoint3 operator+(const NiPoint3& a_rhs) const;
NiPoint3 operator-(const NiPoint3& a_rhs) const;
float operator*(const NiPoint3& a_rhs) const;
Expand Down
27 changes: 27 additions & 0 deletions include/RE/N/NiPointLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "RE/N/NiLight.h"

#include "RE/M/MemoryManager.h"

namespace RE
{
class NiPointLight : public NiLight
Expand All @@ -19,10 +21,35 @@ namespace RE
void SaveBinary(NiStream& a_stream) override; // 1B
bool IsEqual(NiObject* a_object) override; // 1C

static NiPointLight* Create()
{
auto light = malloc<NiPointLight>();
std::memset(light, 0, sizeof(NiPointLight));
if (light) {
light->Ctor();
}
return light;
}

void SetLightAttenuation(float a_radius)
{
using func_t = decltype(&NiPointLight::SetLightAttenuation);
REL::Relocation<func_t> func{ RELOCATION_ID(17224, 17626) };
return func(this, a_radius);
}

// members
float constAttenuation; // 140
float linearAttenuation; // 144
float quadraticAttenuation; // 148

private:
NiPointLight* Ctor()
{
using func_t = decltype(&NiPointLight::Ctor);
REL::Relocation<func_t> func{ RELOCATION_ID(69583, 70967) };
return func(this);
}
};
static_assert(sizeof(NiPointLight) == 0x150);
}
Loading

0 comments on commit 5306dc2

Please sign in to comment.