Skip to content

Commit

Permalink
AMoviePlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
AdventureT committed Dec 28, 2023
1 parent b56a280 commit 2086db5
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 11 deletions.
1 change: 1 addition & 0 deletions OpenJPOG/Source/AMoviePlayer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "AMoviePlayer.h"
167 changes: 167 additions & 0 deletions OpenJPOG/Source/AMoviePlayer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
#pragma once

#include "TKernel/TDebug.h"
#include "TKernel/TVector2.h"
#include "TRender/TTextureResource.h"


TOSHI_NAMESPACE_BEGIN

class AMoviePlayer
{
public:
AMoviePlayer()
{
m_bIsStopped = TTRUE;
m_bIsInitialized = TFALSE;
m_bIsFrameReady = TFALSE;
m_bIsFullscreen = TTRUE;
m_bIsPaused = TFALSE;
m_bRenderMovie = TTRUE;
}

virtual ~AMoviePlayer() = default;

virtual TBOOL InitializeMoviePlayer()
{
if (!m_bIsInitialized) {
m_bIsInitialized = TTRUE;
}
return TFALSE;
}

virtual TBOOL ShutdownMoviePlayer()
{
if (m_bIsInitialized) {
m_bIsInitialized = TFALSE;
}
return TFALSE;
}

virtual TBOOL Update(TFLOAT a_fDeltaTime)
{
return TFALSE;
}

virtual TBOOL StartMovie(TPCHAR a_szMovieName, TBOOL a_bUnk1, TPCHAR a_szUnk2, TBOOL a_bUnk3)
{
return TFALSE;
}

virtual TBOOL CloseMovie()
{
return TFALSE;
}

virtual TBOOL StopMovie()
{
m_bIsStopped = TTRUE;
return TFALSE;
}

virtual TBOOL PauseMovie(TBOOL a_bPause)
{
m_bIsStopped = TTRUE;
return TFALSE;
}

virtual TBOOL IsMoviePlaying()
{
return !m_bIsStopped;
}

virtual TBOOL IsPaused()
{
return m_bIsPaused;
}

virtual TBOOL RenderToFrameBuffer()
{
return TFALSE;
}

virtual TBOOL IsInitialized()
{
return m_bIsInitialized;
}

virtual void SetLocaleInfoA(TPCHAR a_szLocale)
{
}

virtual TBOOL FrameReady()
{
return m_bIsFrameReady;
}

virtual void RenderMovie(TBOOL a_bRender)
{
m_bRenderMovie = a_bRender;
}

virtual TBOOL Render()
{
return TFALSE;
}

// Probably a spelling mistake from the devs (Bit)
virtual TBOOL Render_BackBufferBlit()
{
return TFALSE;
}

virtual void SetDoAudio(TBOOL a_bDoAudio)
{
m_bDoAudio = a_bDoAudio;
}

virtual void SetDoVideo(TBOOL a_bDoVideo)
{
m_bDoVideo = a_bDoVideo;
}

virtual void SetFullScreen(TBOOL a_bFullscreen)
{
m_bIsFullscreen = a_bFullscreen;
}

virtual TBOOL SetFrameReady(TBOOL a_bFreameReady)
{
m_bIsFrameReady = a_bFreameReady;
}

private:

virtual TBOOL GetTextureUVs(TVector2 &a_rvUV1, TVector2 &a_rvUV2)
{
return TFALSE;
}

virtual TBOOL IsFullscreen()
{
return m_bIsFullscreen;
}

virtual TBOOL RenderToTexture(TTextureResource *a_pTextureResource)
{
return TFALSE;
}

virtual TTextureResource* GetTexture()
{
return TNULL;
}

private:
// 0x0 vftable
TBOOL m_bIsStopped; // 0x4
TBOOL m_bIsInitialized; // 0x5
TBOOL m_bIsFrameReady; // 0x7
TBOOL m_bIsFullscreen; // 0x8
TBOOL m_bDoAudio; // 0x9
TBOOL m_bDoVideo; // 0xA
TBOOL m_bIsPaused; // 0xB
TBOOL m_bRenderMovie; // 0xC
};

TOSHI_NAMESPACE_END
2 changes: 1 addition & 1 deletion OpenJPOG/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AApplication g_oTheApp;

TBOOL AApplication::OnCreate(TINT argc, TPCHAR* const argv)
{
m_pInputTask = (ADummyTask*)GetKernel()->GetScheduler()->CreateTask(TGetClass(ADummyTask), TNULL);
m_pInputTask = (ADummyTask*)g_oTheApp.GetKernel()->GetScheduler()->CreateTask(TGetClass(ADummyTask), TNULL);
m_pInputTask->Create();
m_pInputTask->Activate(TTRUE);
m_pInputTask->SetName((TPCHAR)"InputTask");
Expand Down
1 change: 1 addition & 0 deletions OpenJPOG/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ project ("OpenJPOG")
{
"TKernelInterface",
"TApplication",
"TRenderInterface",
"libtheora",
"theoraplay",
"fmodvc.lib"
Expand Down
2 changes: 1 addition & 1 deletion Toshi/Include/TKernel/TDList.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class TOSHI_EXPORT TGenericDList
};

template <class T, int C = 0>
class TDList : public TGenericDList
class TOSHI_EXPORT TDList : public TGenericDList
{
public:

Expand Down
2 changes: 1 addition & 1 deletion Toshi/Include/TKernel/TFreeList.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TOSHI_NAMESPACE_BEGIN
class TOSHI_EXPORT TFreeList
{
public:
struct Node
struct TOSHI_EXPORT Node
{
friend class TFreeList;
public:
Expand Down
2 changes: 1 addition & 1 deletion Toshi/Include/TKernel/TManagedPointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
TOSHI_NAMESPACE_BEGIN

template<class T>
class TManagedPointer
class TOSHI_EXPORT TManagedPointer
{
public:
TManagedPointer() : m_pObject(TNULL)
Expand Down
2 changes: 1 addition & 1 deletion Toshi/Include/TKernel/TNodeList.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class TOSHI_EXPORT TGenericNodeList
return *this;
}

Iterator& operator++(int)
Iterator operator++(int)
{
TASSERT(m_pPtr != TNULL);
Iterator old = m_pPtr;
Expand Down
10 changes: 5 additions & 5 deletions Toshi/Include/TKernel/TNodeTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ TOSHI_NAMESPACE_BEGIN
// Code from OpenToshi

template <class T>
class TNodeTree
class TOSHI_EXPORT TNodeTree
{
public:
class TNode
class TOSHI_EXPORT TNode
{
public:
friend TNodeTree;
Expand Down Expand Up @@ -95,7 +95,7 @@ class TNodeTree

a_pSourceNode->m_Tree = this;
a_pSourceNode->m_Parent = parentNode;
m_Count += 1;
m_Count++;
}

/**
Expand Down Expand Up @@ -142,7 +142,7 @@ class TNodeTree
return &node;
}

m_Count -= 1;
m_Count--;
}

if (flag)
Expand Down Expand Up @@ -198,7 +198,7 @@ class TNodeTree

if (node->Tree() == this)
{
m_Count -= 1;
m_Count--;
}

if (node->Tree() == TNULL || node->Tree() == this)
Expand Down
12 changes: 12 additions & 0 deletions Toshi/Include/TKernel/TVector2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "TDebug.h"

TOSHI_NAMESPACE_BEGIN

class TVector2
{

};

TOSHI_NAMESPACE_END
12 changes: 12 additions & 0 deletions Toshi/Include/TRender/TTextureResource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "TKernel/TDebug.h"

TOSHI_NAMESPACE_BEGIN

class TTextureResource
{

};

TOSHI_NAMESPACE_END
2 changes: 1 addition & 1 deletion Toshi/Source/TKernel/TScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TScheduler::TScheduler(TKernelInterface* a_pKernel)
TTask* TScheduler::CreateTask(TClass const& a_rTaskClass, TTask* a_pTask)
{
TASSERT(a_rTaskClass.IsA(TGetClass(TTask)) == TTRUE);
TTask *pTask = (TTask*)a_rTaskClass.CreateObject();
TTask *pTask = static_cast<TTask*>(a_rTaskClass.CreateObject());
TASSERT(pTask != TNULL);
m_oTaskTree.InsertAtRoot(pTask);
if (a_pTask) {
Expand Down
1 change: 1 addition & 0 deletions Toshi/Source/TKernel/TVector2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "TVector2.h"
1 change: 1 addition & 0 deletions Toshi/Source/TRender/TTextureResource.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "TTextureResource.h"
58 changes: 58 additions & 0 deletions Toshi/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,64 @@ project ("TApplication")
runtime "Release"
optimize "On"

filter "configurations:Final"
defines "TOSHI_FINAL"
runtime "Release"
optimize "On"

project ("TRenderInterface")
kind "SharedLib"
language "C++"
cppdialect "C++20"
characterset "ASCII"

links
{
"winmm.lib",
"TKernelInterface"
}

includedirs
{
"Include",
"Include/TKernel",
"Include/TRender"
}

defines
{
"TOSHI_USER_ENGINE",
"_CRT_SECURE_NO_WARNINGS"
}

filter "files:**.c"
flags { "NoPCH" }

filter "system:windows"
systemversion "latest"

files
{
"Include/*.h",
"Include/TRender/**.h",
"Source/TRender/**.cpp"
}

defines
{
"TOSHI_SKU_WINDOWS"
}

filter "configurations:Debug"
defines "TOSHI_DEBUG"
runtime "Debug"
symbols "On"

filter "configurations:Release"
defines "TOSHI_RELEASE"
runtime "Release"
optimize "On"

filter "configurations:Final"
defines "TOSHI_FINAL"
runtime "Release"
Expand Down

0 comments on commit 2086db5

Please sign in to comment.