From fd38f90ac976920b10b188fd06588a1563befe83 Mon Sep 17 00:00:00 2001 From: powerof3 <32599957+powerof3@users.noreply.github.com> Date: Sat, 16 Mar 2024 23:56:21 +0530 Subject: [PATCH] Misc RE --- cmake/sourcelist.cmake | 9 ++- include/RE/B/BSAudioManager.h | 6 ++ include/RE/B/BSScaleformExternalTexture.h | 55 +++++++++++++++ include/RE/B/BSScaleformImageLoader.h | 51 ++++++++++++++ include/RE/B/BSSoundHandle.h | 3 + include/RE/B/BookMenu.h | 28 ++++---- include/RE/C/Calendar.h | 4 +- include/RE/C/CreationClubMenu.h | 6 +- include/RE/F/FileID.h | 4 +- include/RE/G/GFxImageLoader.h | 20 ++++++ include/RE/G/GFxImageResource.h | 28 ++++++++ include/RE/G/GImage.h | 2 +- include/RE/G/GImageInfo.h | 32 +++++++++ include/RE/G/GImageInfoBase.h | 36 ++++++++++ include/RE/G/GImageInfoBaseImpl.h | 24 +++++++ include/RE/H/HUDData.h | 2 + include/RE/H/HighProcessData.h | 4 +- include/RE/H/SendHUDMessage.h | 21 ++++++ include/RE/I/ID.h | 9 ++- include/RE/I/ImageData.h | 14 ---- include/RE/I/InputEvent.h | 4 ++ include/RE/L/LocalMapMenu.h | 4 +- include/RE/M/MainMenu.h | 14 ++-- include/RE/M/MenuTopicManager.h | 84 +++++++++++------------ include/RE/M/MiddleHighProcessData.h | 2 +- include/RE/Skyrim.h | 9 ++- include/RE/U/UISaveLoadManager.h | 15 ++-- src/RE/B/BSAudioManager.cpp | 7 ++ src/RE/B/BSSoundHandle.cpp | 14 ++++ src/RE/C/Calendar.cpp | 29 +++++++- src/RE/I/InputEvent.cpp | 11 +++ 31 files changed, 449 insertions(+), 102 deletions(-) create mode 100644 include/RE/B/BSScaleformExternalTexture.h create mode 100644 include/RE/B/BSScaleformImageLoader.h create mode 100644 include/RE/G/GFxImageLoader.h create mode 100644 include/RE/G/GFxImageResource.h create mode 100644 include/RE/G/GImageInfo.h create mode 100644 include/RE/G/GImageInfoBase.h create mode 100644 include/RE/G/GImageInfoBaseImpl.h create mode 100644 include/RE/H/SendHUDMessage.h delete mode 100644 include/RE/I/ImageData.h diff --git a/cmake/sourcelist.cmake b/cmake/sourcelist.cmake index 38c8cd4d1..8dea6831c 100644 --- a/cmake/sourcelist.cmake +++ b/cmake/sourcelist.cmake @@ -310,6 +310,8 @@ set(SOURCES include/RE/B/BSResourceNiBinaryStream.h include/RE/B/BSResponse.h include/RE/B/BSSaveDataSystemUtility.h + include/RE/B/BSScaleformExternalTexture.h + include/RE/B/BSScaleformImageLoader.h include/RE/B/BSScaleformManager.h include/RE/B/BSScaleformTranslator.h include/RE/B/BSSceneGraph.h @@ -768,6 +770,8 @@ set(SOURCES include/RE/G/GFxExternalInterface.h include/RE/G/GFxFileConstants.h include/RE/G/GFxFunctionHandler.h + include/RE/G/GFxImageLoader.h + include/RE/G/GFxImageResource.h include/RE/G/GFxInitImportActions.h include/RE/G/GFxKey.h include/RE/G/GFxKeyboardState.h @@ -839,6 +843,9 @@ set(SOURCES include/RE/G/GHashsetNodeEntry.h include/RE/G/GImage.h include/RE/G/GImageBase.h + include/RE/G/GImageInfo.h + include/RE/G/GImageInfoBase.h + include/RE/G/GImageInfoBaseImpl.h include/RE/G/GList.h include/RE/G/GMath.h include/RE/G/GMatrix2D.h @@ -897,6 +904,7 @@ set(SOURCES include/RE/H/HighProcessData.h include/RE/H/HitData.h include/RE/H/HorseCameraState.h + include/RE/H/SendHUDMessage.h include/RE/H/hkAabb.h include/RE/H/hkArray.h include/RE/H/hkBaseObject.h @@ -1091,7 +1099,6 @@ set(SOURCES include/RE/I/IVMSaveLoadInterface.h include/RE/I/IVirtualMachine.h include/RE/I/IXAudio2VoiceCallback.h - include/RE/I/ImageData.h include/RE/I/ImageSpaceData.h include/RE/I/ImageSpaceEffect.h include/RE/I/ImageSpaceEffectDepthOfField.h diff --git a/include/RE/B/BSAudioManager.h b/include/RE/B/BSAudioManager.h index a69dc95c5..8e172b160 100644 --- a/include/RE/B/BSAudioManager.h +++ b/include/RE/B/BSAudioManager.h @@ -10,6 +10,11 @@ namespace RE class BSXAudio2GameSound; struct BSSoundHandle; + namespace BSResource + { + struct ID; + } + class BSAudioManager { public: @@ -19,6 +24,7 @@ namespace RE bool Play(BSISoundDescriptor* a_descriptor); bool BuildSoundDataFromDescriptor(BSSoundHandle& a_soundHandle, BSISoundDescriptor* a_descriptor, std::uint32_t a_flags = 0x1A); void BuildSoundDataFromEditorID(BSSoundHandle& a_soundHandle, const char* a_editorID, std::uint32_t a_flags); + void BuildSoundDataFromFile(BSSoundHandle& a_soundHandle, const BSResource::ID& a_file, std::uint32_t a_flags, std::uint32_t a_priority); // members std::uint64_t unk000; // 000 diff --git a/include/RE/B/BSScaleformExternalTexture.h b/include/RE/B/BSScaleformExternalTexture.h new file mode 100644 index 000000000..2616769cb --- /dev/null +++ b/include/RE/B/BSScaleformExternalTexture.h @@ -0,0 +1,55 @@ +#pragma once + +#include "RE/B/BSFixedString.h" +#include "RE/N/NiTexture.h" + +namespace RE +{ + class BSScaleformExternalTexture + { + public: + BSScaleformExternalTexture() : + gamebryoTexture{ nullptr }, + renderTarget(0), + pad0C(0) + {} + + ~BSScaleformExternalTexture() + { + ReleaseTexture(); + } + + BSScaleformExternalTexture(const BSScaleformExternalTexture&) = delete; + BSScaleformExternalTexture(BSScaleformExternalTexture&&) = delete; + BSScaleformExternalTexture& operator=(const BSScaleformExternalTexture&) = delete; + BSScaleformExternalTexture& operator=(BSScaleformExternalTexture&&) = delete; + + bool LoadPNG(const BSFixedString& a_path) + { + using func_t = decltype(&BSScaleformExternalTexture::LoadPNG); + REL::Relocation func{ RELOCATION_ID(80298, 82321) }; + return func(this, a_path); + } + + void ReleaseTexture() + { + using func_t = decltype(&BSScaleformExternalTexture::ReleaseTexture); + REL::Relocation func{ RELOCATION_ID(80294, 82317) }; + return func(this); + } + + bool SetTexture(NiTexture* a_texture) + { + using func_t = decltype(&BSScaleformExternalTexture::SetTexture); + REL::Relocation func{ RELOCATION_ID(80295, 82318) }; + return func(this, a_texture); + } + + // members + NiPointer gamebryoTexture; // 00 + std::uint32_t renderTarget; // 08 + std::uint32_t pad0C; // 0C + BSFixedString filePath; // 10 + }; + static_assert(sizeof(BSScaleformExternalTexture) == 0x18); +} diff --git a/include/RE/B/BSScaleformImageLoader.h b/include/RE/B/BSScaleformImageLoader.h new file mode 100644 index 000000000..3362da032 --- /dev/null +++ b/include/RE/B/BSScaleformImageLoader.h @@ -0,0 +1,51 @@ +#pragma once + +#include "RE/B/BSTHashMap.h" +#include "RE/G/GFxImageLoader.h" +#include "RE/G/GPtr.h" + +namespace RE +{ + class BSScaleformExternalTexture; + class GTexture; + class NiTexture; + + class BSScaleformImageLoader : public GFxImageLoader + { + public: + inline static constexpr auto RTTI = RTTI_BSScaleformImageLoader; + + class TextureEntry + { + public: + GPtr texture; // 00 + NiTexture* sourceTexture; // 08 + std::uint32_t refCount; // 10 + std::uint32_t pad14; // 14 + }; + static_assert(sizeof(TextureEntry) == 0x18); + + virtual ~BSScaleformImageLoader(); // 00 + + // override (GFxImageLoader) + GImageInfoBase* LoadImage(const char* a_url) override; // 01 + + bool AddTexture(BSScaleformExternalTexture& a_texture) + { + using func_t = decltype(&BSScaleformImageLoader::AddTexture); + REL::Relocation func{ RELOCATION_ID(82382, 84469) }; + return func(this, a_texture); + } + + void RemoveTexture(BSScaleformExternalTexture& a_texture) + { + using func_t = decltype(&BSScaleformImageLoader::RemoveTexture); + REL::Relocation func{ RELOCATION_ID(82383, 84470) }; + return func(this, a_texture); + } + + // members + BSTHashMap textures; // 18 + }; + static_assert(sizeof(BSScaleformImageLoader) == 0x48); +} diff --git a/include/RE/B/BSSoundHandle.h b/include/RE/B/BSSoundHandle.h index 7151fe358..c7d12e40a 100644 --- a/include/RE/B/BSSoundHandle.h +++ b/include/RE/B/BSSoundHandle.h @@ -2,6 +2,7 @@ namespace RE { + class BGSSoundOutput; class NiAVObject; class NiPoint3; @@ -34,11 +35,13 @@ namespace RE bool FadeInPlay(std::uint16_t a_fadeTimeMS); bool FadeOutAndRelease(std::uint16_t a_fadeTimeMS); + std::uint64_t GetDuration(); [[nodiscard]] bool IsPlaying() const; [[nodiscard]] bool IsValid() const; bool SetFrequency(float a_frequency); bool SetPosition(NiPoint3 a_pos); void SetObjectToFollow(NiAVObject* a_node); + void SetOutputModel(const BGSSoundOutput* a_outputModel); bool SetVolume(float a_volume); bool Stop(); bool Play(); diff --git a/include/RE/B/BookMenu.h b/include/RE/B/BookMenu.h index a99c7d2af..8650f730c 100644 --- a/include/RE/B/BookMenu.h +++ b/include/RE/B/BookMenu.h @@ -1,10 +1,10 @@ #pragma once +#include "RE/B/BSScaleformExternalTexture.h" #include "RE/B/BSString.h" #include "RE/B/BSTEvent.h" #include "RE/G/GPtr.h" #include "RE/I/IMenu.h" -#include "RE/I/ImageData.h" #include "RE/N/NiMatrix3.h" #include "RE/N/NiSmartPointer.h" #include "RE/S/SimpleAnimationGraphManagerHolder.h" @@ -48,19 +48,19 @@ namespace RE static void OpenBookMenu(const BSString& a_description, const ExtraDataList* a_extraList, TESObjectREFR* a_ref, TESObjectBOOK* a_book, const NiPoint3& a_pos, const NiMatrix3& a_rot, float a_scale, bool a_useDefaultPos); // members - BSTArray unk50; // 50 - GPtr book; // 68 - NiPointer book3D; // 70 - std::uint32_t unk78; // 78 - std::uint32_t pad7C; // 7C - std::uint64_t unk80; // 80 - void* unk88; // 88 - smart ptr - std::uint16_t unk90; // 90 - std::uint16_t unk92; // 92 - bool closeMenu; // 94 - bool isNote; // 95 - std::uint8_t unk96; // 96 - std::uint8_t pad97; // 97 + BSTArray bookTextures; // 50 + GPtr book; // 68 + NiPointer book3D; // 70 + std::uint32_t unk78; // 78 + std::uint32_t pad7C; // 7C + std::uint64_t unk80; // 80 + void* unk88; // 88 - smart ptr + std::uint16_t unk90; // 90 + std::uint16_t unk92; // 92 + bool closeMenu; // 94 + bool isNote; // 95 + std::uint8_t unk96; // 96 + std::uint8_t pad97; // 97 }; static_assert(sizeof(BookMenu) == 0x98); } diff --git a/include/RE/C/Calendar.h b/include/RE/C/Calendar.h index 3ac4dcd06..8495e80b0 100644 --- a/include/RE/C/Calendar.h +++ b/include/RE/C/Calendar.h @@ -71,9 +71,11 @@ namespace RE void GetTimeDateString(char* a_dest, std::uint32_t a_max, bool a_showYear) const; [[nodiscard]] float GetHour() const; [[nodiscard]] float GetHoursPassed() const; - [[nodiscard]] float GetHoursPerDay() const; + [[nodiscard]] static float GetHoursPerDay(); + [[nodiscard]] std::uint32_t GetMinutes() const; [[nodiscard]] std::uint32_t GetMonth() const; [[nodiscard]] std::string GetMonthName() const; + [[nodiscard]] std::string GetOrdinalSuffix() const; [[nodiscard]] std::tm GetTime() const; [[nodiscard]] float GetTimescale() const; [[nodiscard]] std::uint32_t GetYear() const; diff --git a/include/RE/C/CreationClubMenu.h b/include/RE/C/CreationClubMenu.h index 9e26db4d0..82a6536a0 100644 --- a/include/RE/C/CreationClubMenu.h +++ b/include/RE/C/CreationClubMenu.h @@ -1,9 +1,9 @@ #pragma once +#include "RE/B/BSScaleformExternalTexture.h" #include "RE/B/BSTEvent.h" #include "RE/G/GFxFunctionHandler.h" #include "RE/I/IMenu.h" -#include "RE/I/ImageData.h" #include "RE/M/MenuEventHandler.h" namespace RE @@ -39,8 +39,8 @@ namespace RE BSEventNotifyControl ProcessEvent(const MenuOpenCloseEvent* a_event, BSTEventSource* a_eventSource) override; // 01 // members - ImageData background; // 58 - ImageData details; // 70 + BSScaleformExternalTexture background; // 58 + BSScaleformExternalTexture details; // 70 }; static_assert(sizeof(CreationClubMenu) == 0x88); } diff --git a/include/RE/F/FileID.h b/include/RE/F/FileID.h index a4c8003fa..921394ec4 100644 --- a/include/RE/F/FileID.h +++ b/include/RE/F/FileID.h @@ -8,8 +8,8 @@ namespace RE { public: // members - std::uint32_t file; // 0 - char ext[4]; // 0 + std::uint32_t file{ 0 }; // 0 + char ext[4]{ 0 }; // 0 }; static_assert(sizeof(FileID) == 0x8); } diff --git a/include/RE/G/GFxImageLoader.h b/include/RE/G/GFxImageLoader.h new file mode 100644 index 000000000..27b44228b --- /dev/null +++ b/include/RE/G/GFxImageLoader.h @@ -0,0 +1,20 @@ +#pragma once + +#include "RE/G/GFxState.h" + +namespace RE +{ + class GImageInfoBase; + + class GFxImageLoader : public GFxState + { + public: + inline static constexpr auto RTTI = RTTI_GFxImageLoader; + + virtual ~GFxImageLoader(); // 00 + + // add + virtual GImageInfoBase* LoadImage(const char* a_url) = 0; // 01 + }; + static_assert(sizeof(GFxImageLoader) == 0x18); +} diff --git a/include/RE/G/GFxImageResource.h b/include/RE/G/GFxImageResource.h new file mode 100644 index 000000000..2dc628f0c --- /dev/null +++ b/include/RE/G/GFxImageResource.h @@ -0,0 +1,28 @@ +#pragma once + +#include "RE/G/GFxResource.h" +#include "RE/G/GFxResourceKey.h" +#include "RE/G/GPtr.h" + +namespace RE +{ + class GImageInfoBase; + + class GFxImageResource : public GFxResource + { + public: + ~GFxImageResource() override; // 00 + + GImageInfoBase* GetImageInfo() const + { + return _imageInfo.get(); + } + + protected: + // members + GPtr _imageInfo; // 18 + GFxResourceKey _key; // 20 + ResourceUse _useType; // 30 + }; + static_assert(sizeof(GFxImageResource) == 0x38); +} diff --git a/include/RE/G/GImage.h b/include/RE/G/GImage.h index ca6b45d67..b2934116a 100644 --- a/include/RE/G/GImage.h +++ b/include/RE/G/GImage.h @@ -10,7 +10,7 @@ namespace RE public GImageBase { public: - ~GImage() override; // 00 + ~GImage() override = default; // 00 }; static_assert(sizeof(GImage) == 0x48); } diff --git a/include/RE/G/GImageInfo.h b/include/RE/G/GImageInfo.h new file mode 100644 index 000000000..f49943e1b --- /dev/null +++ b/include/RE/G/GImageInfo.h @@ -0,0 +1,32 @@ +#pragma once + +#include "RE/G/GImageInfoBaseImpl.h" + +namespace RE +{ + class GImageInfo : public GImageInfoBaseImpl + { + public: + ~GImageInfo() override; // 00 + + // override (GImageInfoImpl) + std::uint32_t GetWidth() const override; // 01 + std::uint32_t GetHeight() const override; // 02 + GTexture* GetTexture(GRenderer* a_renderer) override; // 03 + std::uint32_t GetImageInfoType() const override; // 06 + + // override (GTexture::ChangeHandler) + void OnChange(GRenderer* a_renderer, EventType a_changeType) override; // 01 + bool Recreate(GRenderer* a_renderer) override; // 02 + + // members + GPtr image; // 28 + std::uint32_t targetWidth; // 30 + std::uint32_t targetHeight; // 34 + bool releaseImage; // 38 + std::uint8_t pad39; // 39 + std::uint16_t pad3A; // 3A + std::uint32_t pad3C; // 3C + }; + static_assert(sizeof(GImageInfo) == 0x40); +} diff --git a/include/RE/G/GImageInfoBase.h b/include/RE/G/GImageInfoBase.h new file mode 100644 index 000000000..94ca9c576 --- /dev/null +++ b/include/RE/G/GImageInfoBase.h @@ -0,0 +1,36 @@ +#pragma once + +#include "RE/G/GMemory.h" +#include "RE/G/GRect.h" +#include "RE/G/GRefCountBaseNTS.h" +#include "RE/G/GStats.h" +#include "RE/G/GTexture.h" + +namespace RE +{ + class GRenderer; + + class GImageInfoBase : + public GRefCountBaseNTS, // 00 + public GTexture::ChangeHandler // 10 + { + public: + enum class ImageInfoType + { + kImageInfo, + kSubImageInfo, + kOther + }; + + virtual ~GImageInfoBase(); // 00 + + // add + virtual std::uint32_t GetWidth() const = 0; // 01 + virtual std::uint32_t GetHeight() const = 0; // 02 + virtual GTexture* GetTexture(GRenderer* a_renderer) = 0; // 03 + virtual GImageInfoBase* CreateSubImage(const GRect& a_rect, GMemoryHeap* a_heap = GMemory::GetGlobalHeap()); // 04 + virtual GRect GetRect() const; // 05 + virtual std::uint32_t GetImageInfoType() const; // 06 + }; + static_assert(sizeof(GImageInfoBase) == 0x18); +} diff --git a/include/RE/G/GImageInfoBaseImpl.h b/include/RE/G/GImageInfoBaseImpl.h new file mode 100644 index 000000000..649128635 --- /dev/null +++ b/include/RE/G/GImageInfoBaseImpl.h @@ -0,0 +1,24 @@ +#pragma once + +#include "RE/G/GImageInfoBase.h" + +namespace RE +{ + class GImageInfoBaseImpl : public GImageInfoBase + { + public: + ~GImageInfoBaseImpl() override; // 00 + + // override (GImageInfoBase) + GTexture* GetTexture(GRenderer* a_renderer) override; // 03 + + // override (GTexture::ChangeHandler) + void OnChange(GRenderer* a_renderer, EventType a_changeType); // 01 + + // members + GPtr texture; // 18 + std::uint32_t textureUsage; // 20 + std::uint32_t pad24; // 24 + }; + static_assert(sizeof(GImageInfoBaseImpl) == 0x28); +} diff --git a/include/RE/H/HUDData.h b/include/RE/H/HUDData.h index 4b5c1d9a7..bf65ac3e2 100644 --- a/include/RE/H/HUDData.h +++ b/include/RE/H/HUDData.h @@ -19,6 +19,8 @@ namespace RE kActivateNoLabel = 3, kCenter = 4, kSubtitle = 5, + kSubtitleHide = 6, + kShowArrowCount = 7, kSetBlinking = 11, kSetFadeOut = 12, kSetPct = 13, diff --git a/include/RE/H/HighProcessData.h b/include/RE/H/HighProcessData.h index 079a767f8..6b94fcb58 100644 --- a/include/RE/H/HighProcessData.h +++ b/include/RE/H/HighProcessData.h @@ -287,9 +287,9 @@ namespace RE float breathTimer; // 324 float voiceTimer; // 328 float dyingTimer; // 32C - std::uint64_t unk330; // 330 + TESTopicInfo* lastGreeting; // 330 std::uint64_t unk338; // 338 - float closeDialogueTimer; // 340 + float awarePlayerTimer; // 340 std::uint32_t unk344; // 344 TESIdleForm* currentProcessIdle; // 348 RefHandle unk350; // 350 diff --git a/include/RE/H/SendHUDMessage.h b/include/RE/H/SendHUDMessage.h new file mode 100644 index 000000000..e09adee5f --- /dev/null +++ b/include/RE/H/SendHUDMessage.h @@ -0,0 +1,21 @@ +#pragma once + +namespace RE +{ + namespace SendHUDMessage + { + inline void PopHUDMode(const char* a_hudMode) + { + using func_t = decltype(&SendHUDMessage::PopHUDMode); + REL::Relocation func{ RELOCATION_ID(50726, 51621) }; + return func(a_hudMode); + } + + inline void PushHUDMode(const char* a_hudMode) + { + using func_t = decltype(&SendHUDMessage::PushHUDMode); + REL::Relocation func{ RELOCATION_ID(50725, 51620) }; + return func(a_hudMode); + } + } +} diff --git a/include/RE/I/ID.h b/include/RE/I/ID.h index 037d92558..3aa2081d8 100644 --- a/include/RE/I/ID.h +++ b/include/RE/I/ID.h @@ -9,8 +9,15 @@ namespace RE struct ID : public FileID { public: + void GenerateFromPath(const char* a_path) + { + using func_t = decltype(&ID::GenerateFromPath); + REL::Relocation func{ RELOCATION_ID(68635, 69979) }; + return func(this, a_path); + } + // members - std::uint32_t dir; // 0 + std::uint32_t dir{ 0 }; // 0 }; static_assert(sizeof(ID) == 0xC); } diff --git a/include/RE/I/ImageData.h b/include/RE/I/ImageData.h deleted file mode 100644 index 2cb0db36c..000000000 --- a/include/RE/I/ImageData.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "RE/B/BSFixedString.h" - -namespace RE -{ - struct ImageData - { - void* unk00; // 00 - smart ptr - std::uint64_t unk08; // 08 - BSFixedString filePath; // 10 - }; - static_assert(sizeof(ImageData) == 0x18); -} diff --git a/include/RE/I/InputEvent.h b/include/RE/I/InputEvent.h index b8b8841e3..a5eef04ba 100644 --- a/include/RE/I/InputEvent.h +++ b/include/RE/I/InputEvent.h @@ -19,6 +19,7 @@ namespace RE class CharEvent; class IDEvent; class MouseMoveEvent; + class ThumbstickEvent; class InputEvent { @@ -45,6 +46,9 @@ namespace RE [[nodiscard]] MouseMoveEvent* AsMouseMoveEvent(); [[nodiscard]] const MouseMoveEvent* AsMouseMoveEvent() const; + [[nodiscard]] ThumbstickEvent* AsThumbstickEvent(); + [[nodiscard]] const ThumbstickEvent* AsThumbstickEvent() const; + // members stl::enumeration device; // 08 stl::enumeration eventType; // 0C diff --git a/include/RE/L/LocalMapMenu.h b/include/RE/L/LocalMapMenu.h index fa5e1e7cb..ae5846c86 100644 --- a/include/RE/L/LocalMapMenu.h +++ b/include/RE/L/LocalMapMenu.h @@ -1,10 +1,10 @@ #pragma once #include "RE/B/BSCullingProcess.h" +#include "RE/B/BSScaleformExternalTexture.h" #include "RE/B/BSTArray.h" #include "RE/B/BSTSmartPointer.h" #include "RE/G/GFxValue.h" -#include "RE/I/ImageData.h" #include "RE/I/ImageSpaceShaderParam.h" #include "RE/L/LocalMapCamera.h" #include "RE/M/MenuEventHandler.h" @@ -79,7 +79,7 @@ namespace RE float unk00038; // 00038 float unk0003C; // 0003C LocalMapCullingProcess localCullingProcess; // 00040 - ImageData unk303A0; // 303A0 + BSScaleformExternalTexture unk303A0; // 303A0 GFxValue unk303B8; // 303B8 GFxValue unk303D0; // 303D0 void* unk303E8; // 303E8 diff --git a/include/RE/M/MainMenu.h b/include/RE/M/MainMenu.h index 1c1766cb2..46f678157 100644 --- a/include/RE/M/MainMenu.h +++ b/include/RE/M/MainMenu.h @@ -1,9 +1,9 @@ #pragma once +#include "RE/B/BSScaleformExternalTexture.h" #include "RE/B/BSTEvent.h" #include "RE/G/GFxFunctionHandler.h" #include "RE/I/IMenu.h" -#include "RE/I/ImageData.h" namespace RE { @@ -40,12 +40,12 @@ namespace RE void Call(Params& a_params) override; // 01 // members - ImageData unk50; // 50 - std::uint32_t unk68; // 68 - std::uint8_t unk6C; // 6C - std::uint8_t unk6D; // 6D - std::uint8_t unk6E; // 6E - std::uint8_t pad6F; // 6F + BSScaleformExternalTexture gamerIconTexture; // 50 + std::uint32_t unk68; // 68 + std::uint8_t unk6C; // 6C + std::uint8_t unk6D; // 6D + std::uint8_t unk6E; // 6E + std::uint8_t pad6F; // 6F }; static_assert(sizeof(MainMenu) == 0x70); } diff --git a/include/RE/M/MenuTopicManager.h b/include/RE/M/MenuTopicManager.h index 8ce2fd92e..3bd12eeca 100644 --- a/include/RE/M/MenuTopicManager.h +++ b/include/RE/M/MenuTopicManager.h @@ -31,22 +31,22 @@ namespace RE { public: // members - BSString topicText; // 00 - bool unk10; // 10 - bool unk11; // 11 - bool unk12; // 12 - data.topic->formID == 0xFD || data.topic->formID == 0x118 - std::uint8_t unk13; // 13 - std::uint32_t unk14; // 14 - BSSimpleList responses; // 18 - TESQuest* parentQuest; // 28 - TESTopicInfo* parentTopicInfo; // 30 - TESTopic* parentTopic; // 38 - BSSimpleList* unk40; // 40 - std::uint8_t unk48; // 48 - bool neverSaid; // 49 - std::uint16_t unk4A; // 4A - std::uint32_t unk4C; // 4C - TESTopic* unk50; // 50 + BSString topicText; // 00 + bool unk10; // 10 + bool unk11; // 11 + bool unk12; // 12 - data.topic->formID == 0xFD || data.topic->formID == 0x118 + std::uint8_t unk13; // 13 + std::uint32_t unk14; // 14 + BSSimpleList responses; // 18 + TESQuest* parentQuest; // 28 + TESTopicInfo* parentTopicInfo; // 30 + TESTopic* parentTopic; // 38 + BSSimpleList::Node* currentResponse; // 40 + std::uint8_t unk48; // 48 + bool neverSaid; // 49 + std::uint16_t unk4A; // 4A + std::uint32_t unk4C; // 4C + TESTopic* unk50; // 50 }; static_assert(sizeof(Dialogue) == 0x58); @@ -65,32 +65,32 @@ namespace RE } // members - BSSimpleList* selectedResponseNode; // 18 - BSSimpleList* dialogueList; // 20 - std::uint64_t unk28; // 28 - TESTopicInfo* rootTopicInfo; // 30 - Dialogue* lastSelectedDialogue; // 38 - REX::W32::CRITICAL_SECTION criticalSection; // 40 - ObjectRefHandle speaker; // 68 - ObjectRefHandle lastSpeaker; // 6C - used if the dialogue menu was closed but the NPC is still talking - TESTopicInfo* currentTopicInfo; // 70 - only valid when the NPC is talking - TESTopicInfo* lastTopicInfo; // 78 - used if the dialogue menu was closed but the NPC is still talking - BSTArray blockingBranches; // 80 - BSTArray topLevelBranches; // 98 - bool isGreetingPlayer; // B0 - bool unkB1; // B1 - bool isSayingGoodbye; // B2 - bool unkB3; // B3 - bool unkB4; // B4 - bool unkB5; // B5 - bool unkB6; // B6 - bool unkB7; // B7 - bool unkB8; // B8 - bool unkB9; // B9 - bool unkBA; // BA - bool unkBB; // BB - std::uint16_t padBC; // BC - BSTArray unkC0; // C0 + BSSimpleList::Node* selectedResponseNode; // 18 + BSSimpleList* dialogueList; // 20 + std::uint64_t unk28; // 28 + TESTopicInfo* rootTopicInfo; // 30 + Dialogue* lastSelectedDialogue; // 38 + REX::W32::CRITICAL_SECTION criticalSection; // 40 + ObjectRefHandle speaker; // 68 + ObjectRefHandle lastSpeaker; // 6C - used if the dialogue menu was closed but the NPC is still talking + TESTopicInfo* currentTopicInfo; // 70 - only valid when the NPC is talking + TESTopicInfo* lastTopicInfo; // 78 - used if the dialogue menu was closed but the NPC is still talking + BSTArray blockingBranches; // 80 + BSTArray topLevelBranches; // 98 + bool isGreetingPlayer; // B0 + bool unkB1; // B1 + bool isSayingGoodbye; // B2 + bool unkB3; // B3 + bool unkB4; // B4 + bool unkB5; // B5 + bool unkB6; // B6 + bool unkB7; // B7 + bool unkB8; // B8 + bool unkB9; // B9 + bool unkBA; // BA + bool unkBB; // BB + std::uint16_t padBC; // BC + BSTArray unkC0; // C0 }; static_assert(sizeof(MenuTopicManager) == 0xD8); } diff --git a/include/RE/M/MiddleHighProcessData.h b/include/RE/M/MiddleHighProcessData.h index dce381b3b..2bf632a17 100644 --- a/include/RE/M/MiddleHighProcessData.h +++ b/include/RE/M/MiddleHighProcessData.h @@ -171,7 +171,7 @@ namespace RE float headHeightOffset; // 204 ObjectRefHandle occupiedFurniture; // 208 std::uint32_t unk20C; // 20C - std::uint64_t unk210; // 210 + TESIdleForm* unk210; // 210 ActorHandle commandingActor; // 218 std::uint32_t pad21C; // 21C InventoryEntryData* leftHand; // 220 diff --git a/include/RE/Skyrim.h b/include/RE/Skyrim.h index 9c0ca6d3f..c97e5c3be 100644 --- a/include/RE/Skyrim.h +++ b/include/RE/Skyrim.h @@ -312,6 +312,8 @@ #include "RE/B/BSResourceNiBinaryStream.h" #include "RE/B/BSResponse.h" #include "RE/B/BSSaveDataSystemUtility.h" +#include "RE/B/BSScaleformExternalTexture.h" +#include "RE/B/BSScaleformImageLoader.h" #include "RE/B/BSScaleformManager.h" #include "RE/B/BSScaleformTranslator.h" #include "RE/B/BSSceneGraph.h" @@ -770,6 +772,8 @@ #include "RE/G/GFxExternalInterface.h" #include "RE/G/GFxFileConstants.h" #include "RE/G/GFxFunctionHandler.h" +#include "RE/G/GFxImageLoader.h" +#include "RE/G/GFxImageResource.h" #include "RE/G/GFxInitImportActions.h" #include "RE/G/GFxKey.h" #include "RE/G/GFxKeyboardState.h" @@ -841,6 +845,9 @@ #include "RE/G/GHashsetNodeEntry.h" #include "RE/G/GImage.h" #include "RE/G/GImageBase.h" +#include "RE/G/GImageInfo.h" +#include "RE/G/GImageInfoBase.h" +#include "RE/G/GImageInfoBaseImpl.h" #include "RE/G/GList.h" #include "RE/G/GMath.h" #include "RE/G/GMatrix2D.h" @@ -899,6 +906,7 @@ #include "RE/H/HighProcessData.h" #include "RE/H/HitData.h" #include "RE/H/HorseCameraState.h" +#include "RE/H/SendHUDMessage.h" #include "RE/H/hkAabb.h" #include "RE/H/hkArray.h" #include "RE/H/hkBaseObject.h" @@ -1093,7 +1101,6 @@ #include "RE/I/IVMSaveLoadInterface.h" #include "RE/I/IVirtualMachine.h" #include "RE/I/IXAudio2VoiceCallback.h" -#include "RE/I/ImageData.h" #include "RE/I/ImageSpaceData.h" #include "RE/I/ImageSpaceEffect.h" #include "RE/I/ImageSpaceEffectDepthOfField.h" diff --git a/include/RE/U/UISaveLoadManager.h b/include/RE/U/UISaveLoadManager.h index f12cdf269..ce628b983 100644 --- a/include/RE/U/UISaveLoadManager.h +++ b/include/RE/U/UISaveLoadManager.h @@ -1,6 +1,7 @@ #pragma once #include "RE/B/BSFixedString.h" +#include "RE/B/BSScaleformExternalTexture.h" #include "RE/B/BSTEvent.h" #include "RE/B/BSTSingleton.h" #include "RE/G/GFxValue.h" @@ -27,14 +28,12 @@ namespace RE BSEventNotifyControl ProcessEvent(const BGSSaveLoadManagerEvent* a_event, BSTEventSource* a_eventSource) override; // 01 // members - void* unk18; // 18 - std::uint64_t unk20; // 20 - BSFixedString unk28; // 28 - GFxValue unk30; // 30 - BSFixedString unk48; // 48 - std::uint64_t unk50; // 50 - std::uint64_t unk58; // 58 - std::uint64_t unk60; // 60 + BSScaleformExternalTexture screenshotTexture; // 18 + GFxValue unk30; // 30 + BSFixedString unk48; // 48 + std::uint64_t unk50; // 50 + std::uint64_t unk58; // 58 + std::uint64_t unk60; // 60 }; static_assert(sizeof(UISaveLoadManager) == 0x68); } diff --git a/src/RE/B/BSAudioManager.cpp b/src/RE/B/BSAudioManager.cpp index 7bfe6292f..503918d23 100644 --- a/src/RE/B/BSAudioManager.cpp +++ b/src/RE/B/BSAudioManager.cpp @@ -39,4 +39,11 @@ namespace RE REL::Relocation func{ RELOCATION_ID(66403, 67665) }; return func(this, a_soundHandle, a_editorID, a_flags); } + + void BSAudioManager::BuildSoundDataFromFile(BSSoundHandle& a_soundHandle, const BSResource::ID& a_file, std::uint32_t a_flags, std::uint32_t a_priority) + { + using func_t = decltype(&BSAudioManager::BuildSoundDataFromFile); + REL::Relocation func{ RELOCATION_ID(66402, 67664) }; + return func(this, a_soundHandle, a_file, a_flags, a_priority); + } } diff --git a/src/RE/B/BSSoundHandle.cpp b/src/RE/B/BSSoundHandle.cpp index 212fa23db..65df5d268 100644 --- a/src/RE/B/BSSoundHandle.cpp +++ b/src/RE/B/BSSoundHandle.cpp @@ -26,6 +26,13 @@ namespace RE return func(this, a_fadeTimeMS); } + std::uint64_t BSSoundHandle::GetDuration() + { + using func_t = decltype(&BSSoundHandle::GetDuration); + REL::Relocation func{ RELOCATION_ID(66369, 67630) }; + return func(this); + } + bool BSSoundHandle::IsPlaying() const { using func_t = decltype(&BSSoundHandle::IsPlaying); @@ -61,6 +68,13 @@ namespace RE return func(this, a_node); } + void BSSoundHandle::SetOutputModel(const BGSSoundOutput* a_outputModel) + { + using func_t = decltype(&BSSoundHandle::SetOutputModel); + REL::Relocation func{ RELOCATION_ID(66363, 67624) }; + return func(this, a_outputModel); + } + bool BSSoundHandle::SetVolume(float a_volume) { using func_t = decltype(&BSSoundHandle::SetVolume); diff --git a/src/RE/C/Calendar.cpp b/src/RE/C/Calendar.cpp index 7f5114dfb..2c9552493 100644 --- a/src/RE/C/Calendar.cpp +++ b/src/RE/C/Calendar.cpp @@ -86,12 +86,17 @@ namespace RE return GetDaysPassed() * 24.0F; } - float Calendar::GetHoursPerDay() const + float Calendar::GetHoursPerDay() { REL::Relocation hours{ RELOCATION_ID(241610, 195681) }; return *hours; } + std::uint32_t Calendar::GetMinutes() const + { + return static_cast(60 * GetHour()) % 60; + } + std::uint32_t Calendar::GetMonth() const { return gameMonth ? static_cast(gameMonth->value) : 7; @@ -147,12 +152,32 @@ namespace RE return setting ? setting->GetString() : "Bad Month"; } + std::string Calendar::GetOrdinalSuffix() const + { + auto gmst = RE::GameSettingCollection::GetSingleton(); + + switch (static_cast(GetDay())) { + case 1: + case 21: + case 31: + return gmst->GetSetting("sFirstOrdSuffix")->GetString(); + case 2: + case 22: + return gmst->GetSetting("sSecondOrdSuffix")->GetString(); + case 3: + case 23: + return gmst->GetSetting("sThirdOrdSuffix")->GetString(); + default: + return gmst->GetSetting("sDefaultOrdSuffix")->GetString(); + } + } + std::tm Calendar::GetTime() const { std::tm time; time.tm_sec = 0; - time.tm_min = 0; + time.tm_min = static_cast(GetMinutes()); time.tm_hour = static_cast(GetHour()); time.tm_mday = static_cast(GetDay()); time.tm_mon = static_cast(GetMonth()); diff --git a/src/RE/I/InputEvent.cpp b/src/RE/I/InputEvent.cpp index 0506dbbca..033ce090b 100644 --- a/src/RE/I/InputEvent.cpp +++ b/src/RE/I/InputEvent.cpp @@ -4,6 +4,7 @@ #include "RE/C/CharEvent.h" #include "RE/I/IDEvent.h" #include "RE/M/MouseMoveEvent.h" +#include "RE/T/ThumbstickEvent.h" namespace RE { @@ -46,4 +47,14 @@ namespace RE { return GetEventType() == INPUT_EVENT_TYPE::kMouseMove ? static_cast(this) : nullptr; } + + ThumbstickEvent* InputEvent::AsThumbstickEvent() + { + return GetEventType() == INPUT_EVENT_TYPE::kThumbstick ? static_cast(this) : nullptr; + } + + const ThumbstickEvent* InputEvent::AsThumbstickEvent() const + { + return GetEventType() == INPUT_EVENT_TYPE::kThumbstick ? static_cast(this) : nullptr; + } }