Skip to content

Commit

Permalink
Misc RE
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Mar 16, 2024
1 parent 9190333 commit fd38f90
Show file tree
Hide file tree
Showing 31 changed files with 449 additions and 102 deletions.
9 changes: 8 additions & 1 deletion cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions include/RE/B/BSAudioManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ namespace RE
class BSXAudio2GameSound;
struct BSSoundHandle;

namespace BSResource
{
struct ID;
}

class BSAudioManager
{
public:
Expand All @@ -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
Expand Down
55 changes: 55 additions & 0 deletions include/RE/B/BSScaleformExternalTexture.h
Original file line number Diff line number Diff line change
@@ -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_t> func{ RELOCATION_ID(80298, 82321) };
return func(this, a_path);
}

void ReleaseTexture()
{
using func_t = decltype(&BSScaleformExternalTexture::ReleaseTexture);
REL::Relocation<func_t> func{ RELOCATION_ID(80294, 82317) };
return func(this);
}

bool SetTexture(NiTexture* a_texture)
{
using func_t = decltype(&BSScaleformExternalTexture::SetTexture);
REL::Relocation<func_t> func{ RELOCATION_ID(80295, 82318) };
return func(this, a_texture);
}

// members
NiPointer<NiTexture> gamebryoTexture; // 00
std::uint32_t renderTarget; // 08
std::uint32_t pad0C; // 0C
BSFixedString filePath; // 10
};
static_assert(sizeof(BSScaleformExternalTexture) == 0x18);
}
51 changes: 51 additions & 0 deletions include/RE/B/BSScaleformImageLoader.h
Original file line number Diff line number Diff line change
@@ -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<GTexture> 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_t> func{ RELOCATION_ID(82382, 84469) };
return func(this, a_texture);
}

void RemoveTexture(BSScaleformExternalTexture& a_texture)
{
using func_t = decltype(&BSScaleformImageLoader::RemoveTexture);
REL::Relocation<func_t> func{ RELOCATION_ID(82383, 84470) };
return func(this, a_texture);
}

// members
BSTHashMap<std::uint32_t, TextureEntry> textures; // 18
};
static_assert(sizeof(BSScaleformImageLoader) == 0x48);
}
3 changes: 3 additions & 0 deletions include/RE/B/BSSoundHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace RE
{
class BGSSoundOutput;
class NiAVObject;
class NiPoint3;

Expand Down Expand Up @@ -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();
Expand Down
28 changes: 14 additions & 14 deletions include/RE/B/BookMenu.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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<ImageData> unk50; // 50
GPtr<GFxMovieView> book; // 68
NiPointer<NiAVObject> 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<BSScaleformExternalTexture> bookTextures; // 50
GPtr<GFxMovieView> book; // 68
NiPointer<NiAVObject> 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);
}
4 changes: 3 additions & 1 deletion include/RE/C/Calendar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions include/RE/C/CreationClubMenu.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -39,8 +39,8 @@ namespace RE
BSEventNotifyControl ProcessEvent(const MenuOpenCloseEvent* a_event, BSTEventSource<MenuOpenCloseEvent>* a_eventSource) override; // 01

// members
ImageData background; // 58
ImageData details; // 70
BSScaleformExternalTexture background; // 58
BSScaleformExternalTexture details; // 70
};
static_assert(sizeof(CreationClubMenu) == 0x88);
}
4 changes: 2 additions & 2 deletions include/RE/F/FileID.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
20 changes: 20 additions & 0 deletions include/RE/G/GFxImageLoader.h
Original file line number Diff line number Diff line change
@@ -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);
}
28 changes: 28 additions & 0 deletions include/RE/G/GFxImageResource.h
Original file line number Diff line number Diff line change
@@ -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<GImageInfoBase> _imageInfo; // 18
GFxResourceKey _key; // 20
ResourceUse _useType; // 30
};
static_assert(sizeof(GFxImageResource) == 0x38);
}
2 changes: 1 addition & 1 deletion include/RE/G/GImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RE
public GImageBase
{
public:
~GImage() override; // 00
~GImage() override = default; // 00
};
static_assert(sizeof(GImage) == 0x48);
}
32 changes: 32 additions & 0 deletions include/RE/G/GImageInfo.h
Original file line number Diff line number Diff line change
@@ -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<GImage> 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);
}
Loading

0 comments on commit fd38f90

Please sign in to comment.