Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Jan 25, 2025
1 parent d2479a4 commit d5f9c62
Show file tree
Hide file tree
Showing 19 changed files with 301 additions and 45 deletions.
3 changes: 3 additions & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,7 @@ set(SOURCES
include/RE/I/ItemCrafted.h
include/RE/I/ItemHarvested.h
include/RE/I/ItemList.h
include/RE/I/ItemRemoveReason.h
include/RE/I/ItemsPickpocketed.h
include/RE/J/JournalMenu.h
include/RE/J/JournalTab.h
Expand Down Expand Up @@ -1272,6 +1273,7 @@ set(SOURCES
include/RE/N/NiControllerManager.h
include/RE/N/NiControllerSequence.h
include/RE/N/NiCullingProcess.h
include/RE/N/NiDirectionalLight.h
include/RE/N/NiExtraData.h
include/RE/N/NiFile.h
include/RE/N/NiFloatData.h
Expand Down Expand Up @@ -1322,6 +1324,7 @@ set(SOURCES
include/RE/N/NiStream.h
include/RE/N/NiStringExtraData.h
include/RE/N/NiStringsExtraData.h
include/RE/N/NiSwitchNode.h
include/RE/N/NiSystem.h
include/RE/N/NiTArray.h
include/RE/N/NiTCollection.h
Expand Down
7 changes: 7 additions & 0 deletions include/RE/B/BGSSaveLoadGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ namespace RE
return func(this, a_form, a_changes);
}

bool IsFormIDInUse(FormID a_formID)
{
using func_t = decltype(&BGSSaveLoadGame::IsFormIDInUse);
static REL::Relocation<func_t> func{ RELOCATION_ID(34670, 35593) };
return func(this, a_formID);
}

// members
BSTArray<TESFile*> pluginList; // 000
BSTArray<void*> unk18; // 018
Expand Down
5 changes: 4 additions & 1 deletion include/RE/E/ExtraTerminalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ namespace RE
virtual ExtraDataType GetType() const override; // 01 - { return kTerminalState; }

// members
std::uint64_t unk10; // 10
std::uint8_t flags; // 10
std::uint8_t lockLevel; // 11
std::uint16_t pad12; // 12
std::uint32_t pad14; // 14
};
static_assert(sizeof(ExtraTerminalState) == 0x18);
}
36 changes: 20 additions & 16 deletions include/RE/I/InventoryChanges.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#pragma once

#include "RE/B/BSContainer.h"
#include "RE/B/BSPointerHandle.h"
#include "RE/B/BSTList.h"
#include "RE/F/FormTypes.h"
#include "RE/M/MemoryManager.h"
#include "RE/T/TESBoundObject.h"

namespace RE
{
enum class ITEM_REMOVE_REASON;
class ExtraDataList;
class InventoryEntryData;
class NiPoint3;

class InventoryChanges
{
Expand Down Expand Up @@ -37,22 +40,23 @@ namespace RE
explicit InventoryChanges(TESObjectREFR* a_ref);
~InventoryChanges();

void AddEntryData(InventoryEntryData* a_entry);
TESObjectARMO* GetArmorInSlot(std::int32_t a_slot);
float GetInventoryWeight();
std::uint16_t GetNextUniqueID();
std::uint32_t GetWornMask();
void InitFromContainerExtra();
void InitLeveledItems();
void InitOutfitItems(BGSOutfit* a_outfit, std::uint16_t a_npcLevel);
void InitScripts();
void RemoveFavorite(InventoryEntryData* a_entry, ExtraDataList* a_itemList);
void RemoveAllItems(TESObjectREFR* a_ref, TESObjectREFR* a_moveToRef, bool a_arg4, bool a_keepOwnership, bool a_arg6);
void SendContainerChangedEvent(ExtraDataList* a_itemExtraList, TESObjectREFR* a_fromRefr, TESForm* a_item, std::int32_t a_count);
void SetFavorite(InventoryEntryData* a_entry, ExtraDataList* a_itemList);
void SetUniqueID(ExtraDataList* a_itemList, TESForm* a_oldForm, TESForm* a_newForm);
void VisitInventory(IItemChangeVisitor& visitor);
void VisitWornItems(IItemChangeVisitor& visitor);
void AddEntryData(InventoryEntryData* a_entry);
TESObjectARMO* GetArmorInSlot(std::int32_t a_slot);
float GetInventoryWeight();
std::uint16_t GetNextUniqueID();
std::uint32_t GetWornMask();
void InitFromContainerExtra();
void InitLeveledItems();
void InitOutfitItems(BGSOutfit* a_outfit, std::uint16_t a_npcLevel);
void InitScripts();
void RemoveFavorite(InventoryEntryData* a_entry, ExtraDataList* a_itemList);
ObjectRefHandle RemoveItem(TESObjectREFR* a_ref, TESBoundObject* a_item, std::int32_t a_count, ITEM_REMOVE_REASON a_reason, ExtraDataList* a_extraDataList, TESObjectREFR* a_moveToRef, const NiPoint3& a_dropLoc, TESObjectREFR* a_dropRef);
void RemoveAllItems(TESObjectREFR* a_ref, TESObjectREFR* a_moveToRef, bool a_stealing, bool a_keepOwnership, bool a_arg6);
void SendContainerChangedEvent(ExtraDataList* a_itemExtraList, TESObjectREFR* a_fromRefr, TESForm* a_item, std::int32_t a_count);
void SetFavorite(InventoryEntryData* a_entry, ExtraDataList* a_itemList);
void SetUniqueID(ExtraDataList* a_itemList, TESForm* a_oldForm, TESForm* a_newForm);
void VisitInventory(IItemChangeVisitor& visitor);
void VisitWornItems(IItemChangeVisitor& visitor);

TES_HEAP_REDEFINE_NEW();

Expand Down
14 changes: 14 additions & 0 deletions include/RE/I/ItemRemoveReason.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

namespace RE
{
enum class ITEM_REMOVE_REASON
{
kRemove,
kSteal,
kSelling,
kDropping,
kStoreInContainer,
kStoreInTeammate
};
}
7 changes: 2 additions & 5 deletions include/RE/M/MapCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ namespace RE
virtual void Unk_03(void); // 03

// members
float unk38; // 38
float unk3C; // 3C
float unk40; // 40
float unk44; // 44
float unk48; // 48
BSTPoint2<float> unk38; // 38
BSTPoint3<float> unk40; // 40
std::uint32_t unk4C; // 4C
TESWorldSpace* worldSpace; // 50
IMapCameraCallbacks* unk58; // 58
Expand Down
3 changes: 2 additions & 1 deletion include/RE/M/MapMoveHandler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "RE/B/BSTPoint.h"
#include "RE/M/MapInputHandler.h"

namespace RE
Expand All @@ -17,7 +18,7 @@ namespace RE
bool ProcessThumbstick(ThumbstickEvent* a_event) override; // 03

// members
std::uint64_t unk18; // 18
BSTPoint2<float> unk18; // 18
};
static_assert(sizeof(MapMoveHandler) == 0x20);
}
48 changes: 48 additions & 0 deletions include/RE/N/NiDirectionalLight.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#pragma once

#include "RE/N/NiLight.h"

#include "RE/M/MemoryManager.h"

namespace RE
{
class NiDirectionalLight : public NiLight
{
public:
inline static constexpr auto RTTI = RTTI_NiDirectionalLight;
inline static constexpr auto Ni_RTTI = NiRTTI_NiDirectionalLight;
inline static constexpr auto VTABLE = VTABLE_NiDirectionalLight;

~NiDirectionalLight() override; // 00

// override (NiLight)
const NiRTTI* GetRTTI() const override; // 02
NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17
void LoadBinary(NiStream& a_stream) override; // 18
void SaveBinary(NiStream& a_stream) override; // 1B
bool IsEqual(NiObject* a_object) override; // 1C

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

// members
NiPoint3 worldDir; // 140
NiColor effectColor; // 14C

private:
NiDirectionalLight* Ctor()
{
using func_t = decltype(&NiDirectionalLight::Ctor);
static REL::Relocation<func_t> func{ RELOCATION_ID(69692, 71073) };
return func(this);
}
};
static_assert(sizeof(NiDirectionalLight) == 0x158);
}
47 changes: 47 additions & 0 deletions include/RE/N/NiSwitchNode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#pragma once

#include "RE/N/NiNode.h"

namespace RE
{
class NiSwitchNode : public NiNode
{
public:
inline static constexpr auto RTTI = RTTI_NiSwitchNode;
inline static constexpr auto Ni_RTTI = NiRTTI_NiSwitchNode;
inline static constexpr auto VTABLE = VTABLE_NiSwitchNode;

~NiSwitchNode() override; // 00

// override (NiNode)
const NiRTTI* GetRTTI() const override; // 02
NiSwitchNode* AsSwitchNode() override; // 04
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 UpdateControllers(NiUpdateData& a_data) override; // 25
void UpdateDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2C
void UpdateSelectedDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2D
void UpdateRigidDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2E
void UpdateWorldBound() override; // 2F
void OnVisible(NiCullingProcess& a_process) override; // 34
void AttachChild(NiAVObject* a_child, bool a_firstAvail) override; // 35
void DetachChild1(NiAVObject* a_child, NiPointer<NiAVObject>& a_childOut) override; // 37
void DetachChild2(NiAVObject* a_child) override; // 38
void DetachChildAt1(std::uint32_t a_idx, NiPointer<NiAVObject>& a_childOut) override; // 39
void DetachChildAt2(std::uint32_t a_idx) override; // 3A
void SetAt1(std::uint32_t a_idx, NiAVObject* a_child, NiPointer<NiAVObject>& a_childOut) override; // 3B
void SetAt2(std::uint32_t a_idx, NiAVObject* a_child) override; // 3C

// members
std::uint16_t flags; // 128
std::int32_t index; // 12C
float savedTime; // 130
std::uint32_t revID; // 134
NiTPrimitiveArray<std::uint32_t> childRevID; // 138
};
static_assert(sizeof(NiSwitchNode) == 0x150);
}
3 changes: 3 additions & 0 deletions include/RE/Skyrim.h
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@
#include "RE/I/ItemCrafted.h"
#include "RE/I/ItemHarvested.h"
#include "RE/I/ItemList.h"
#include "RE/I/ItemRemoveReason.h"
#include "RE/I/ItemsPickpocketed.h"
#include "RE/J/JournalMenu.h"
#include "RE/J/JournalTab.h"
Expand Down Expand Up @@ -1274,6 +1275,7 @@
#include "RE/N/NiControllerManager.h"
#include "RE/N/NiControllerSequence.h"
#include "RE/N/NiCullingProcess.h"
#include "RE/N/NiDirectionalLight.h"
#include "RE/N/NiExtraData.h"
#include "RE/N/NiFile.h"
#include "RE/N/NiFloatData.h"
Expand Down Expand Up @@ -1324,6 +1326,7 @@
#include "RE/N/NiStream.h"
#include "RE/N/NiStringExtraData.h"
#include "RE/N/NiStringsExtraData.h"
#include "RE/N/NiSwitchNode.h"
#include "RE/N/NiSystem.h"
#include "RE/N/NiTArray.h"
#include "RE/N/NiTCollection.h"
Expand Down
18 changes: 12 additions & 6 deletions include/RE/T/TES.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace RE
class ImageSpaceModifierInstance;
class NavMeshInfoMap;
class NiAVObject;
class NiDirectionalLight;
class NiFogProperty;
class NiNode;
class Sky;
class TESLandTexture;
Expand Down Expand Up @@ -68,6 +70,8 @@ namespace RE

static TES* GetSingleton();

void ForEachCell(std::function<void(TESObjectCELL*)> a_callback);
void ForEachCellInRange(TESObjectREFR* a_origin, float a_radius, std::function<void(TESObjectCELL*)> a_callback);
void ForEachReference(std::function<BSContainer::ForEachResult(TESObjectREFR*)> a_callback);
void ForEachReferenceInRange(TESObjectREFR* a_origin, float a_radius, std::function<BSContainer::ForEachResult(TESObjectREFR*)> a_callback);

Expand All @@ -86,16 +90,18 @@ namespace RE
NiNode* lodLandRoot; // 088
NiNode* objLODWaterRoot; // 090
BSTempNodeManager* tempNodeManager; // 098
std::uint64_t unk0A0; // 0A0
std::uint64_t unk0A8; // 0A8
std::uint32_t unk0B0; // 0B0
std::uint32_t unk0B4; // 0B4
std::uint64_t unk0B8; // 0B8
NiDirectionalLight* objLight; // 0A0
NiFogProperty* objFog; // 0A8
std::int32_t currentGridX; // 0B0
std::int32_t currentGridY; // 0B4
std::int32_t currentQueuedX; // 0B8
std::int32_t currentQueuedY; // 0BC
TESObjectCELL* interiorCell; // 0C0
TESObjectCELL** interiorBuffer; // 0C8
TESObjectCELL** exteriorBuffer; // 0D0
std::uint64_t unk0D8; // 0D8
std::uint64_t unk0E0; // 0E0
std::int32_t saveGridX; // 0E0
std::int32_t saveGridY; // 0E0
std::uint64_t unk0E8; // 0E8
std::uint64_t unk0F0; // 0F0
std::uint64_t unk0F8; // 0F8
Expand Down
3 changes: 3 additions & 0 deletions include/RE/T/TESDataHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ namespace RE
const TESFile* LookupLoadedLightModByIndex(std::uint16_t a_index);
std::optional<std::uint16_t> GetLoadedLightModIndex(std::string_view a_modName);

TESWorldSpace* GetExtCellDataFromFileByEditorID(const char* a_cellID, std::int32_t& a_outX, std::int32_t& a_outY);

bool IsGeneratedID(FormID a_formID);
FormID GetNextID();

BSTArray<TESForm*>& GetFormArray(FormType a_formType);
template <class T>
Expand Down
1 change: 1 addition & 0 deletions include/RE/T/TESForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ namespace RE
[[nodiscard]] bool IsSoulGem() const noexcept { return Is(FormType::SoulGem); }
[[nodiscard]] bool IsWeapon() const noexcept { return Is(FormType::Weapon); }

void SetFile(TESFile* a_file);
void SetPlayerKnows(bool a_known);

// members
Expand Down
18 changes: 7 additions & 11 deletions include/RE/T/TESObjectREFR.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

namespace RE
{
enum class ITEM_REMOVE_REASON;
enum class LOCK_LEVEL;
class hkpCollidable;
class Actor;
Expand Down Expand Up @@ -59,18 +60,9 @@ namespace RE
struct BGSDecalGroup;
struct BSAnimationGraphEvent;
struct BSAnimationUpdateData;
struct DoorTeleportData;
struct REFR_LOCK;

enum class ITEM_REMOVE_REASON
{
kRemove,
kSteal,
kSelling,
kDropping,
kStoreInContainer,
kStoreInTeammate
};

struct OBJ_REFR
{
public:
Expand Down Expand Up @@ -352,6 +344,8 @@ namespace RE
static TESObjectREFR* FindReferenceFor3D(NiAVObject* a_object3D);

bool ActivateRef(TESObjectREFR* a_activator, std::uint8_t a_arg2, TESBoundObject* a_object, std::int32_t a_count, bool a_defaultProcessingOnly);
REFR_LOCK* AddLock();
DoorTeleportData* AddTeleport();
ModelReferenceEffect* ApplyArtObject(BGSArtObject* a_artObject, float a_duration = -1.0f, TESObjectREFR* a_facingRef = nullptr, bool a_faceTarget = false, bool a_attachToCamera = false, NiAVObject* a_attachNode = nullptr, bool a_interfaceEffect = false);
ShaderReferenceEffect* ApplyEffectShader(TESEffectShader* a_effectShader, float a_duration = -1.0f, TESObjectREFR* a_facingRef = nullptr, bool a_faceTarget = false, bool a_attachToCamera = false, NiAVObject* a_attachNode = nullptr, bool a_interfaceEffect = false);
bool CanBeMoved();
Expand Down Expand Up @@ -450,13 +444,15 @@ namespace RE
void PlayAnimation(stl::zstring a_from, stl::zstring a_to);
void PlayAnimation(NiControllerManager* a_manager, NiControllerSequence* a_toSeq, NiControllerSequence* a_fromSeq);
void SetActivationBlocked(bool a_blocked);
void SetAngle(const NiPoint3& a_angle);
void SetCollision(bool a_enable);
bool SetDisplayName(const BSFixedString& a_name, bool a_force);
void SetEncounterZone(BGSEncounterZone* a_zone);
bool SetMotionType(hkpMotion::MotionType a_motionType, bool a_allowActivate = true);
void SetOwner(TESForm* a_owner);
void SetPosition(float a_x, float a_y, float a_z);
void SetPosition(NiPoint3 a_pos);
void SetPosition(const NiPoint3& a_pos);
void SetScale(float a_scale);
void SetTemporary();

// members
Expand Down
Loading

0 comments on commit d5f9c62

Please sign in to comment.