Advertisement
historic_bruno

Rough test for resetting sound in Atlas

Apr 30th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.68 KB | None | 0 0
  1. Index: build/premake/premake4.lua
  2. ===================================================================
  3. --- build/premake/premake4.lua  (revision 13385)
  4. +++ build/premake/premake4.lua  (working copy)
  5. @@ -610,6 +610,11 @@
  6.         "opengl",
  7.         "spidermonkey"
  8.     }
  9. +  
  10. +   if not _OPTIONS["without-audio"] then
  11. +       table.insert(extern_libs, "openal")
  12. +   end
  13. +  
  14.     setup_static_lib_project("atlas", source_dirs, extern_libs, {})
  15.  
  16.  
  17. Index: source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp
  18. ===================================================================
  19. --- source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp  (revision 13385)
  20. +++ source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp  (working copy)
  21. @@ -465,19 +465,11 @@
  22.  
  23.  void MapSidebar::OnSimReset(wxCommandEvent& WXUNUSED(event))
  24.  {
  25. -   if (IsPlaying(m_SimState))
  26. +   if (IsPlaying(m_SimState) || m_SimState == SimPaused)
  27.     {
  28. -       POST_MESSAGE(SimPlay, (0.f, true));
  29. -       POST_MESSAGE(SimStateRestore, (L"default"));
  30. +       POST_MESSAGE(ResetSound, ());
  31.         POST_MESSAGE(SimPlay, (0.f, false));
  32. -       POST_MESSAGE(GuiSwitchPage, (L"page_atlas.xml"));
  33. -       m_SimState = SimInactive;
  34. -   }
  35. -   else if (m_SimState == SimPaused)
  36. -   {
  37. -       POST_MESSAGE(SimPlay, (0.f, true));
  38.         POST_MESSAGE(SimStateRestore, (L"default"));
  39. -       POST_MESSAGE(SimPlay, (0.f, false));
  40.         POST_MESSAGE(GuiSwitchPage, (L"page_atlas.xml"));
  41.         m_SimState = SimInactive;
  42.     }
  43. Index: source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp
  44. ===================================================================
  45. --- source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp  (revision 13385)
  46. +++ source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp  (working copy)
  47. @@ -33,6 +33,7 @@
  48.  #include "ps/GameSetup/Config.h"
  49.  #include "ps/GameSetup/GameSetup.h"
  50.  #include "renderer/Renderer.h"
  51. +#include "soundmanager/SoundManager.h"
  52.  
  53.  extern void (*Atlas_GLSwapBuffers)(void* context);
  54.  
  55. @@ -146,6 +147,12 @@
  56.     AtlasView::GetView_Game()->SetTesting(msg->simTest);
  57.  }
  58.  
  59. +MESSAGEHANDLER(ResetSound)
  60. +{
  61. +   CSoundManager::SetEnabled(false);
  62. +   CSoundManager::SetEnabled(true);
  63. +}
  64. +
  65.  MESSAGEHANDLER(JavaScript)
  66.  {
  67.     g_ScriptingHost.ExecuteScript(*msg->command, L"Atlas");
  68. Index: source/tools/atlas/GameInterface/Messages.h
  69. ===================================================================
  70. --- source/tools/atlas/GameInterface/Messages.h (revision 13385)
  71. +++ source/tools/atlas/GameInterface/Messages.h (working copy)
  72. @@ -120,6 +120,9 @@
  73.         ((bool, simTest)) // true if we're in simulation test mode, false otherwise
  74.         );
  75.  
  76. +MESSAGE(ResetSound,
  77. +       );
  78. +
  79.  //////////////////////////////////////////////////////////////////////////
  80.  
  81.  QUERY(Ping, , );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement