diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 830b010fb1..7ba81aa8b2 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -659,6 +659,8 @@ void Shutdown(int UNUSED(flags)) ShutdownSDL(); TIMER_END(L"shutdown SDL"); + g_VideoMode.Shutdown(); + TIMER_BEGIN(L"shutdown ScriptingHost"); delete &g_ScriptingHost; TIMER_END(L"shutdown ScriptingHost"); diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index f1ded0bfdb..8d740be63e 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -198,6 +198,13 @@ bool CVideoMode::InitNonSDL() return true; } +void CVideoMode::Shutdown() +{ + debug_assert(m_IsInitialised); + + m_IsInitialised = false; +} + void CVideoMode::EnableS3TC() { // On Linux we have to try hard to get S3TC compressed texture support. diff --git a/source/ps/VideoMode.h b/source/ps/VideoMode.h index 507bb85bd4..f1100f5b51 100644 --- a/source/ps/VideoMode.h +++ b/source/ps/VideoMode.h @@ -35,6 +35,11 @@ public: */ bool InitNonSDL(); + /** + * Shut down after InitSDL/InitNonSDL, so that they can be used again. + */ + void Shutdown(); + /** * Resize the SDL window and associated graphics stuff to the new size. */ @@ -67,6 +72,11 @@ private: bool SetVideoMode(int w, int h, int bpp, bool fullscreen); void EnableS3TC(); + /** + * Remember whether Init has been called. (This isn't used for anything + * important, just for verifying that the callers call our methods in + * the right order.) + */ bool m_IsInitialised; // Initial desktop settings