Ticket #1712: 1712.patch
File 1712.patch, 3.0 KB (added by , 10 years ago) |
---|
-
source/simulation2/components/CCmpSoundManager.cpp
1 /* Copyright (C) 201 2Wildfire Games.1 /* Copyright (C) 2014 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 85 85 } 86 86 } 87 87 88 virtual void Reset() 89 { 90 if (!g_SoundManager) 91 return; 92 93 g_SoundManager->Pause(true); 94 } 95 88 96 }; 89 97 90 98 REGISTER_COMPONENT_TYPE(SoundManager) -
source/simulation2/components/ICmpSoundManager.cpp
1 /* Copyright (C) 201 0Wildfire Games.1 /* Copyright (C) 2014 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 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_0("Reset", void, ICmpSoundManager, Reset) 26 27 END_INTERFACE_WRAPPER(SoundManager) -
source/simulation2/components/ICmpSoundManager.h
1 /* Copyright (C) 201 0Wildfire Games.1 /* Copyright (C) 2014 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 33 33 */ 34 34 virtual void PlaySoundGroup(std::wstring name, entity_id_t source) = 0; 35 35 36 virtual void Reset() = 0; 37 36 38 DECLARE_INTERFACE_TYPE(SoundManager) 37 39 }; 38 40 -
source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp
1 /* Copyright (C) 201 3Wildfire Games.1 /* Copyright (C) 2014 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 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 … … 133 135 134 136 MESSAGEHANDLER(SimStateRestore) 135 137 { 138 CmpPtr<ICmpSoundManager> cmpSoundManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY); 139 if (cmpSoundManager) 140 cmpSoundManager->Reset(); 141 136 142 AtlasView::GetView_Game()->RestoreState(*msg->label); 137 143 }