diff --git a/cmake/sourcelist.cmake b/cmake/sourcelist.cmake index 8dea6831c..aeacd5862 100644 --- a/cmake/sourcelist.cmake +++ b/cmake/sourcelist.cmake @@ -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 @@ -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 diff --git a/include/RE/B/BSLight.h b/include/RE/B/BSLight.h index f563591f8..637d3b08e 100644 --- a/include/RE/B/BSLight.h +++ b/include/RE/B/BSLight.h @@ -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 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 diff --git a/include/RE/C/CombatController.h b/include/RE/C/CombatController.h index 15739ea74..4848285aa 100644 --- a/include/RE/C/CombatController.h +++ b/include/RE/C/CombatController.h @@ -46,7 +46,7 @@ namespace RE bool ignoringCombat; // 42 bool inactive; // 43 AITimer unk44; // 44 - float unk4C; // 4C + float lowMovementDelta; // 4C BSTArray aimControllers; // 50 #ifdef SKYRIM_SUPPORT_AE mutable BSSpinLock aimControllerLock; // 68 diff --git a/include/RE/C/CombatGroup.h b/include/RE/C/CombatGroup.h index ba28cb1cc..430e272c6 100644 --- a/include/RE/C/CombatGroup.h +++ b/include/RE/C/CombatGroup.h @@ -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 searchLocations; // 120 BSTArray 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 diff --git a/include/RE/C/CombatManager.h b/include/RE/C/CombatManager.h index fe634f16f..3d23823a8 100644 --- a/include/RE/C/CombatManager.h +++ b/include/RE/C/CombatManager.h @@ -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" @@ -30,19 +31,19 @@ namespace RE } // members - NiTPrimitiveArray 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 combatGroups; // 00 + mutable BSReadWriteLock lock; // 18 + BSTHashMap* 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); } diff --git a/include/RE/C/ConstructibleObjectMenu.h b/include/RE/C/ConstructibleObjectMenu.h index 4b1be206d..683ea729e 100644 --- a/include/RE/C/ConstructibleObjectMenu.h +++ b/include/RE/C/ConstructibleObjectMenu.h @@ -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 { diff --git a/include/RE/C/CraftingMenu.h b/include/RE/C/CraftingMenu.h index ea14a3853..6d7652f77 100644 --- a/include/RE/C/CraftingMenu.h +++ b/include/RE/C/CraftingMenu.h @@ -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 diff --git a/include/RE/C/CraftingSubMenu.h b/include/RE/C/CraftingSubMenu.h index 7d93ea95b..dfdcd619a 100644 --- a/include/RE/C/CraftingSubMenu.h +++ b/include/RE/C/CraftingSubMenu.h @@ -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" @@ -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{ RELOCATION_ID(50461, 51364) }; + return func(this, a_actorValue); + } + // members GFxMovieView* view; // 018 TESFurniture* furniture; // 020 diff --git a/include/RE/I/InterfaceLightSchemes.h b/include/RE/I/InterfaceLightSchemes.h new file mode 100644 index 000000000..f01014527 --- /dev/null +++ b/include/RE/I/InterfaceLightSchemes.h @@ -0,0 +1,18 @@ +#pragma once + +namespace RE +{ + enum class INTERFACE_LIGHT_SCHEME + { + kJournal = 0, + kInventory, + kInventoryMagic, + kBook, + kLoading, + kUnk05, + kStats, + kLockpicking, + + kTotal = 8 + }; +} diff --git a/include/RE/I/Inventory3DManager.h b/include/RE/I/Inventory3DManager.h index b3f0b6db9..785b7c435 100644 --- a/include/RE/I/Inventory3DManager.h +++ b/include/RE/I/Inventory3DManager.h @@ -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" @@ -20,10 +21,11 @@ namespace RE { public: // members - TESForm* itemBase; // 00 - smart ptr - TESBoundObject* modelObj; // 08 - NiPointer spModel; // 10 - std::uint64_t unk18; // 18 + TESForm* itemBase; // 00 - smart ptr + TESBoundObject* modelObj; // 08 + NiPointer spModel; // 10 + INTERFACE_LIGHT_SCHEME lightScheme; // 18 + float boundRadius; // 1C }; static_assert(sizeof(LoadedInventoryModel) == 0x20); @@ -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 loadedModels; // 058 - std::uint32_t unk148; // 148 - float zoomProgress; // 14C - 1 if zoomed in, 0 if not, in-between during transition - BSTSmartPointer 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 loadedModels; // 058 + float zoomDistance; // 148 + float zoomProgress; // 14C - 1 if zoomed in, 0 if not, in-between during transition + BSTSmartPointer 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); diff --git a/include/RE/M/MagicMenu.h b/include/RE/M/MagicMenu.h index f6725ed9b..77db08f3a 100644 --- a/include/RE/M/MagicMenu.h +++ b/include/RE/M/MagicMenu.h @@ -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 diff --git a/include/RE/N/NiBillboardNode.h b/include/RE/N/NiBillboardNode.h new file mode 100644 index 000000000..c1799ee67 --- /dev/null +++ b/include/RE/N/NiBillboardNode.h @@ -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(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); +} diff --git a/include/RE/N/NiCamera.h b/include/RE/N/NiCamera.h index 8ace116a0..edfef0d61 100644 --- a/include/RE/N/NiCamera.h +++ b/include/RE/N/NiCamera.h @@ -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); diff --git a/include/RE/N/NiLight.h b/include/RE/N/NiLight.h index c68b4e544..f324cbff1 100644 --- a/include/RE/N/NiLight.h +++ b/include/RE/N/NiLight.h @@ -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); } diff --git a/include/RE/N/NiPoint3.h b/include/RE/N/NiPoint3.h index 384c32892..4b4a338e9 100644 --- a/include/RE/N/NiPoint3.h +++ b/include/RE/N/NiPoint3.h @@ -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; diff --git a/include/RE/N/NiPointLight.h b/include/RE/N/NiPointLight.h index 22f8fa38d..b813c47f9 100644 --- a/include/RE/N/NiPointLight.h +++ b/include/RE/N/NiPointLight.h @@ -2,6 +2,8 @@ #include "RE/N/NiLight.h" +#include "RE/M/MemoryManager.h" + namespace RE { class NiPointLight : public NiLight @@ -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(); + 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{ 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{ RELOCATION_ID(69583, 70967) }; + return func(this); + } }; static_assert(sizeof(NiPointLight) == 0x150); } diff --git a/include/RE/S/ShadowSceneNode.h b/include/RE/S/ShadowSceneNode.h index 2f6795248..179f4c576 100644 --- a/include/RE/S/ShadowSceneNode.h +++ b/include/RE/S/ShadowSceneNode.h @@ -23,19 +23,19 @@ namespace RE { public: // members - std::uint8_t unk00; // 00 - std::uint8_t unk01; // 01 - bool portalStrict; // 02 - bool affectLand; // 03 - std::uint8_t unk04; // 04 - bool neverFades; // 05 - float fov; // 08 - float falloff; // 0C - float nearDistance; // 10 - float depthBias; // 14 - std::uint32_t unk18; // 18 - NiAVObject* objectNode; // 20 - BSLensFlareRenderData* lensFlareData; // 28 + bool dynamic; // 00 + bool shadowLight; // 01 + bool portalStrict; // 02 + bool affectLand; // 03 + bool affectWater; // 04 + bool neverFades; // 05 + float fov; // 08 + float falloff; // 0C + float nearDistance; // 10 + float depthBias; // 14 + std::uint32_t unk18; // 18 + NiAVObject* restrictedNode; // 20 + BSLensFlareRenderData* lensFlareData; // 28 }; ~ShadowSceneNode() override; // 00 @@ -44,6 +44,13 @@ namespace RE const NiRTTI* GetRTTI() const override; // 02 void OnVisible(NiCullingProcess& a_process) override; // 34 + BSLight* AddLight(NiLight* a_light, const LIGHT_CREATE_PARAMS& a_params) + { + using func_t = decltype(&ShadowSceneNode::AddLight); + REL::Relocation func{ RELOCATION_ID(99692, 106326) }; + return func(this, a_light, a_params); + } + // members std::uint64_t unk128; // 128 BSTArray> activeLights; // 130 diff --git a/include/RE/S/Sky.h b/include/RE/S/Sky.h index f15a5a11c..bd75cd6d5 100644 --- a/include/RE/S/Sky.h +++ b/include/RE/S/Sky.h @@ -66,13 +66,16 @@ namespace RE static Sky* GetSingleton(); - [[nodiscard]] bool IsRaining() const; - [[nodiscard]] bool IsSnowing() const; - - void SetWeather(TESWeather* a_weather, bool a_override, bool a_accelerate); - void ForceWeather(TESWeather* a_weather, bool a_override); - void ReleaseWeatherOverride(); - void ResetWeather(); + [[nodiscard]] float GetSunriseBegin(); + [[nodiscard]] float GetSunriseEnd(); + [[nodiscard]] float GetSunsetBegin(); + [[nodiscard]] float GetSunsetEnd(); + void ForceWeather(TESWeather* a_weather, bool a_override); + [[nodiscard]] bool IsRaining() const; + [[nodiscard]] bool IsSnowing() const; + void ReleaseWeatherOverride(); + void ResetWeather(); + void SetWeather(TESWeather* a_weather, bool a_override, bool a_accelerate); // members NiPointer root; // 008 diff --git a/include/RE/S/SmithingMenu.h b/include/RE/S/SmithingMenu.h index 55fd927b9..809932417 100644 --- a/include/RE/S/SmithingMenu.h +++ b/include/RE/S/SmithingMenu.h @@ -15,6 +15,7 @@ namespace RE { public: inline static constexpr auto RTTI = RTTI_CraftingSubMenus__SmithingMenu; + inline static constexpr auto VTABLE = VTABLE_CraftingSubMenus__SmithingMenu; class SmithingConfirmCallback : public IMessageBoxCallback { diff --git a/include/RE/Skyrim.h b/include/RE/Skyrim.h index c97e5c3be..3a017606b 100644 --- a/include/RE/Skyrim.h +++ b/include/RE/Skyrim.h @@ -1118,6 +1118,7 @@ #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" @@ -1222,6 +1223,7 @@ #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" diff --git a/include/RE/T/TESObjectCELL.h b/include/RE/T/TESObjectCELL.h index eb5ee231b..39a1afc29 100644 --- a/include/RE/T/TESObjectCELL.h +++ b/include/RE/T/TESObjectCELL.h @@ -87,9 +87,9 @@ namespace RE std::uint64_t unk028; // 028 std::uint64_t unk030; // 030 std::uint64_t unk038; // 038 - BSTArray unk040; // 040 - BSTArray unk058; // 058 - NiTMap unk070; // 070 + BSTArray unk040; // 040 + BSTArray flickeringLights; // 058 + NiTMap emittanceSourceRefMap; // 070 NiTMap emittanceLightRefMap; // 090 NiTMap> multiboundRefMap; // 0B0 NiTMap refMultiboundMap; // 0D0 @@ -97,15 +97,15 @@ namespace RE BSSimpleList unk100; // 100 std::uint64_t unk110; // 110 BSTArray unk118; // 118 - BSTArray unk130; // 130 - BSTArray unk148; // 148 + BSTArray decalRefs; // 130 + BSTArray skyActors; // 148 BGSEncounterZone* encounterZone; // 160 - std::uint32_t unk168; // 168 + bool decalsQueued; // 168 volatile mutable std::int32_t criticalQueuedRefCount; // 16C volatile mutable std::int32_t queuedRefCount; // 170 volatile mutable std::int32_t queuedDistantRefCount; // 174 - std::uint32_t unk178; // 178 - std::uint32_t unk17C; // 17C + std::int32_t unk178; // 178 + bool refsFullyLoaded; // 17C }; static_assert(sizeof(LOADED_CELL_DATA) == 0x180); diff --git a/include/RE/T/TESObjectLIGH.h b/include/RE/T/TESObjectLIGH.h index 698ff38dc..fc4ba2e60 100644 --- a/include/RE/T/TESObjectLIGH.h +++ b/include/RE/T/TESObjectLIGH.h @@ -15,6 +15,8 @@ namespace RE { + class NiLight; + enum class TES_LIGHT_FLAGS { kNone = 0, @@ -100,6 +102,13 @@ namespace RE [[nodiscard]] constexpr bool CanBeCarried() const noexcept { return data.flags.all(TES_LIGHT_FLAGS::kCanCarry); } + NiLight* GenDynamic(RE::TESObjectREFR* a_ref, RE::NiNode* a_node, char a_forceDynamic, char a_useLightRadius, char a_affectRefOnly) + { + using func_t = decltype(&TESObjectLIGH::GenDynamic); + REL::Relocation func{ RELOCATION_ID(17208, 17610) }; + return func(this, a_ref, a_node, a_forceDynamic, a_useLightRadius, a_affectRefOnly); + } + // members OBJ_LIGH data; // 0E0 - DATA float fade; // 108 - FNAM diff --git a/include/RE/U/UI3DSceneManager.h b/include/RE/U/UI3DSceneManager.h index 6ecee9474..d860f9246 100644 --- a/include/RE/U/UI3DSceneManager.h +++ b/include/RE/U/UI3DSceneManager.h @@ -3,6 +3,7 @@ #include "RE/B/BSAtomic.h" #include "RE/B/BSTArray.h" #include "RE/B/BSTSingleton.h" +#include "RE/I/InterfaceLightSchemes.h" #include "RE/N/NiColor.h" #include "RE/N/NiFrustum.h" #include "RE/N/NiMatrix3.h" @@ -20,20 +21,6 @@ namespace RE class ShadowSceneNode; class TESImageSpaceModifier; - enum class INTERFACE_LIGHT_SCHEME - { - kJournal = 0, - kInventory, - kInventoryMagic, - kBook, - kLoading, - kUnk05, - kStats, - kLockpicking, - - kTotal = 8 - }; - class MenuLight { public: diff --git a/src/RE/I/Inventory3DManager.cpp b/src/RE/I/Inventory3DManager.cpp index bae5f7f36..a068624a9 100644 --- a/src/RE/I/Inventory3DManager.cpp +++ b/src/RE/I/Inventory3DManager.cpp @@ -29,10 +29,17 @@ namespace RE return func(this); } - std::uint32_t Inventory3DManager::Render() + void Inventory3DManager::Render() { using func_t = decltype(&Inventory3DManager::Render); REL::Relocation func{ RELOCATION_ID(50882, 51755) }; return func(this); } + + bool Inventory3DManager::ToggleItemZoom() + { + using func_t = decltype(&Inventory3DManager::ToggleItemZoom); + REL::Relocation func{ RELOCATION_ID(50887, 51760) }; + return func(this); + } } diff --git a/src/RE/N/NiCamera.cpp b/src/RE/N/NiCamera.cpp index a7b67d604..18250af61 100644 --- a/src/RE/N/NiCamera.cpp +++ b/src/RE/N/NiCamera.cpp @@ -2,6 +2,11 @@ namespace RE { + bool NiCamera::WorldPtToScreenPt3(const NiPoint3& a_point, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance) + { + return WorldPtToScreenPt3(worldToCam, port, a_point, a_xOut, a_yOut, a_zOut, a_zeroTolerance); + } + bool NiCamera::BoundInFrustum(const NiBound& a_bound, NiCamera* a_camera) { using func_t = decltype(&BoundInFrustum); @@ -30,7 +35,7 @@ namespace RE bool NiCamera::WorldPtToScreenPt3(const float a_matrix[4][4], const NiRect& a_port, const NiPoint3& a_point, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance) { - using func_t = decltype(&NiCamera::WorldPtToScreenPt3); + using func_t = bool (*)(const float[4][4], const NiRect&, const NiPoint3&, float&, float&, float&, float); REL::Relocation func{ Offset::NiCamera::WorldPtToScreenPt3 }; return func(a_matrix, a_port, a_point, a_xOut, a_yOut, a_zOut, a_zeroTolerance); } diff --git a/src/RE/N/NiPoint3.cpp b/src/RE/N/NiPoint3.cpp index 5cda0453d..4e353af67 100644 --- a/src/RE/N/NiPoint3.cpp +++ b/src/RE/N/NiPoint3.cpp @@ -24,6 +24,11 @@ namespace RE return !operator==(a_rhs); } + bool NiPoint3::operator<(const NiPoint3& a_rhs) const + { + return std::tie(x, y, z) < std::tie(a_rhs.x, a_rhs.y, a_rhs.z); + } + NiPoint3 NiPoint3::operator+(const NiPoint3& a_rhs) const { return NiPoint3(x + a_rhs.x, y + a_rhs.y, z + a_rhs.z); diff --git a/src/RE/S/Sky.cpp b/src/RE/S/Sky.cpp index 4ac4b7636..885c3870b 100644 --- a/src/RE/S/Sky.cpp +++ b/src/RE/S/Sky.cpp @@ -1,5 +1,6 @@ #include "RE/S/Sky.h" +#include "RE/T/TESClimate.h" #include "RE/T/TESWeather.h" namespace RE @@ -11,23 +12,60 @@ namespace RE return func(); } - bool Sky::IsRaining() const + float Sky::GetSunriseBegin() { - return currentWeather && currentWeather->data.flags.any(TESWeather::WeatherDataFlag::kRainy) && currentWeather->data.precipitationBeginFadeIn * (1.0f / 255.0f) < currentWeatherPct || - lastWeather && lastWeather->data.flags.any(TESWeather::WeatherDataFlag::kRainy) && (lastWeather->data.precipitationEndFadeOut * (1.0f / 255.0f) + 0.001f) > currentWeatherPct; + float& cache = *REL::Relocation{ RELOCATION_ID(515516, 401655) }; + + if (flags.none(Flags::kUpdateSunriseBegin) || !currentClimate) { + return cache; + } + + cache = currentClimate->timing.sunrise.begin * 0.16666667f; + flags.reset(Flags::kUpdateSunriseBegin); + + return cache; } - bool Sky::IsSnowing() const + float Sky::GetSunriseEnd() { - return currentWeather && currentWeather->data.flags.any(TESWeather::WeatherDataFlag::kSnow) && currentWeather->data.precipitationBeginFadeIn * (1.0f / 255.0f) < currentWeatherPct || - lastWeather && lastWeather->data.flags.any(TESWeather::WeatherDataFlag::kSnow) && (lastWeather->data.precipitationEndFadeOut * (1.0f / 255.0f) + 0.001f) > currentWeatherPct; + float& cache = *REL::Relocation{ RELOCATION_ID(515517, 401656) }; + + if (flags.none(Flags::kUpdateSunriseEnd) || !currentClimate) { + return cache; + } + + cache = currentClimate->timing.sunrise.end * 0.16666667f; + flags.reset(Flags::kUpdateSunriseEnd); + + return cache; } - void Sky::SetWeather(TESWeather* a_weather, bool a_override, bool a_accelerate) + float Sky::GetSunsetBegin() { - using func_t = decltype(&Sky::SetWeather); - REL::Relocation func{ RELOCATION_ID(25694, 26241) }; - func(this, a_weather, a_override, a_accelerate); + float& cache = *REL::Relocation{ RELOCATION_ID(515518, 401657) }; + + if (flags.none(Flags::kUpdateSunsetBegin) || !currentClimate) { + return cache; + } + + cache = currentClimate->timing.sunset.begin * 0.16666667f; + flags.reset(Flags::kUpdateSunsetBegin); + + return cache; + } + + float Sky::GetSunsetEnd() + { + float& cache = *REL::Relocation{ RELOCATION_ID(515519, 401658) }; + + if (flags.none(Flags::kUpdateSunsetEnd) || !currentClimate) { + return cache; + } + + cache = currentClimate->timing.sunset.end * 0.16666667f; + flags.reset(Flags::kUpdateSunsetEnd); + + return cache; } void Sky::ForceWeather(TESWeather* a_weather, bool a_override) @@ -37,6 +75,18 @@ namespace RE func(this, a_weather, a_override); } + bool Sky::IsRaining() const + { + return currentWeather && currentWeather->data.flags.any(TESWeather::WeatherDataFlag::kRainy) && currentWeather->data.precipitationBeginFadeIn * (1.0f / 255.0f) < currentWeatherPct || + lastWeather && lastWeather->data.flags.any(TESWeather::WeatherDataFlag::kRainy) && (lastWeather->data.precipitationEndFadeOut * (1.0f / 255.0f) + 0.001f) > currentWeatherPct; + } + + bool Sky::IsSnowing() const + { + return currentWeather && currentWeather->data.flags.any(TESWeather::WeatherDataFlag::kSnow) && currentWeather->data.precipitationBeginFadeIn * (1.0f / 255.0f) < currentWeatherPct || + lastWeather && lastWeather->data.flags.any(TESWeather::WeatherDataFlag::kSnow) && (lastWeather->data.precipitationEndFadeOut * (1.0f / 255.0f) + 0.001f) > currentWeatherPct; + } + void Sky::ReleaseWeatherOverride() { if (overrideWeather) { @@ -51,4 +101,11 @@ namespace RE REL::Relocation func{ RELOCATION_ID(25695, 26242) }; func(this); } + + void Sky::SetWeather(TESWeather* a_weather, bool a_override, bool a_accelerate) + { + using func_t = decltype(&Sky::SetWeather); + REL::Relocation func{ RELOCATION_ID(25694, 26241) }; + func(this, a_weather, a_override, a_accelerate); + } }