Ticket #1712: sound_1712.patch
File sound_1712.patch, 2.3 KB (added by , 10 years ago) |
---|
-
source/simulation2/components/CCmpSoundManager.cpp
85 85 } 86 86 } 87 87 88 virtual void PauseMusic(bool isPause) 89 { 90 if (!g_SoundManager) 91 return; 92 93 g_SoundManager->Pause(isPause); 94 } 95 88 96 }; 89 97 90 98 REGISTER_COMPONENT_TYPE(SoundManager) -
source/simulation2/components/ICmpSoundManager.cpp
23 23 24 24 BEGIN_INTERFACE_WRAPPER(SoundManager) 25 25 DEFINE_INTERFACE_METHOD_2("PlaySoundGroup", void, ICmpSoundManager, PlaySoundGroup, std::wstring, entity_id_t) 26 DEFINE_INTERFACE_METHOD_1("PauseMusic", void, ICmpSoundManager, PauseMusic, bool) 26 27 END_INTERFACE_WRAPPER(SoundManager) -
source/simulation2/components/ICmpSoundManager.h
33 33 */ 34 34 virtual void PlaySoundGroup(std::wstring name, entity_id_t source) = 0; 35 35 36 virtual void PauseMusic(bool isPause) = 0; 37 36 38 DECLARE_INTERFACE_TYPE(SoundManager) 37 39 }; 38 40 -
source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp
34 34 #include "ps/GameSetup/Config.h" 35 35 #include "ps/GameSetup/GameSetup.h" 36 36 #include "renderer/Renderer.h" 37 #include "simulation2/Simulation2.h" 38 #include "simulation2/components/ICmpSoundManager.h" 37 39 38 40 extern void (*Atlas_GLSwapBuffers)(void* context); 39 41 … … 145 147 { 146 148 AtlasView::GetView_Game()->SetSpeedMultiplier(msg->speed); 147 149 AtlasView::GetView_Game()->SetTesting(msg->simTest); 150 151 CmpPtr<ICmpSoundManager> cmpSoundManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY); 152 if (cmpSoundManager) 153 cmpSoundManager->PauseMusic(msg->speed == 0.f); 154 148 155 } 149 156 150 157 MESSAGEHANDLER(JavaScript)