From 67748655ba54ec714eeee7b8975b6585708fc36d Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 4 Nov 2017 23:29:22 -0700 Subject: [PATCH] Compile fixes, Implement CStateSetterFlow::OnMessage --- Runtime/GuiSys/CSplashScreen.cpp | 7 +++++++ Runtime/MP1/CStateSetterFlow.cpp | 10 ++++++++-- Runtime/MP1/MP1.cpp | 4 ++-- Runtime/World/CGameArea.cpp | 17 +++++++++-------- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Runtime/GuiSys/CSplashScreen.cpp b/Runtime/GuiSys/CSplashScreen.cpp index dfcbc893e..ff224c9fa 100644 --- a/Runtime/GuiSys/CSplashScreen.cpp +++ b/Runtime/GuiSys/CSplashScreen.cpp @@ -39,7 +39,14 @@ CIOWin::EMessageReturn CSplashScreen::OnMessage(const CArchitectureMessage& msg, 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) +#endif queue.Push(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 9999, 9999, std::make_shared(ESplashScreen(int(x14_which) + 1)))); return EMessageReturn::RemoveIOWinAndExit; diff --git a/Runtime/MP1/CStateSetterFlow.cpp b/Runtime/MP1/CStateSetterFlow.cpp index f68c104e5..56060a184 100644 --- a/Runtime/MP1/CStateSetterFlow.cpp +++ b/Runtime/MP1/CStateSetterFlow.cpp @@ -1,5 +1,6 @@ #include "CStateSetterFlow.hpp" - +#include "CArchitectureMessage.hpp" +#include "GameGlobalObjects.hpp" namespace urde { namespace MP1 @@ -13,7 +14,12 @@ CStateSetterFlow::CStateSetterFlow() 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; } } diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index 7e9ee10aa..9b9acd9b9 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -102,8 +102,8 @@ CGameArchitectureSupport::CGameArchitectureSupport(CMain& parent, CStreamAudioManager::SetMusicVolume(0x7f); m->ResetGameState(); - //std::shared_ptr splash = std::make_shared(CSplashScreen::ESplashScreen::Nintendo); - //x58_ioWinManager.AddIOWin(splash, 1000, 10000); + std::shared_ptr splash = std::make_shared(CSplashScreen::ESplashScreen::Nintendo); + x58_ioWinManager.AddIOWin(splash, 1000, 10000); std::shared_ptr mf = std::make_shared(); x58_ioWinManager.AddIOWin(mf, 0, 0); diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index 6e229c6b5..1b6eaf6eb 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -296,7 +296,7 @@ static std::vector ReadDependencyList(CInputStream& in) std::pair, s32> GetScriptingMemoryAlways(const IGameArea& area) { SObjectTag tag = {SBIG('MREA'), area.IGetAreaAssetId()}; - std::unique_ptr data = std::move(g_ResFactory->LoadNewResourcePartSync(tag, 0, 96, data)); + std::unique_ptr data = std::move(g_ResFactory->LoadNewResourcePartSync(tag, 0, 96)); if (*reinterpret_cast(data.get()) != SBIG(0xDEADBEEF)) return {}; @@ -326,9 +326,9 @@ std::pair, s32> GetScriptingMemoryAlways(const IGameArea& 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 secSizes(header.secCount); u32 lastSize; @@ -591,7 +591,7 @@ bool CGameArea::DoesAreaNeedSkyNow() const void CGameArea::UpdateFog(float dt) { - CAreaFog* fog = *GetPostConstructed()->x10c4_areaFog; + CAreaFog* fog = GetPostConstructed()->x10c4_areaFog.get(); if (fog) fog->Update(dt); } @@ -600,11 +600,13 @@ void CGameArea::OtherAreaOcclusionChanged() { if (GetPostConstructed()->x10e0_ == 3 && GetPostConstructed()->x10dc_occlusionState != EOcclusionState::Occluded) { + bool unloaded = true; + bool transferred = true; #if 0 bool unloaded = UnloadAllloadedTextures(); bool transferred = TransferTokensToARAM(); - x12c_postConstructed->x1108_27_ = (unloaded && transferred) #endif + x12c_postConstructed->x1108_27_ = (unloaded && transferred); } else { @@ -629,8 +631,7 @@ void CGameArea::PingOcclusionState() unloaded = UnloadAllloadedTextures(); transferred = TransferTokens(); #endif - if (unloaded && transferred) - x12c_postConstructed->x1108_27_ = true; + x12c_postConstructed->x1108_27_ = (unloaded && transferred); x12c_postConstructed->x1108_26_ = true; } @@ -742,7 +743,7 @@ void CGameArea::SetOcclusionState(EOcclusionState state) if (!xf0_24_postConstructed || x12c_postConstructed->x10dc_occlusionState == state) return; - if (state == EOcclusionState::Occluded) + if (state != EOcclusionState::Occluded) { ReloadAllUnloadedTextures(); AddStaticGeometry();