docs: add plugin setup guide

This commit is contained in:
2026-05-30 18:33:24 +12:00
parent f3db41c402
commit b61043a3fe
1776 changed files with 122386 additions and 2 deletions
@@ -0,0 +1,66 @@
#pragma once
#include "Scaleform/M/Memory.h"
namespace Scaleform
{
class RefCountImplCore
{
public:
static constexpr auto RTTI{ RE::RTTI::Scaleform__RefCountImplCore };
static constexpr auto VTABLE{ RE::VTABLE::Scaleform__RefCountImplCore };
RefCountImplCore() = default;
virtual ~RefCountImplCore() = default; // 00
protected:
// members
volatile std::int32_t refCount{ 1 }; // 08
};
static_assert(sizeof(RefCountImplCore) == 0x10);
class RefCountImpl :
public RefCountImplCore // 00
{
public:
static constexpr auto RTTI{ RE::RTTI::Scaleform__RefCountImpl };
static constexpr auto VTABLE{ RE::VTABLE::Scaleform__RefCountImpl };
virtual ~RefCountImpl() = default; // NOLINT(modernize-use-override) 00
void AddRef()
{
REX::TAtomicRef myRefCount{ refCount };
++refCount;
}
void Release()
{
REX::TAtomicRef myRefCount{ refCount };
if (--myRefCount == 0) {
delete this;
}
}
};
static_assert(sizeof(RefCountImpl) == 0x10);
template <class Base, std::int32_t>
class RefCountBaseStatImpl :
public Base // 00
{
public:
RefCountBaseStatImpl() = default;
SF_HEAP_REDEFINE_NEW(RefCountBaseStatImpl);
};
//static_assert(sizeof(RefCountBaseStatImpl<void*, 0>) == 0x10);
template <class, std::int32_t STAT>
class RefCountBase :
public RefCountBaseStatImpl<RefCountImpl, STAT> // 00
{
public:
RefCountBase() = default;
};
//static_assert(sizeof(RefCountBase<void*, 0>) == 0x10);
}
@@ -0,0 +1,27 @@
#pragma once
namespace Scaleform::Render
{
class Color
{
public:
class Rgb32
{
public:
// members
std::uint8_t blue; // 0
std::uint8_t green; // 1
std::uint8_t red; // 2
std::uint8_t alpha; // 3
};
static_assert(sizeof(Rgb32) == 0x4);
// members
union
{
Rgb32 channels;
std::uint32_t raw;
}; // 0
};
static_assert(sizeof(Color) == 0x4);
}
@@ -0,0 +1,47 @@
#pragma once
#include "Scaleform/P/Ptr.h"
#include "Scaleform/R/Render_ContextImpl_Entry.h"
#include "Scaleform/R/Render_ContextImpl_EntryChange.h"
#include "Scaleform/R/Render_ContextImpl_EntryData.h"
#include "Scaleform/R/Render_ContextImpl_EntryTable.h"
#include "Scaleform/R/Render_ContextImpl_RTHandle.h"
#include "Scaleform/R/Render_ContextImpl_RenderNotify.h"
#include "Scaleform/T/ThreadId.h"
namespace Scaleform
{
class Event;
class MemoryHeap;
namespace Render::ContextImpl
{
class ContextCaptureNotify;
class ContextLock;
class Snapshot;
class Context
{
public:
// members
MemoryHeap* heap; // 000
ThreadId createThreadID; // 008
EntryTable table; // 010
Ptr<ContextLock> captureLock; // 070
List<ContextCaptureNotify> captureNotifyList; // 078
RenderNotify* renderer; // 088
bool multiThreadedUse; // 090
bool nextCaptureCalledInFrame; // 091
volatile bool captureCalled; // 092
volatile bool diChangesRequired; // 093
volatile bool shutdownRequested; // 094
Event* volatile shutdownEvent; // 098
RenderNotify::ContextNode renderNode; // 0A0
List<RTHandle::HandleData> rtHandleList; // 0B8
Snapshot* snapshots[4]; // 0C8
std::uint64_t snapshotFrameIDs[4]; // 0E8
std::uint64_t finalizedFrameID; // 108
};
static_assert(sizeof(Context) == 0x110);
}
}
@@ -0,0 +1,25 @@
#pragma once
#include "Scaleform/L/List.h"
namespace Scaleform::Render::ContextImpl
{
class Context;
class RenderNotify;
class __declspec(novtable) ContextCaptureNotify :
public ListNode<ContextCaptureNotify> // 00
{
public:
virtual ~ContextCaptureNotify(); // 00
// add
virtual void OnCapture() {} // 01
virtual void OnNextCapture([[maybe_unused]] RenderNotify* a_notify) {} // 02
virtual void OnShutdown([[maybe_unused]] bool a_waitFlag) {} // 03
// members
Context* ownedContext{ nullptr }; // 18
};
static_assert(sizeof(ContextCaptureNotify) == 0x20);
}
@@ -0,0 +1,20 @@
#pragma once
namespace Scaleform::Render
{
class LinearHeap;
namespace ContextImpl
{
class EntryData;
template <class C, class B>
class ContextData_ImplMixin : public B
{
public:
virtual EntryData* ConstructCopy(LinearHeap& heap) const;
virtual void CopyTo(void* pdest) const;
virtual void Destroy();
};
}
}
@@ -0,0 +1,19 @@
#pragma once
#include "Scaleform/L/Lock.h"
#include "Scaleform/R/RefCountBase.h"
namespace Scaleform::Render::ContextImpl
{
class Context;
class __declspec(novtable) ContextLock :
public RefCountBase<ContextLock, 69> // 00
{
public:
// members
Lock lockObject; // 10
Context* context; // 38
};
static_assert(sizeof(ContextLock) == 0x40);
}
@@ -0,0 +1,14 @@
#pragma once
#include "Scaleform/R/Render_ContextImpl_RTHandle.h"
namespace Scaleform::Render::ContextImpl
{
template <class C>
class DisplayHandle :
public RTHandle // 0
{
public:
};
//static_assert(sizeof(DisplayHandle<void*>) == 0x8);
}
@@ -0,0 +1,38 @@
#pragma once
#include "Scaleform/L/List.h"
namespace Scaleform::Render::ContextImpl
{
class EntryChange;
class EntryData;
class TreeCacheNode;
class Entry
{
public:
class PropagateNode :
public ListNode<PropagateNode> // 00
{
public:
};
static_assert(sizeof(PropagateNode) == 0x10);
// members
union
{
Entry* prev;
EntryChange* change;
}; // 00
union
{
Entry* next;
std::size_t refCount;
}; // 08
EntryData* native; // 10
TreeCacheNode* renderer; // 18
Entry* parent; // 20
PropagateNode node; // 28
};
static_assert(sizeof(Entry) == 0x38);
}
@@ -0,0 +1,19 @@
#pragma once
namespace Scaleform::Render::ContextImpl
{
class Entry;
class EntryChange
{
public:
// members
Entry* node; // 00
union
{
std::uint32_t changeBits;
EntryChange* nextFreeNode;
}; // 08
};
static_assert(sizeof(EntryChange) == 0x10);
}
@@ -0,0 +1,39 @@
#pragma once
namespace Scaleform::Render
{
class LinearHeap;
namespace ContextImpl
{
class Entry;
class __declspec(novtable) EntryData
{
public:
enum class EntryType : std::uint16_t
{
kBase,
kRoot,
kContainer,
kShape,
kMesh,
kText
};
virtual ~EntryData(); // 00
// add
virtual EntryData* ConstructCopy(LinearHeap& a_heap) const = 0; // 01
virtual void CopyTo(void* a_dest) const = 0; // 02
virtual void ReleaseNodes() const {} // 03
virtual void Destroy() = 0; // 04
virtual bool PropagateUp(Entry* a_entry) const; // 05
// members
REX::TEnumSet<EntryType, std::uint16_t> type; // 08
std::uint16_t flags; // 0A
};
static_assert(sizeof(EntryData) == 0x10);
}
}
@@ -0,0 +1,10 @@
#pragma once
namespace Scaleform::Render::ContextImpl
{
class EntryListAccessor
{
public:
};
static_assert(std::is_empty_v<EntryListAccessor>);
}
@@ -0,0 +1,16 @@
#pragma once
#include "Scaleform/R/Render_ContextImpl_Entry.h"
#include "Scaleform/R/Render_ContextImpl_EntryPageBase.h"
namespace Scaleform::Render::ContextImpl
{
class EntryPage :
public EntryPageBase // 000
{
public:
// members
Entry entries[72]; // 038
};
static_assert(sizeof(EntryPage) == 0xFF8);
}
@@ -0,0 +1,22 @@
#pragma once
#include "Scaleform/L/List.h"
namespace Scaleform::Render::ContextImpl
{
class Snapshot;
class SnapshotPage;
class EntryPageBase :
public ListNode<EntryPageBase> // 00
{
public:
// members
std::uint32_t useCount; // 10
Snapshot* snapshot; // 18
SnapshotPage* snapshotPage; // 20
SnapshotPage* displaySnapshotPage; // 28
SnapshotPage* tempPage; // 30
};
static_assert(sizeof(EntryPageBase) == 0x38);
}
@@ -0,0 +1,30 @@
#pragma once
#include "Scaleform/L/List.h"
#include "Scaleform/R/Render_ContextImpl_Entry.h"
#include "Scaleform/R/Render_ContextImpl_EntryListAccessor.h"
#include "Scaleform/R/Render_ContextImpl_EntryPage.h"
#include "Scaleform/R/Render_ContextImpl_EntryPageBase.h"
namespace Scaleform
{
class MemoryHeap;
namespace Render::ContextImpl
{
class Context;
class Snapshot;
class EntryTable
{
public:
// members
Context* context; // 00
MemoryHeap* heap; // 08
List<EntryPage, EntryPageBase> entryPages; // 10
List2<Entry, EntryListAccessor> freeNodes; // 20
Snapshot* activeSnapshot; // 58
};
static_assert(sizeof(EntryTable) == 0x60);
}
}
@@ -0,0 +1,38 @@
#pragma once
#include "Scaleform/L/List.h"
#include "Scaleform/P/Ptr.h"
#include "Scaleform/R/RefCountBase.h"
namespace Scaleform::Render::ContextImpl
{
class ContextLock;
class Entry;
class RTHandle
{
public:
enum class HandleState : std::int32_t
{
kPreCapture,
kValid,
kDead
};
class __declspec(novtable) HandleData :
public RefCountBase<HandleData, 69>, // 00
public ListNode<HandleData> // 10
{
public:
// members
Ptr<ContextLock> contextLock; // 20
REX::TEnumSet<HandleState, std::int32_t> state; // 28
Entry* entry; // 30
};
static_assert(sizeof(HandleData) == 0x38);
// members
Ptr<HandleData> data; // 0
};
static_assert(sizeof(RTHandle) == 0x8);
}
@@ -0,0 +1,52 @@
#pragma once
#include "Scaleform/L/List.h"
#include "Scaleform/R/Render_PagedItemBuffer.h"
#include "Scaleform/R/Render_ThreadCommand.h"
namespace Scaleform::Render::ContextImpl
{
class Context;
class Entry;
class EntryChange;
class ThreadCommandQueue;
class __declspec(novtable) RenderNotify
{
public:
class ContextNode :
public ListNode<ContextNode> // 00
{
public:
// members
Context* context; // 10
};
static_assert(sizeof(ContextNode) == 0x18);
class __declspec(novtable) ServiceCommand :
public ThreadCommand // 00
{
public:
void Execute() override; // 01
// members
RenderNotify* notify; // 10
};
static_assert(sizeof(ServiceCommand) == 0x18);
virtual ~RenderNotify();
virtual void NewCapture(Context* a_context, bool a_hasChanges);
virtual void ContextReleased(Context* a_context);
virtual void ServiceQueues();
virtual void EntryChanges(Context&, PagedItemBuffer<EntryChange, 63>&, [[maybe_unused]] bool a_forceUpdateImages = false) {}
virtual void EntryDestroy(Entry*) {}
virtual void EntryFlush(Entry*) {}
// members
List<ContextNode> activeContextSet; // 08
ThreadCommandQueue* rtCommandQueue; // 18
ServiceCommand serviceCommandInstance; // 20
};
static_assert(sizeof(RenderNotify) == 0x38);
}
@@ -0,0 +1,21 @@
#pragma once
#include "Scaleform/L/List.h"
namespace Scaleform::Render::ContextImpl
{
class EntryData;
class EntryPage;
class SnapshotPage :
public ListNode<SnapshotPage> // 000
{
public:
// members
EntryPage* entryPage; // 010
SnapshotPage* olderSnapshotPage; // 018
SnapshotPage* newerSnapshotPage; // 020
EntryData* data[72]; // 028
};
static_assert(sizeof(SnapshotPage) == 0x268);
}
@@ -0,0 +1,12 @@
#pragma once
namespace Scaleform::Render
{
enum class EdgeAAMode : std::int32_t
{
kInherit = 0x0000,
kOn = 1 << 2,
kOff = 1 << 3,
kDisable = kOn | kOff
};
}
@@ -0,0 +1,21 @@
#pragma once
#include "Scaleform/T/ThreadId.h"
namespace Scaleform::Render
{
class HAL;
class Renderer2D;
class TextureManager;
class Interfaces
{
public:
// members
TextureManager* textureManager; // 00
HAL* hal; // 08
Renderer2D* renderer2D; // 10
ThreadId renderThreadID; // 18
};
static_assert(sizeof(Interfaces) == 0x20);
}
@@ -0,0 +1,31 @@
#pragma once
namespace Scaleform
{
class MemoryHeap;
namespace Render
{
class LinearHeap
{
public:
class PageType
{
public:
// members
std::byte* start; // 00
std::byte* end; // 08
std::byte* free; // 10
};
static_assert(sizeof(PageType) == 0x18);
// members
MemoryHeap* heap; // 00
std::size_t granularity; // 08
PageType* pagePool; // 10
PageType* lastPage; // 18
std::size_t maxPages; // 20
};
static_assert(sizeof(LinearHeap) == 0x28);
}
}
@@ -0,0 +1,55 @@
#pragma once
namespace Scaleform::Render
{
template <class T>
class Matrix2x4Data
{
public:
// members
T m[2][4]; // 00
};
template <class T>
class Matrix2x4 :
public Matrix2x4Data<T> // 00
{
public:
};
}
namespace Scaleform::Render
{
template <class T>
class Matrix3x4Data
{
public:
// members
T m[3][4]; // 00
};
template <class T>
class Matrix3x4 :
public Matrix3x4Data<T> // 00
{
public:
};
}
namespace Scaleform::Render
{
template <class T>
class Matrix4x4Data
{
public:
// members
T m[4][4]; // 00
};
template <class T>
class Matrix4x4 :
public Matrix4x4Data<T> // 00
{
public:
};
}
@@ -0,0 +1,23 @@
#pragma once
namespace Scaleform::Render
{
template <class C, std::int32_t N>
class PagedItemBuffer
{
public:
class Page
{
public:
// members
Page* next; // 00
std::int32_t count; // 08
C items[N]; // ??
};
// members
Page* pages; // 00
Page* last; // 08
};
static_assert(sizeof(PagedItemBuffer<void*, 0>) == 0x10);
}
@@ -0,0 +1,13 @@
#pragma once
namespace Scaleform::Render
{
template <class T>
class Point
{
public:
// members
T x; // 00
T y; // ??
};
}
@@ -0,0 +1,22 @@
#pragma once
namespace Scaleform::Render
{
template <class T>
class RectData
{
public:
// members
T x1; // 00
T y1; // ??
T x2; // ??
T y2; // ??
};
template <class T>
class Rect :
public RectData<T> // 00
{
public:
};
}
@@ -0,0 +1,23 @@
#pragma once
#include "Scaleform/R/Render_Matrix.h"
namespace Scaleform::Render
{
class ScreenToWorld
{
public:
constexpr ScreenToWorld() = default;
// members
float sx{ std::numeric_limits<float>::max() }; // 00
float sy{ std::numeric_limits<float>::max() }; // 04
float lastX{ std::numeric_limits<float>::max() }; // 08
float lastY{ std::numeric_limits<float>::max() }; // 0C
Render::Matrix4x4<float> matProj; // 10
Render::Matrix3x4<float> matView; // 50
Render::Matrix3x4<float> matWorld; // 80
Render::Matrix4x4<float> matInvProj; // B0
};
static_assert(sizeof(ScreenToWorld) == 0xF0);
}
@@ -0,0 +1,15 @@
#pragma once
#include "Scaleform/R/RefCountBase.h"
namespace Scaleform::Render
{
class __declspec(novtable) ThreadCommand :
public RefCountBase<ThreadCommand, 2> // 00
{
public:
// add
virtual void Execute() = 0; // 01
};
static_assert(sizeof(ThreadCommand) == 0x10);
}
@@ -0,0 +1,18 @@
#pragma once
namespace Scaleform::Render
{
class Interfaces;
class ThreadCommand;
class __declspec(novtable) ThreadCommandQueue
{
public:
virtual ~ThreadCommandQueue() = default; // 00
// add
virtual void PushThreadCommand(ThreadCommand* a_command) = 0; // 01
virtual void GetRenderInterfaces(Interfaces* a_ptr); // 02
};
static_assert(sizeof(ThreadCommandQueue) == 0x8);
}
@@ -0,0 +1,13 @@
#pragma once
#include "Scaleform/R/Render_TreeNode.h"
namespace Scaleform::Render
{
class TreeContainer :
public TreeNode // 00
{
public:
};
static_assert(sizeof(TreeContainer) == 0x38);
}
@@ -0,0 +1,13 @@
#pragma once
#include "Scaleform/R/Render_ContextImpl_Entry.h"
namespace Scaleform::Render
{
class TreeNode :
public ContextImpl::Entry // 00
{
public:
};
static_assert(sizeof(TreeNode) == 0x38);
}
@@ -0,0 +1,13 @@
#pragma once
#include "Scaleform/R/Render_TreeContainer.h"
namespace Scaleform::Render
{
class TreeRoot :
public TreeContainer
{
public:
};
static_assert(sizeof(TreeRoot) == 0x38);
}
@@ -0,0 +1,12 @@
#pragma once
#include "Scaleform/R/Render_TreeNode.h"
namespace Scaleform::Render
{
class TreeShape :
public TreeNode
{
public:
};
}
@@ -0,0 +1,46 @@
#pragma once
namespace Scaleform::Render
{
class Viewport
{
public:
enum class Flag : std::uint32_t
{
kIsRenderTexture = 1 << 0,
kAlphaComposite = 1 << 1,
kUseScissorRect = 1 << 2,
kNoSetState = 1 << 3,
kOrientation_Normal = 0,
kOrientation_R90 = 1 << 4,
kOrientation_180 = 1 << 5,
kOrientation_L90 = kOrientation_R90 | kOrientation_180,
kOrientation_Mask = kOrientation_Normal | kOrientation_R90 | kOrientation_180 | kOrientation_L90,
kStereo_SplitV = 1 << 6,
kStereo_SplitH = 1 << 7,
kStereo_AnySplit = kStereo_SplitV | kStereo_SplitH,
kRenderTextureAlpha = kIsRenderTexture | kAlphaComposite,
kFirstHalFlag = 1 << 8
};
// members
std::int32_t bufferWidth; // 00
std::int32_t bufferHeight; // 04
std::int32_t left; // 08
std::int32_t top; // 0C
std::int32_t width; // 10
std::int32_t height; // 14
std::int32_t scissorLeft; // 18
std::int32_t scissorTop; // 1C
std::int32_t scissorWidth; // 20
std::int32_t scissorHeight; // 24
REX::TEnumSet<Flag, std::uint32_t> flags; // 28
};
static_assert(sizeof(Viewport) == 0x2C);
}