Index: source/main.cpp =================================================================== --- source/main.cpp +++ source/main.cpp @@ -413,6 +413,12 @@ Render(); + { + PROFILE3("swap buffers"); + SDL_GL_SwapWindow(g_VideoMode.GetWindow()); + ogl_WarnIfError(); + } + g_Profiler.Frame(); g_GameRestarted = false; Index: source/ps/Game.cpp =================================================================== --- source/ps/Game.cpp +++ source/ps/Game.cpp @@ -409,12 +409,7 @@ } if (doInterpolate) - { m_TurnManager->Interpolate(deltaSimTime, deltaRealTime); - - if ( g_SoundManager ) - g_SoundManager->IdleTask(); - } } void CGame::Interpolate(float simFrameLength, float realFrameLength) Index: source/ps/GameSetup/GameSetup.cpp =================================================================== --- source/ps/GameSetup/GameSetup.cpp +++ source/ps/GameSetup/GameSetup.cpp @@ -188,13 +188,6 @@ g_GUI->GetActiveGUI()->SendEventToAll("progress"); } -void SwapBuffers() -{ - PROFILE3("swap buffers"); - SDL_GL_SwapWindow(g_VideoMode.GetWindow()); - ogl_WarnIfError(); -} - void Render() { // Do not render if not focused while in fullscreen or minimised, @@ -337,8 +330,6 @@ g_Profiler2.RecordGPUFrameEnd(); ogl_WarnIfError(); - - SwapBuffers(); } ErrorReactionInternal psDisplayError(const wchar_t* UNUSED(text), size_t UNUSED(flags)) Index: source/tools/atlas/GameInterface/View.cpp =================================================================== --- source/tools/atlas/GameInterface/View.cpp +++ source/tools/atlas/GameInterface/View.cpp @@ -40,6 +40,7 @@ #include "simulation2/components/ICmpObstructionManager.h" #include "simulation2/components/ICmpParticleManager.h" #include "simulation2/components/ICmpPathfinder.h" +#include "soundmanager/ISoundManager.h" extern void (*Atlas_GLSwapBuffers)(void* context); @@ -211,6 +212,10 @@ g_Game->Interpolate(actualFrameLength, realFrameLength); } + // Run sound idle tasks every frame. + if (g_SoundManager) + g_SoundManager->IdleTask(); + // Cinematic motion should be independent of simulation update, so we can // preview the cinematics by themselves g_Game->GetView()->GetCinema()->Update(realFrameLength);