From 144f10d93cfb6636373a05d8dae8cd6fee1e509d Mon Sep 17 00:00:00 2001 From: 0KepOnline <78259495+0KepOnline@users.noreply.github.com> Date: Tue, 22 Sep 2026 19:36:53 +0300 Subject: [PATCH] Add `Movie::MovieSystem` stub --- .../SourceCode/DLL/AddressesMovie.cpp | 38 ++++++++ Spore ModAPI/SourceCode/Movie/MovieSystem.cpp | 70 +++++++++++++++ .../SourceCode/Movie/cMovieLetterbox.cpp | 20 +++++ Spore ModAPI/SourceCode/Object.cpp | 7 +- .../SourceCode/RenderWare/RenderWare.cpp | 6 ++ Spore ModAPI/Spore ModAPI.vcxproj | 9 ++ Spore ModAPI/Spore ModAPI.vcxproj.filters | 27 ++++++ Spore ModAPI/Spore/Movie/MovieSystem.h | 90 +++++++++++++++++++ Spore ModAPI/Spore/Movie/cMovieLetterbox.h | 41 +++++++++ Spore ModAPI/Spore/Movie/cMoviePlayInfo.h | 42 +++++++++ Spore ModAPI/Spore/Movie/cMovieRecordInfo.h | 37 ++++++++ Spore ModAPI/Spore/Object.h | 10 +++ Spore ModAPI/Spore/RenderWare/ILayer.h | 18 ++++ Spore ModAPI/Spore/RenderWare/RenderStats.h | 22 +++++ 14 files changed, 436 insertions(+), 1 deletion(-) create mode 100644 Spore ModAPI/SourceCode/DLL/AddressesMovie.cpp create mode 100644 Spore ModAPI/SourceCode/Movie/MovieSystem.cpp create mode 100644 Spore ModAPI/SourceCode/Movie/cMovieLetterbox.cpp create mode 100644 Spore ModAPI/Spore/Movie/MovieSystem.h create mode 100644 Spore ModAPI/Spore/Movie/cMovieLetterbox.h create mode 100644 Spore ModAPI/Spore/Movie/cMoviePlayInfo.h create mode 100644 Spore ModAPI/Spore/Movie/cMovieRecordInfo.h create mode 100644 Spore ModAPI/Spore/RenderWare/ILayer.h create mode 100644 Spore ModAPI/Spore/RenderWare/RenderStats.h diff --git a/Spore ModAPI/SourceCode/DLL/AddressesMovie.cpp b/Spore ModAPI/SourceCode/DLL/AddressesMovie.cpp new file mode 100644 index 00000000..bfa947df --- /dev/null +++ b/Spore ModAPI/SourceCode/DLL/AddressesMovie.cpp @@ -0,0 +1,38 @@ +#ifdef MODAPI_DLL_EXPORT +#include "stdafx.h" +#include +#include + +namespace Movie +{ + namespace Addresses(cMovieLetterbox) + { + DefineAddress(Initialize, SelectAddress(0xFAB930, 0xFD7730)); + } + + namespace Addresses(MovieSystem) + { + DefineAddress(Get, SelectAddress(0x672070, 0x67CAD0)); + + DefineAddress(DrawLayer, SelectAddress(0xFAB430, 0xFD7240)); + + DefineAddress(Init, SelectAddress(0xFAD2D0, 0xFD90D0)); + DefineAddress(Shutdown, SelectAddress(0xFAB9E0, 0xFD77E0)); + DefineAddress(Update, SelectAddress(0xFABF60, 0xFD7D60)); + DefineAddress(PlayMovie, SelectAddress(0xFAC9A0, 0xFD87A0)); + DefineAddress(MovieIsPlaying, SelectAddress(0xFAB740, 0xFD7550)); + DefineAddress(PauseMovie, SelectAddress(0xFAB750, 0xFD7560)); + DefineAddress(ContinueMovie, SelectAddress(0xFAB760, 0xFD7570)); + DefineAddress(StopMovie, SelectAddress(0xFABBC0, 0xFD79C0)); + DefineAddress(CheckEscape, SelectAddress(0xFAB770, 0xFD7580)); + DefineAddress(func28h, SelectAddress(0xFAB7E0, 0xFD75F0)); + DefineAddress(RecordMovie, SelectAddress(0xFAC370, 0xFD8170)); + DefineAddress(MovieIsRecording, SelectAddress(0xFAB830, 0xA1AEE0)); + DefineAddress(GetRecordingMovieName, SelectAddress(0xFABC70, 0xFD7A70)); + DefineAddress(StopRecordingMovie, SelectAddress(0xFAC160, 0xFD7F60)); + DefineAddress(func3Ch, SelectAddress(0x5D3460, 0x5DC490)); + DefineAddress(func40h, SelectAddress(0xFAB820, 0xFD7630)); + DefineAddress(func44h, SelectAddress(0xFAC8D0, 0xFD86D0)); + } +} +#endif diff --git a/Spore ModAPI/SourceCode/Movie/MovieSystem.cpp b/Spore ModAPI/SourceCode/Movie/MovieSystem.cpp new file mode 100644 index 00000000..509f69f5 --- /dev/null +++ b/Spore ModAPI/SourceCode/Movie/MovieSystem.cpp @@ -0,0 +1,70 @@ +#ifndef MODAPI_DLL_EXPORT +#include + +namespace Movie +{ + IMovieSystem::~IMovieSystem() + { + } + + auto_STATIC_METHOD_(MovieSystem, IMovieSystem*, Get); + + int MovieSystem::AddRef() + { + return 2; + } + int MovieSystem::Release() + { + return 1; + } + MovieSystem::~MovieSystem() + { + } + + auto_METHOD_VIRTUAL_VOID(MovieSystem, RenderWare::ILayer, DrawLayer, + Args(uint32_t flags, uint32_t layerNumber, const void* const* viewer, RenderWare::RenderStats* stats), + Args(flags, layerNumber, viewer, stats) + ); + + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, Init); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, Shutdown); + + auto_METHOD_VIRTUAL_VOID(MovieSystem, IMovieSystem, Update, Args(uint32_t deltaMS), Args(deltaMS)); + + auto_METHOD_VIRTUAL(MovieSystem, IMovieSystem, bool, PlayMovie, + Args(const ResourceKey& key, const cMoviePlayInfo& info), + Args(key, info) + ); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, MovieIsPlaying); + + auto_METHOD_VIRTUAL_VOID_(MovieSystem, IMovieSystem, PauseMovie); + + auto_METHOD_VIRTUAL_VOID_(MovieSystem, IMovieSystem, ContinueMovie); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, StopMovie); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, CheckEscape); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, func28h); + + auto_METHOD_VIRTUAL(MovieSystem, IMovieSystem, bool, RecordMovie, + Args(const wchar_t* name, const cMovieRecordInfo& info), + Args(name, info) + ); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, MovieIsRecording); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, wchar_t*, GetRecordingMovieName); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, StopRecordingMovie); + + auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, func3Ch); + + auto_METHOD_VIRTUAL_VOID(MovieSystem, IMovieSystem, func40h, Args(bool arg_4), Args(arg_4)); + + auto_METHOD_VIRTUAL_VOID(MovieSystem, IMovieSystem, func44h, Args(int arg_4), Args(arg_4)); +} +#endif diff --git a/Spore ModAPI/SourceCode/Movie/cMovieLetterbox.cpp b/Spore ModAPI/SourceCode/Movie/cMovieLetterbox.cpp new file mode 100644 index 00000000..2d73cdaf --- /dev/null +++ b/Spore ModAPI/SourceCode/Movie/cMovieLetterbox.cpp @@ -0,0 +1,20 @@ +#ifndef MODAPI_DLL_EXPORT +#include + +namespace Movie +{ + auto_METHOD_VOID_(cMovieLetterbox, Initialize); + + void* cMovieLetterbox::Cast(uint32_t type) const + { + CLASS_CAST(cMovieLetterbox); + CLASS_CAST(UTFWin::IWinProc); + return nullptr; + } + + bool cMovieLetterbox::HandleUIMessage(UTFWin::IWindow* pWindow, const UTFWin::Message& message) + { + return false; + } +} +#endif diff --git a/Spore ModAPI/SourceCode/Object.cpp b/Spore ModAPI/SourceCode/Object.cpp index ca5b21ff..a560835a 100644 --- a/Spore ModAPI/SourceCode/Object.cpp +++ b/Spore ModAPI/SourceCode/Object.cpp @@ -227,4 +227,9 @@ int RefCountTemplateAtomic::Release() return 0; } return mnRefCount; -} \ No newline at end of file +} + + +IRefCount::~IRefCount() +{ +} diff --git a/Spore ModAPI/SourceCode/RenderWare/RenderWare.cpp b/Spore ModAPI/SourceCode/RenderWare/RenderWare.cpp index a9d9cfc5..bc441676 100644 --- a/Spore ModAPI/SourceCode/RenderWare/RenderWare.cpp +++ b/Spore ModAPI/SourceCode/RenderWare/RenderWare.cpp @@ -18,6 +18,7 @@ ****************************************************************************/ #include #include +#include namespace RenderWare { @@ -44,4 +45,9 @@ namespace RenderWare } return false; } + + + ILayer::~ILayer() + { + } } diff --git a/Spore ModAPI/Spore ModAPI.vcxproj b/Spore ModAPI/Spore ModAPI.vcxproj index 95eac88c..63b2dbd2 100644 --- a/Spore ModAPI/Spore ModAPI.vcxproj +++ b/Spore ModAPI/Spore ModAPI.vcxproj @@ -334,6 +334,12 @@ + + + + + + @@ -954,6 +960,7 @@ + @@ -1021,6 +1028,8 @@ + + diff --git a/Spore ModAPI/Spore ModAPI.vcxproj.filters b/Spore ModAPI/Spore ModAPI.vcxproj.filters index 24a02a51..c8d903f4 100644 --- a/Spore ModAPI/Spore ModAPI.vcxproj.filters +++ b/Spore ModAPI/Spore ModAPI.vcxproj.filters @@ -2307,6 +2307,24 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + @@ -2804,6 +2822,15 @@ Source Files + + Source Files + + + Source Files + + + Source Files + diff --git a/Spore ModAPI/Spore/Movie/MovieSystem.h b/Spore ModAPI/Spore/Movie/MovieSystem.h new file mode 100644 index 00000000..1ed88f2c --- /dev/null +++ b/Spore ModAPI/Spore/Movie/MovieSystem.h @@ -0,0 +1,90 @@ +#pragma once + +#include +#include +#include +#include + +namespace Movie +{ + class IMovieSystem + { + public: + /* 00h */ virtual ~IMovieSystem(); + + /* 04h */ virtual bool Init() = 0; + /* 08h */ virtual bool Shutdown() = 0; + /* 0Ch */ virtual void Update(uint32_t deltaMS) = 0; + /* 10h */ virtual bool PlayMovie(const ResourceKey& key, const cMoviePlayInfo& info) = 0; + /* 14h */ virtual bool MovieIsPlaying() = 0; + /* 18h */ virtual void PauseMovie() = 0; + /* 1Ch */ virtual void ContinueMovie() = 0; + /* 20h */ virtual bool StopMovie() = 0; + /* 24h */ virtual bool CheckEscape() = 0; + /* 28h */ virtual bool func28h() = 0; + /* 2Ch */ virtual bool RecordMovie(const wchar_t* name, const cMovieRecordInfo& info) = 0; + /* 30h */ virtual bool MovieIsRecording() = 0; + /* 34h */ virtual wchar_t* GetRecordingMovieName() = 0; + /* 38h */ virtual bool StopRecordingMovie() = 0; + /* 3Ch */ virtual bool func3Ch() = 0; + /* 40h */ virtual void func40h(bool) = 0; + /* 44h */ virtual void func44h(int) = 0; + }; + ASSERT_SIZE(IMovieSystem, 0x4); + + class MovieSystem + : public RenderWare::ILayer + , public IMovieSystem + { + public: + static IMovieSystem* Get(); + + ~MovieSystem(); + + virtual int AddRef() override; + virtual int Release() override; + + virtual void DrawLayer(uint32_t flags, uint32_t layerNumber, const void* const* viewer, RenderWare::RenderStats* stats) override; + + virtual bool Init() override; + virtual bool Shutdown() override; + virtual void Update(uint32_t deltaMS) override; + virtual bool PlayMovie(const ResourceKey& key, const cMoviePlayInfo& info) override; + virtual bool MovieIsPlaying() override; + virtual void PauseMovie() override; + virtual void ContinueMovie() override; + virtual bool StopMovie() override; + virtual bool CheckEscape() override; + virtual bool func28h() override; + virtual bool RecordMovie(const wchar_t* name, const cMovieRecordInfo& info) override; + virtual bool MovieIsRecording() override; + virtual wchar_t* GetRecordingMovieName() override; + virtual bool StopRecordingMovie() override; + virtual bool func3Ch() override; + virtual void func40h(bool) override; + virtual void func44h(int) override; + }; + + namespace Addresses(MovieSystem) + { + DeclareAddress(Get); + DeclareAddress(DrawLayer); + DeclareAddress(Init); + DeclareAddress(Shutdown); + DeclareAddress(Update); + DeclareAddress(PlayMovie); + DeclareAddress(MovieIsPlaying); + DeclareAddress(PauseMovie); + DeclareAddress(ContinueMovie); + DeclareAddress(StopMovie); + DeclareAddress(CheckEscape); + DeclareAddress(func28h); + DeclareAddress(RecordMovie); + DeclareAddress(MovieIsRecording); + DeclareAddress(GetRecordingMovieName); + DeclareAddress(StopRecordingMovie); + DeclareAddress(func3Ch); + DeclareAddress(func40h); + DeclareAddress(func44h); + } +} diff --git a/Spore ModAPI/Spore/Movie/cMovieLetterbox.h b/Spore ModAPI/Spore/Movie/cMovieLetterbox.h new file mode 100644 index 00000000..98c1b9b2 --- /dev/null +++ b/Spore ModAPI/Spore/Movie/cMovieLetterbox.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +#include + +#define cMovieLetterboxPtr eastl::intrusive_ptr + +namespace Movie +{ + class cMovieLetterbox + : public UTFWin::DefaultWinProc<> + { + public: + static const uint32_t TYPE = 0x450062A; + + enum ControlIDs + { + kWinRoot = -1 + }; + + void Initialize(); + inline void SetVisible(bool visible) + { + mLayout->SetVisible(visible); + } + + virtual void* Cast(uint32_t type) const override; + + virtual bool HandleUIMessage(UTFWin::IWindow * pWindow, const UTFWin::Message& message) override; + + public: + /* 0Ch */ UILayoutPtr mLayout; + }; + ASSERT_SIZE(cMovieLetterbox, 0x10); + + namespace Addresses(cMovieLetterbox) + { + DeclareAddress(Initialize); + } +} diff --git a/Spore ModAPI/Spore/Movie/cMoviePlayInfo.h b/Spore ModAPI/Spore/Movie/cMoviePlayInfo.h new file mode 100644 index 00000000..bd6b9fdf --- /dev/null +++ b/Spore ModAPI/Spore/Movie/cMoviePlayInfo.h @@ -0,0 +1,42 @@ +#pragma once + +#include + +namespace Movie +{ + enum MovieDrawType + { + kMovieDrawStandard, + kMovieDrawBW, + kMovieDrawTheshold2, + kMovieDrawTheshold4 + }; + + struct cMoviePlayInfo + { + MovieDrawType mDrawType; + float mScale; + float mFadeInTime; + float mFadeOutTime; + float mEscapableTime; + bool mLetterboxOn; + + cMoviePlayInfo( + MovieDrawType drawType = kMovieDrawStandard, + float scale = 1.0f, + float fadeInTime = 0.0f, + float fadeOutTime = 0.0f, + float escapableTime = 0.0f, + bool letterboxOn = true + ) + : mDrawType(drawType) + , mScale(scale) + , mFadeInTime(fadeInTime) + , mFadeOutTime(fadeOutTime) + , mEscapableTime(escapableTime) + , mLetterboxOn(letterboxOn) + { + } + }; + ASSERT_SIZE(cMoviePlayInfo, 0x18); +} diff --git a/Spore ModAPI/Spore/Movie/cMovieRecordInfo.h b/Spore ModAPI/Spore/Movie/cMovieRecordInfo.h new file mode 100644 index 00000000..6d304db0 --- /dev/null +++ b/Spore ModAPI/Spore/Movie/cMovieRecordInfo.h @@ -0,0 +1,37 @@ +#pragma once + +#include + +namespace Movie +{ + struct cMovieRecordInfo + { + uint32_t mWidth; + uint32_t mHeight; + float mFPS; + float mTime; + float mQuality; + bool mAudio; + bool mExcludeUI; + + cMovieRecordInfo( + float fps = 15.0f, + float time = 0.0f, + uint32_t width = 320, + uint32_t height = 240, + float quality = 0.8, + bool audio = true, + bool excludeUI = false + ) + : mFPS(fps) + , mTime(time) + , mWidth(width) + , mHeight(height) + , mQuality(quality) + , mAudio(audio) + , mExcludeUI(excludeUI) + { + } + }; + ASSERT_SIZE(cMovieRecordInfo, 0x18); +} diff --git a/Spore ModAPI/Spore/Object.h b/Spore ModAPI/Spore/Object.h index 6211b44b..356dc8b7 100644 --- a/Spore ModAPI/Spore/Object.h +++ b/Spore ModAPI/Spore/Object.h @@ -175,6 +175,16 @@ class RefCountTemplateAtomic int mnRefCount; }; +class IRefCount +{ +public: + virtual int AddRef() = 0; + virtual int Release() = 0; + virtual ~IRefCount(); + + static const uint32_t TYPE = 0xAE9CB0FA; +}; + /////////////////////////////////// //// INTERNAL IMPLEMENENTATION //// /////////////////////////////////// diff --git a/Spore ModAPI/Spore/RenderWare/ILayer.h b/Spore ModAPI/Spore/RenderWare/ILayer.h new file mode 100644 index 00000000..8be30a89 --- /dev/null +++ b/Spore ModAPI/Spore/RenderWare/ILayer.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +namespace RenderWare +{ + class ILayer + : public IRefCount + { + public: + virtual ~ILayer(); + + // viewer = const cViewer* const*. + virtual void DrawLayer(uint32_t flags, uint32_t layerNumber, const void* const* viewer, RenderStats* stats) = 0; + }; + ASSERT_SIZE(ILayer, 0x4); +} diff --git a/Spore ModAPI/Spore/RenderWare/RenderStats.h b/Spore ModAPI/Spore/RenderWare/RenderStats.h new file mode 100644 index 00000000..9bf74f09 --- /dev/null +++ b/Spore ModAPI/Spore/RenderWare/RenderStats.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +namespace RenderWare +{ + struct RenderStats + { + float mMsPerFrame; + float mFPS; + float mSmoothedMsPerFrame; + float mSmoothedFPS; + float mRenderTime; + int mLayers; + int mJobs; + int mJobsQueued; + int mVertices; + int mIndices; + int mPrimitives; + }; + ASSERT_SIZE(RenderStats, 0x2c); +}