Skip to content

Commit c4791da

Browse files
authored
Add Movie::MovieSystem stub (#119)
1 parent 1a110de commit c4791da

14 files changed

Lines changed: 436 additions & 1 deletion
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#ifdef MODAPI_DLL_EXPORT
2+
#include "stdafx.h"
3+
#include <Spore\Movie\cMovieLetterbox.h>
4+
#include <Spore\Movie\MovieSystem.h>
5+
6+
namespace Movie
7+
{
8+
namespace Addresses(cMovieLetterbox)
9+
{
10+
DefineAddress(Initialize, SelectAddress(0xFAB930, 0xFD7730));
11+
}
12+
13+
namespace Addresses(MovieSystem)
14+
{
15+
DefineAddress(Get, SelectAddress(0x672070, 0x67CAD0));
16+
17+
DefineAddress(DrawLayer, SelectAddress(0xFAB430, 0xFD7240));
18+
19+
DefineAddress(Init, SelectAddress(0xFAD2D0, 0xFD90D0));
20+
DefineAddress(Shutdown, SelectAddress(0xFAB9E0, 0xFD77E0));
21+
DefineAddress(Update, SelectAddress(0xFABF60, 0xFD7D60));
22+
DefineAddress(PlayMovie, SelectAddress(0xFAC9A0, 0xFD87A0));
23+
DefineAddress(MovieIsPlaying, SelectAddress(0xFAB740, 0xFD7550));
24+
DefineAddress(PauseMovie, SelectAddress(0xFAB750, 0xFD7560));
25+
DefineAddress(ContinueMovie, SelectAddress(0xFAB760, 0xFD7570));
26+
DefineAddress(StopMovie, SelectAddress(0xFABBC0, 0xFD79C0));
27+
DefineAddress(CheckEscape, SelectAddress(0xFAB770, 0xFD7580));
28+
DefineAddress(func28h, SelectAddress(0xFAB7E0, 0xFD75F0));
29+
DefineAddress(RecordMovie, SelectAddress(0xFAC370, 0xFD8170));
30+
DefineAddress(MovieIsRecording, SelectAddress(0xFAB830, 0xA1AEE0));
31+
DefineAddress(GetRecordingMovieName, SelectAddress(0xFABC70, 0xFD7A70));
32+
DefineAddress(StopRecordingMovie, SelectAddress(0xFAC160, 0xFD7F60));
33+
DefineAddress(func3Ch, SelectAddress(0x5D3460, 0x5DC490));
34+
DefineAddress(func40h, SelectAddress(0xFAB820, 0xFD7630));
35+
DefineAddress(func44h, SelectAddress(0xFAC8D0, 0xFD86D0));
36+
}
37+
}
38+
#endif
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#ifndef MODAPI_DLL_EXPORT
2+
#include <Spore\Movie\MovieSystem.h>
3+
4+
namespace Movie
5+
{
6+
IMovieSystem::~IMovieSystem()
7+
{
8+
}
9+
10+
auto_STATIC_METHOD_(MovieSystem, IMovieSystem*, Get);
11+
12+
int MovieSystem::AddRef()
13+
{
14+
return 2;
15+
}
16+
int MovieSystem::Release()
17+
{
18+
return 1;
19+
}
20+
MovieSystem::~MovieSystem()
21+
{
22+
}
23+
24+
auto_METHOD_VIRTUAL_VOID(MovieSystem, RenderWare::ILayer, DrawLayer,
25+
Args(uint32_t flags, uint32_t layerNumber, const void* const* viewer, RenderWare::RenderStats* stats),
26+
Args(flags, layerNumber, viewer, stats)
27+
);
28+
29+
30+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, Init);
31+
32+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, Shutdown);
33+
34+
auto_METHOD_VIRTUAL_VOID(MovieSystem, IMovieSystem, Update, Args(uint32_t deltaMS), Args(deltaMS));
35+
36+
auto_METHOD_VIRTUAL(MovieSystem, IMovieSystem, bool, PlayMovie,
37+
Args(const ResourceKey& key, const cMoviePlayInfo& info),
38+
Args(key, info)
39+
);
40+
41+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, MovieIsPlaying);
42+
43+
auto_METHOD_VIRTUAL_VOID_(MovieSystem, IMovieSystem, PauseMovie);
44+
45+
auto_METHOD_VIRTUAL_VOID_(MovieSystem, IMovieSystem, ContinueMovie);
46+
47+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, StopMovie);
48+
49+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, CheckEscape);
50+
51+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, func28h);
52+
53+
auto_METHOD_VIRTUAL(MovieSystem, IMovieSystem, bool, RecordMovie,
54+
Args(const wchar_t* name, const cMovieRecordInfo& info),
55+
Args(name, info)
56+
);
57+
58+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, MovieIsRecording);
59+
60+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, wchar_t*, GetRecordingMovieName);
61+
62+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, StopRecordingMovie);
63+
64+
auto_METHOD_VIRTUAL_(MovieSystem, IMovieSystem, bool, func3Ch);
65+
66+
auto_METHOD_VIRTUAL_VOID(MovieSystem, IMovieSystem, func40h, Args(bool arg_4), Args(arg_4));
67+
68+
auto_METHOD_VIRTUAL_VOID(MovieSystem, IMovieSystem, func44h, Args(int arg_4), Args(arg_4));
69+
}
70+
#endif
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef MODAPI_DLL_EXPORT
2+
#include <Spore\Movie\cMovieLetterbox.h>
3+
4+
namespace Movie
5+
{
6+
auto_METHOD_VOID_(cMovieLetterbox, Initialize);
7+
8+
void* cMovieLetterbox::Cast(uint32_t type) const
9+
{
10+
CLASS_CAST(cMovieLetterbox);
11+
CLASS_CAST(UTFWin::IWinProc);
12+
return nullptr;
13+
}
14+
15+
bool cMovieLetterbox::HandleUIMessage(UTFWin::IWindow* pWindow, const UTFWin::Message& message)
16+
{
17+
return false;
18+
}
19+
}
20+
#endif

‎Spore ModAPI/SourceCode/Object.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,9 @@ int RefCountTemplateAtomic::Release()
227227
return 0;
228228
}
229229
return mnRefCount;
230-
}
230+
}
231+
232+
233+
IRefCount::~IRefCount()
234+
{
235+
}

‎Spore ModAPI/SourceCode/RenderWare/RenderWare.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
****************************************************************************/
1919
#include <Spore\RenderWare\RWHeader.h>
2020
#include <Spore\RenderWare\CompiledState.h>
21+
#include <Spore\RenderWare\ILayer.h>
2122

2223
namespace RenderWare
2324
{
@@ -44,4 +45,9 @@ namespace RenderWare
4445
}
4546
return false;
4647
}
48+
49+
50+
ILayer::~ILayer()
51+
{
52+
}
4753
}

‎Spore ModAPI/Spore ModAPI.vcxproj‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,12 @@
334334
<ClInclude Include="Spore\Graphics\cCubeMapIndex.h" />
335335
<ClInclude Include="Spore\IO\IniFile.h" />
336336
<ClInclude Include="Spore\IO\StreamCompressionZLib.h" />
337+
<ClInclude Include="Spore\Movie\cMovieLetterbox.h" />
338+
<ClInclude Include="Spore\Movie\cMoviePlayInfo.h" />
339+
<ClInclude Include="Spore\Movie\cMovieRecordInfo.h" />
340+
<ClInclude Include="Spore\Movie\MovieSystem.h" />
341+
<ClInclude Include="Spore\RenderWare\ILayer.h" />
342+
<ClInclude Include="Spore\RenderWare\RenderStats.h" />
337343
<ClInclude Include="Spore\Swarm\cDecal.h" />
338344
<ClInclude Include="Spore\Terrain\cTerrainDecal.h" />
339345
<ClInclude Include="Spore\Terrain\cTerrainSphereDecal.h" />
@@ -954,6 +960,7 @@
954960
<ClInclude Include="Spore\UTFWin\WinTreeView.h" />
955961
</ItemGroup>
956962
<ItemGroup>
963+
<ClCompile Include="SourceCode\DLL\AddressesMovie.cpp" />
957964
<ClCompile Include="SourceCode\DLL\AddressesOpenSSL.cpp" />
958965
<ClCompile Include="SourceCode\Allocator.cpp" />
959966
<ClCompile Include="SourceCode\Anim\Animations.cpp" />
@@ -1021,6 +1028,8 @@
10211028
<ClCompile Include="SourceCode\Graphics\RenderTargets.cpp" />
10221029
<ClCompile Include="SourceCode\Graphics\GeneratedMesh.cpp" />
10231030
<ClCompile Include="SourceCode\IO\IniFile.cpp" />
1031+
<ClCompile Include="SourceCode\Movie\cMovieLetterbox.cpp" />
1032+
<ClCompile Include="SourceCode\Movie\MovieSystem.cpp" />
10241033
<ClCompile Include="SourceCode\OpenSSL.cpp" />
10251034
<ClCompile Include="SourceCode\Pollinator\Pollinator.cpp" />
10261035
<ClCompile Include="SourceCode\RenderWare\Raster.cpp" />

‎Spore ModAPI/Spore ModAPI.vcxproj.filters‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,6 +2307,24 @@
23072307
<ClInclude Include="Spore\Graphics\cCubeMapIndex.h">
23082308
<Filter>Header Files</Filter>
23092309
</ClInclude>
2310+
<ClInclude Include="Spore\Movie\cMovieLetterbox.h">
2311+
<Filter>Header Files</Filter>
2312+
</ClInclude>
2313+
<ClInclude Include="Spore\Movie\cMoviePlayInfo.h">
2314+
<Filter>Header Files</Filter>
2315+
</ClInclude>
2316+
<ClInclude Include="Spore\Movie\cMovieRecordInfo.h">
2317+
<Filter>Header Files</Filter>
2318+
</ClInclude>
2319+
<ClInclude Include="Spore\Movie\MovieSystem.h">
2320+
<Filter>Header Files</Filter>
2321+
</ClInclude>
2322+
<ClInclude Include="Spore\RenderWare\ILayer.h">
2323+
<Filter>Header Files</Filter>
2324+
</ClInclude>
2325+
<ClInclude Include="Spore\RenderWare\RenderStats.h">
2326+
<Filter>Header Files</Filter>
2327+
</ClInclude>
23102328
</ItemGroup>
23112329
<ItemGroup>
23122330
<ClCompile Include="SourceCode\Allocator.cpp">
@@ -2804,6 +2822,15 @@
28042822
<ClCompile Include="SourceCode\IO\IniFile.cpp">
28052823
<Filter>Source Files</Filter>
28062824
</ClCompile>
2825+
<ClCompile Include="SourceCode\Movie\cMovieLetterbox.cpp">
2826+
<Filter>Source Files</Filter>
2827+
</ClCompile>
2828+
<ClCompile Include="SourceCode\DLL\AddressesMovie.cpp">
2829+
<Filter>Source Files</Filter>
2830+
</ClCompile>
2831+
<ClCompile Include="SourceCode\Movie\MovieSystem.cpp">
2832+
<Filter>Source Files</Filter>
2833+
</ClCompile>
28072834
</ItemGroup>
28082835
<ItemGroup>
28092836
<Natvis Include="EASTL.natvis" />
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#pragma once
2+
3+
#include <Spore\Internal.h>
4+
#include <Spore\RenderWare\ILayer.h>
5+
#include <Spore\Movie\cMoviePlayInfo.h>
6+
#include <Spore\Movie\cMovieRecordInfo.h>
7+
8+
namespace Movie
9+
{
10+
class IMovieSystem
11+
{
12+
public:
13+
/* 00h */ virtual ~IMovieSystem();
14+
15+
/* 04h */ virtual bool Init() = 0;
16+
/* 08h */ virtual bool Shutdown() = 0;
17+
/* 0Ch */ virtual void Update(uint32_t deltaMS) = 0;
18+
/* 10h */ virtual bool PlayMovie(const ResourceKey& key, const cMoviePlayInfo& info) = 0;
19+
/* 14h */ virtual bool MovieIsPlaying() = 0;
20+
/* 18h */ virtual void PauseMovie() = 0;
21+
/* 1Ch */ virtual void ContinueMovie() = 0;
22+
/* 20h */ virtual bool StopMovie() = 0;
23+
/* 24h */ virtual bool CheckEscape() = 0;
24+
/* 28h */ virtual bool func28h() = 0;
25+
/* 2Ch */ virtual bool RecordMovie(const wchar_t* name, const cMovieRecordInfo& info) = 0;
26+
/* 30h */ virtual bool MovieIsRecording() = 0;
27+
/* 34h */ virtual wchar_t* GetRecordingMovieName() = 0;
28+
/* 38h */ virtual bool StopRecordingMovie() = 0;
29+
/* 3Ch */ virtual bool func3Ch() = 0;
30+
/* 40h */ virtual void func40h(bool) = 0;
31+
/* 44h */ virtual void func44h(int) = 0;
32+
};
33+
ASSERT_SIZE(IMovieSystem, 0x4);
34+
35+
class MovieSystem
36+
: public RenderWare::ILayer
37+
, public IMovieSystem
38+
{
39+
public:
40+
static IMovieSystem* Get();
41+
42+
~MovieSystem();
43+
44+
virtual int AddRef() override;
45+
virtual int Release() override;
46+
47+
virtual void DrawLayer(uint32_t flags, uint32_t layerNumber, const void* const* viewer, RenderWare::RenderStats* stats) override;
48+
49+
virtual bool Init() override;
50+
virtual bool Shutdown() override;
51+
virtual void Update(uint32_t deltaMS) override;
52+
virtual bool PlayMovie(const ResourceKey& key, const cMoviePlayInfo& info) override;
53+
virtual bool MovieIsPlaying() override;
54+
virtual void PauseMovie() override;
55+
virtual void ContinueMovie() override;
56+
virtual bool StopMovie() override;
57+
virtual bool CheckEscape() override;
58+
virtual bool func28h() override;
59+
virtual bool RecordMovie(const wchar_t* name, const cMovieRecordInfo& info) override;
60+
virtual bool MovieIsRecording() override;
61+
virtual wchar_t* GetRecordingMovieName() override;
62+
virtual bool StopRecordingMovie() override;
63+
virtual bool func3Ch() override;
64+
virtual void func40h(bool) override;
65+
virtual void func44h(int) override;
66+
};
67+
68+
namespace Addresses(MovieSystem)
69+
{
70+
DeclareAddress(Get);
71+
DeclareAddress(DrawLayer);
72+
DeclareAddress(Init);
73+
DeclareAddress(Shutdown);
74+
DeclareAddress(Update);
75+
DeclareAddress(PlayMovie);
76+
DeclareAddress(MovieIsPlaying);
77+
DeclareAddress(PauseMovie);
78+
DeclareAddress(ContinueMovie);
79+
DeclareAddress(StopMovie);
80+
DeclareAddress(CheckEscape);
81+
DeclareAddress(func28h);
82+
DeclareAddress(RecordMovie);
83+
DeclareAddress(MovieIsRecording);
84+
DeclareAddress(GetRecordingMovieName);
85+
DeclareAddress(StopRecordingMovie);
86+
DeclareAddress(func3Ch);
87+
DeclareAddress(func40h);
88+
DeclareAddress(func44h);
89+
}
90+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#pragma once
2+
3+
#include <Spore\App\IMessageListener.h>
4+
#include <Spore\UTFWin\IWinProc.h>
5+
#include <Spore\UTFWin\UILayout.h>
6+
7+
#define cMovieLetterboxPtr eastl::intrusive_ptr<Movie::cMovieLetterbox>
8+
9+
namespace Movie
10+
{
11+
class cMovieLetterbox
12+
: public UTFWin::DefaultWinProc<>
13+
{
14+
public:
15+
static const uint32_t TYPE = 0x450062A;
16+
17+
enum ControlIDs
18+
{
19+
kWinRoot = -1
20+
};
21+
22+
void Initialize();
23+
inline void SetVisible(bool visible)
24+
{
25+
mLayout->SetVisible(visible);
26+
}
27+
28+
virtual void* Cast(uint32_t type) const override;
29+
30+
virtual bool HandleUIMessage(UTFWin::IWindow * pWindow, const UTFWin::Message& message) override;
31+
32+
public:
33+
/* 0Ch */ UILayoutPtr mLayout;
34+
};
35+
ASSERT_SIZE(cMovieLetterbox, 0x10);
36+
37+
namespace Addresses(cMovieLetterbox)
38+
{
39+
DeclareAddress(Initialize);
40+
}
41+
}

0 commit comments

Comments
 (0)