2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 12:27:43 +00:00

Several architectural fixes and additions

This commit is contained in:
Jack Andersen
2017-01-21 15:40:12 -10:00
parent 00247ca53e
commit 0744a2307a
68 changed files with 508 additions and 586 deletions

View File

@@ -0,0 +1,37 @@
#include "CAudioStateWin.hpp"
#include "Audio/CSfxManager.hpp"
#include "CArchitectureMessage.hpp"
#include "CArchitectureQueue.hpp"
#include "GameGlobalObjects.hpp"
#include "CGameState.hpp"
#include "MP1.hpp"
namespace urde
{
namespace MP1
{
CIOWin::EMessageReturn CAudioStateWin::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{
CMain* m = static_cast<CMain*>(g_Main);
const EArchMsgType msgType = msg.GetType();
if (msgType == EArchMsgType::SetGameState)
{
CSfxManager::KillAll(CSfxManager::ESfxChannels::One);
CSfxManager::TurnOnChannel(CSfxManager::ESfxChannels::One);
}
else if (msgType == EArchMsgType::QuitGameplay)
{
if (g_GameState->GetWorldTransitionManager()->GetTransType() == CWorldTransManager::ETransType::Disabled ||
m->GetFlowState() != EFlowState::Zero)
{
CSfxManager::SetChannel(CSfxManager::ESfxChannels::Zero);
CSfxManager::KillAll(CSfxManager::ESfxChannels::One);
}
}
return EMessageReturn::Normal;
}
}
}