Implement CSplashScreen

This commit is contained in:
Jack Andersen 2016-09-12 19:36:21 -10:00
parent ba0287159a
commit 8580c5d972
5 changed files with 106 additions and 4 deletions

View File

@ -17,7 +17,7 @@ CTexturedQuadFilter::CTexturedQuadFilter(CCameraFilterPass::EFilterType type, bo
}
CTexturedQuadFilter::CTexturedQuadFilter(CCameraFilterPass::EFilterType type,
TLockedToken<CTexture>& tex)
TLockedToken<CTexture> tex)
: CTexturedQuadFilter(type, tex->GetBooTexture())
{
m_tex = tex;

View File

@ -37,9 +37,10 @@ class CTexturedQuadFilter
Uniform m_uniform;
public:
CTexturedQuadFilter(CCameraFilterPass::EFilterType type, TLockedToken<CTexture>& tex);
CTexturedQuadFilter(CCameraFilterPass::EFilterType type, TLockedToken<CTexture> tex);
CTexturedQuadFilter(CCameraFilterPass::EFilterType type, boo::ITexture* tex);
void draw(const zeus::CColor& color, float uvScale);
const TLockedToken<CTexture>& GetTex() const { return m_tex; }
using _CLS = CTexturedQuadFilter;
#include "TMultiBlendShaderDecl.hpp"

View File

@ -0,0 +1,71 @@
#include "CSplashScreen.hpp"
#include "CArchitectureMessage.hpp"
#include "CArchitectureQueue.hpp"
#include "CSimplePool.hpp"
#include "GameGlobalObjects.hpp"
namespace urde
{
static const char* SplashTextures[]
{
"MP1/NoARAM/TXTR_NintendoLogo.png",
"MP1/NoARAM/TXTR_RetroLogo.png",
"MP1/NoARAM/TXTR_DolbyLogo.png"
};
CSplashScreen::CSplashScreen(ESplashScreen which)
: CIOWin("SplashScreen"), x14_which(which),
m_quad(CCameraFilterPass::EFilterType::Blend,
g_SimplePool->GetObj(SplashTextures[int(which)]))
{
}
CIOWin::EMessageReturn CSplashScreen::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{
switch (msg.GetType())
{
case EArchMsgType::TimerTick:
{
if (!x25_textureLoaded)
{
if (!m_quad.GetTex().IsLoaded())
return EMessageReturn::Exit;
x25_textureLoaded = true;
}
float dt = MakeMsg::GetParmTimerTick(msg).x4_parm;
x18_splashTimeout -= dt;
if (x18_splashTimeout <= 0.f)
{
if (x14_which != ESplashScreen::Dolby)
queue.Push(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 9999, 9999,
new CSplashScreen(ESplashScreen(int(x14_which) + 1))));
return EMessageReturn::RemoveIOWinAndExit;
}
break;
}
default: break;
}
return EMessageReturn::Exit;
}
void CSplashScreen::Draw() const
{
if (!x25_textureLoaded)
return;
zeus::CColor color;
if (x14_which == ESplashScreen::Nintendo)
color = zeus::CColor{0.86f, 0.f, 0.f, 1.f};
if (x18_splashTimeout > 1.5f)
color.a = 1.f - (x18_splashTimeout - 1.5f) * 2.f;
else if (x18_splashTimeout < 0.5f)
color.a = x18_splashTimeout * 2.f;
const_cast<CTexturedQuadFilter&>(m_quad).draw(color, 1.f);
}
}

View File

@ -1,11 +1,41 @@
#ifndef __URDE_CSPLASHSCREEN_HPP__
#define __URDE_CSPLASHSCREEN_HPP__
#include "CIOWin.hpp"
#include "CToken.hpp"
#include "Graphics/CTexture.hpp"
#include "Graphics/Shaders/CTexturedQuadFilter.hpp"
namespace urde
{
class CSplashScreen
class CSplashScreen : public CIOWin
{
public:
enum class ESplashScreen
{
Nintendo,
Retro,
Dolby
};
enum class EProgressivePhase
{
Before,
During,
After
};
private:
ESplashScreen x14_which;
float x18_splashTimeout = 2.f;
//float x1c_progSelectionTimeout = 0.f;
//EProgressivePhase x20_progressivePhase = EProgressivePhase::Before;
//bool x24_progressiveSelection = true;
bool x25_textureLoaded = false;
CTexturedQuadFilter m_quad;
public:
CSplashScreen(ESplashScreen);
EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&);
void Draw() const;
};
}

View File

@ -111,7 +111,7 @@ class CGameArchitectureSupport
CInputGenerator m_inputGenerator;
CGuiSys m_guiSys;
CIOWinManager m_ioWinManager;
CSplashScreen m_splashScreen;
//CSplashScreen m_splashScreen;
CMainFlow m_mainFlow;
CConsoleOutputWindow m_consoleWindow;
CAudioStateWin m_audioStateWin;