diff options
Diffstat (limited to 'src/engine/client/client.cpp')
| -rw-r--r-- | src/engine/client/client.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index b7244db4..5067f8b2 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -1690,11 +1690,24 @@ void CClient::InitInterfaces() m_Friends.Init(); } +#include "SDL.h" + void CClient::Run() { m_LocalStartTime = time_get(); m_SnapshotParts = 0; + // init SDL + { + if(SDL_Init(0) < 0) + { + dbg_msg("client", "unable to init SDL base: %s", SDL_GetError()); + return; + } + + atexit(SDL_Quit); // ignore_convention + } + // init graphics { if(g_Config.m_GfxThreaded) @@ -1713,6 +1726,9 @@ void CClient::Run() } } + // init sound, allowed to fail + m_SoundInitFailed = Sound()->Init() != 0; + // open socket { NETADDR BindAddr; @@ -1737,8 +1753,6 @@ void CClient::Run() // init the editor //m_pEditor->Init(); - // init sound, allowed to fail - m_SoundInitFailed = Sound()->Init() != 0; // load data if(!LoadData()) @@ -1937,6 +1951,11 @@ void CClient::Run() m_pGraphics->Shutdown(); m_pSound->Shutdown(); + + // shutdown SDL + { + SDL_Quit(); + } } |