Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesMovie.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifdef MODAPI_DLL_EXPORT
#include "stdafx.h"
#include <Spore\Movie\cMovieLetterbox.h>
#include <Spore\Movie\MovieSystem.h>

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
70 changes: 70 additions & 0 deletions Spore ModAPI/SourceCode/Movie/MovieSystem.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#ifndef MODAPI_DLL_EXPORT
#include <Spore\Movie\MovieSystem.h>

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
20 changes: 20 additions & 0 deletions Spore ModAPI/SourceCode/Movie/cMovieLetterbox.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef MODAPI_DLL_EXPORT
#include <Spore\Movie\cMovieLetterbox.h>

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
7 changes: 6 additions & 1 deletion Spore ModAPI/SourceCode/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,9 @@ int RefCountTemplateAtomic::Release()
return 0;
}
return mnRefCount;
}
}


IRefCount::~IRefCount()
{
}
6 changes: 6 additions & 0 deletions Spore ModAPI/SourceCode/RenderWare/RenderWare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
****************************************************************************/
#include <Spore\RenderWare\RWHeader.h>
#include <Spore\RenderWare\CompiledState.h>
#include <Spore\RenderWare\ILayer.h>

namespace RenderWare
{
Expand All @@ -44,4 +45,9 @@ namespace RenderWare
}
return false;
}


ILayer::~ILayer()
{
}
}
9 changes: 9 additions & 0 deletions Spore ModAPI/Spore ModAPI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@
<ClInclude Include="Spore\Graphics\cCubeMapIndex.h" />
<ClInclude Include="Spore\IO\IniFile.h" />
<ClInclude Include="Spore\IO\StreamCompressionZLib.h" />
<ClInclude Include="Spore\Movie\cMovieLetterbox.h" />
<ClInclude Include="Spore\Movie\cMoviePlayInfo.h" />
<ClInclude Include="Spore\Movie\cMovieRecordInfo.h" />
<ClInclude Include="Spore\Movie\MovieSystem.h" />
<ClInclude Include="Spore\RenderWare\ILayer.h" />
<ClInclude Include="Spore\RenderWare\RenderStats.h" />
<ClInclude Include="Spore\Swarm\cDecal.h" />
<ClInclude Include="Spore\Terrain\cTerrainDecal.h" />
<ClInclude Include="Spore\Terrain\cTerrainSphereDecal.h" />
Expand Down Expand Up @@ -954,6 +960,7 @@
<ClInclude Include="Spore\UTFWin\WinTreeView.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="SourceCode\DLL\AddressesMovie.cpp" />
<ClCompile Include="SourceCode\DLL\AddressesOpenSSL.cpp" />
<ClCompile Include="SourceCode\Allocator.cpp" />
<ClCompile Include="SourceCode\Anim\Animations.cpp" />
Expand Down Expand Up @@ -1021,6 +1028,8 @@
<ClCompile Include="SourceCode\Graphics\RenderTargets.cpp" />
<ClCompile Include="SourceCode\Graphics\GeneratedMesh.cpp" />
<ClCompile Include="SourceCode\IO\IniFile.cpp" />
<ClCompile Include="SourceCode\Movie\cMovieLetterbox.cpp" />
<ClCompile Include="SourceCode\Movie\MovieSystem.cpp" />
<ClCompile Include="SourceCode\OpenSSL.cpp" />
<ClCompile Include="SourceCode\Pollinator\Pollinator.cpp" />
<ClCompile Include="SourceCode\RenderWare\Raster.cpp" />
Expand Down
27 changes: 27 additions & 0 deletions Spore ModAPI/Spore ModAPI.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -2307,6 +2307,24 @@
<ClInclude Include="Spore\Graphics\cCubeMapIndex.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Movie\cMovieLetterbox.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Movie\cMoviePlayInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Movie\cMovieRecordInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Movie\MovieSystem.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\RenderWare\ILayer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\RenderWare\RenderStats.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="SourceCode\Allocator.cpp">
Expand Down Expand Up @@ -2804,6 +2822,15 @@
<ClCompile Include="SourceCode\IO\IniFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SourceCode\Movie\cMovieLetterbox.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SourceCode\DLL\AddressesMovie.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SourceCode\Movie\MovieSystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Natvis Include="EASTL.natvis" />
Expand Down
90 changes: 90 additions & 0 deletions Spore ModAPI/Spore/Movie/MovieSystem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#pragma once

#include <Spore\Internal.h>
#include <Spore\RenderWare\ILayer.h>
#include <Spore\Movie\cMoviePlayInfo.h>
#include <Spore\Movie\cMovieRecordInfo.h>

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);
}
}
41 changes: 41 additions & 0 deletions Spore ModAPI/Spore/Movie/cMovieLetterbox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#pragma once

#include <Spore\App\IMessageListener.h>
#include <Spore\UTFWin\IWinProc.h>
#include <Spore\UTFWin\UILayout.h>

#define cMovieLetterboxPtr eastl::intrusive_ptr<Movie::cMovieLetterbox>

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);
}
}
Loading
Loading