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:
37
Runtime/MP1/CAudioStateWin.cpp
Normal file
37
Runtime/MP1/CAudioStateWin.cpp
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user