2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 23:11:20 +00:00
metaforce/Runtime/MP1/CAudioStateWin.cpp
Lioncash 1cb289f243 RuntimeCommon: Normalize cpp inclusions
Normalizes the headers for the cpp files in the RuntimeCommon target.
Now all headers and source files within the RuntimeCommon/RuntimeCommonB
targets are normalized and consistent with one another.
2020-01-15 09:15:47 -05:00

30 lines
1.0 KiB
C++

#include "CAudioStateWin.hpp"
#include "Runtime/CArchitectureMessage.hpp"
#include "Runtime/CArchitectureQueue.hpp"
#include "Runtime/CGameState.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Audio/CSfxManager.hpp"
#include "Runtime/MP1/MP1.hpp"
namespace urde::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::Game);
CSfxManager::TurnOnChannel(CSfxManager::ESfxChannels::Game);
} else if (msgType == EArchMsgType::QuitGameplay) {
if (g_GameState->GetWorldTransitionManager()->GetTransType() == CWorldTransManager::ETransType::Disabled ||
m->GetFlowState() != EFlowState::None) {
CSfxManager::SetChannel(CSfxManager::ESfxChannels::Default);
CSfxManager::KillAll(CSfxManager::ESfxChannels::Game);
}
}
return EMessageReturn::Normal;
}
} // namespace urde::MP1