Compile fixes, Implement CStateSetterFlow::OnMessage

This commit is contained in:
Phillip Stephens 2017-11-04 23:29:22 -07:00
parent 140c24bf60
commit 67748655ba
4 changed files with 26 additions and 12 deletions

View File

@ -39,7 +39,14 @@ CIOWin::EMessageReturn CSplashScreen::OnMessage(const CArchitectureMessage& msg,
if (x18_splashTimeout <= 0.f) if (x18_splashTimeout <= 0.f)
{ {
/* HACK: If we're not compiling with Intel's IPP library we want to skip the Dolby Pro Logic II logo
* This is purely a URDE addition and does not reflect retro's intentions. - Phil
*/
#if INTEL_IPP
if (x14_which != ESplashScreen::Dolby)
#else
if (x14_which != ESplashScreen::Retro) if (x14_which != ESplashScreen::Retro)
#endif
queue.Push(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 9999, 9999, queue.Push(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 9999, 9999,
std::make_shared<CSplashScreen>(ESplashScreen(int(x14_which) + 1)))); std::make_shared<CSplashScreen>(ESplashScreen(int(x14_which) + 1))));
return EMessageReturn::RemoveIOWinAndExit; return EMessageReturn::RemoveIOWinAndExit;

View File

@ -1,5 +1,6 @@
#include "CStateSetterFlow.hpp" #include "CStateSetterFlow.hpp"
#include "CArchitectureMessage.hpp"
#include "GameGlobalObjects.hpp"
namespace urde namespace urde
{ {
namespace MP1 namespace MP1
@ -13,7 +14,12 @@ CStateSetterFlow::CStateSetterFlow()
CIOWin::EMessageReturn CStateSetterFlow::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) CIOWin::EMessageReturn CStateSetterFlow::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{ {
return EMessageReturn::Normal; if (msg.GetType() == EArchMsgType::TimerTick)
{
//g_Main->sub80004590();
return EMessageReturn::RemoveIOWinAndExit;
}
return EMessageReturn::Exit;
} }
} }

View File

@ -102,8 +102,8 @@ CGameArchitectureSupport::CGameArchitectureSupport(CMain& parent,
CStreamAudioManager::SetMusicVolume(0x7f); CStreamAudioManager::SetMusicVolume(0x7f);
m->ResetGameState(); m->ResetGameState();
//std::shared_ptr<CIOWin> splash = std::make_shared<CSplashScreen>(CSplashScreen::ESplashScreen::Nintendo); std::shared_ptr<CIOWin> splash = std::make_shared<CSplashScreen>(CSplashScreen::ESplashScreen::Nintendo);
//x58_ioWinManager.AddIOWin(splash, 1000, 10000); x58_ioWinManager.AddIOWin(splash, 1000, 10000);
std::shared_ptr<CIOWin> mf = std::make_shared<CMainFlow>(); std::shared_ptr<CIOWin> mf = std::make_shared<CMainFlow>();
x58_ioWinManager.AddIOWin(mf, 0, 0); x58_ioWinManager.AddIOWin(mf, 0, 0);

View File

@ -296,7 +296,7 @@ static std::vector<SObjectTag> ReadDependencyList(CInputStream& in)
std::pair<std::unique_ptr<u8[]>, s32> GetScriptingMemoryAlways(const IGameArea& area) std::pair<std::unique_ptr<u8[]>, s32> GetScriptingMemoryAlways(const IGameArea& area)
{ {
SObjectTag tag = {SBIG('MREA'), area.IGetAreaAssetId()}; SObjectTag tag = {SBIG('MREA'), area.IGetAreaAssetId()};
std::unique_ptr<u8[]> data = std::move(g_ResFactory->LoadNewResourcePartSync(tag, 0, 96, data)); std::unique_ptr<u8[]> data = std::move(g_ResFactory->LoadNewResourcePartSync(tag, 0, 96));
if (*reinterpret_cast<u32*>(data.get()) != SBIG(0xDEADBEEF)) if (*reinterpret_cast<u32*>(data.get()) != SBIG(0xDEADBEEF))
return {}; return {};
@ -326,9 +326,9 @@ std::pair<std::unique_ptr<u8[]>, s32> GetScriptingMemoryAlways(const IGameArea&
u32 dataLen = ROUND_UP_32(header.secCount * 4); u32 dataLen = ROUND_UP_32(header.secCount * 4);
data.reset(std::move(g_ResFactory->LoadNewResourcePartSync(tag, 96, dataLen))); data = std::move(g_ResFactory->LoadNewResourcePartSync(tag, 96, dataLen));
r = CMemoryInStream(data, dataLen); r = CMemoryInStream(data.get(), dataLen);
std::vector<u32> secSizes(header.secCount); std::vector<u32> secSizes(header.secCount);
u32 lastSize; u32 lastSize;
@ -591,7 +591,7 @@ bool CGameArea::DoesAreaNeedSkyNow() const
void CGameArea::UpdateFog(float dt) void CGameArea::UpdateFog(float dt)
{ {
CAreaFog* fog = *GetPostConstructed()->x10c4_areaFog; CAreaFog* fog = GetPostConstructed()->x10c4_areaFog.get();
if (fog) if (fog)
fog->Update(dt); fog->Update(dt);
} }
@ -600,11 +600,13 @@ void CGameArea::OtherAreaOcclusionChanged()
{ {
if (GetPostConstructed()->x10e0_ == 3 && GetPostConstructed()->x10dc_occlusionState != EOcclusionState::Occluded) if (GetPostConstructed()->x10e0_ == 3 && GetPostConstructed()->x10dc_occlusionState != EOcclusionState::Occluded)
{ {
bool unloaded = true;
bool transferred = true;
#if 0 #if 0
bool unloaded = UnloadAllloadedTextures(); bool unloaded = UnloadAllloadedTextures();
bool transferred = TransferTokensToARAM(); bool transferred = TransferTokensToARAM();
x12c_postConstructed->x1108_27_ = (unloaded && transferred)
#endif #endif
x12c_postConstructed->x1108_27_ = (unloaded && transferred);
} }
else else
{ {
@ -629,8 +631,7 @@ void CGameArea::PingOcclusionState()
unloaded = UnloadAllloadedTextures(); unloaded = UnloadAllloadedTextures();
transferred = TransferTokens(); transferred = TransferTokens();
#endif #endif
if (unloaded && transferred) x12c_postConstructed->x1108_27_ = (unloaded && transferred);
x12c_postConstructed->x1108_27_ = true;
x12c_postConstructed->x1108_26_ = true; x12c_postConstructed->x1108_26_ = true;
} }
@ -742,7 +743,7 @@ void CGameArea::SetOcclusionState(EOcclusionState state)
if (!xf0_24_postConstructed || x12c_postConstructed->x10dc_occlusionState == state) if (!xf0_24_postConstructed || x12c_postConstructed->x10dc_occlusionState == state)
return; return;
if (state == EOcclusionState::Occluded) if (state != EOcclusionState::Occluded)
{ {
ReloadAllUnloadedTextures(); ReloadAllUnloadedTextures();
AddStaticGeometry(); AddStaticGeometry();