diff options
author | Max Horn | 2010-11-28 15:44:34 +0000 |
---|---|---|
committer | Max Horn | 2010-11-28 15:44:34 +0000 |
commit | 8f37f6634c56c5293ef9e0de1b9be2fce318b1de (patch) | |
tree | 23f85169bfb26dc64a9daf1cc3a5599c9abd32ed /backends/platform/sdl | |
parent | 1d818d940a0275576cf118667162be4ee07cc1fc (diff) | |
download | scummvm-rg350-8f37f6634c56c5293ef9e0de1b9be2fce318b1de.tar.gz scummvm-rg350-8f37f6634c56c5293ef9e0de1b9be2fce318b1de.tar.bz2 scummvm-rg350-8f37f6634c56c5293ef9e0de1b9be2fce318b1de.zip |
SDL: Merge deinit() into OSystem_SDL destructor and overload fatalError
svn-id: r54526
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 66 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 2 |
2 files changed, 35 insertions, 33 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 1fb600b1de..f31f7f81bd 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -79,7 +79,33 @@ OSystem_SDL::OSystem_SDL() } OSystem_SDL::~OSystem_SDL() { - deinit(); + SDL_ShowCursor(SDL_ENABLE); + + delete _savefileManager; + _savefileManager = 0; + delete _graphicsManager; + _graphicsManager = 0; + delete _eventManager; + _eventManager = 0; + delete _eventSource; + _eventSource = 0; + delete _audiocdManager; + _audiocdManager = 0; + delete _mixerManager; + _mixerManager = 0; + delete _timerManager; + _timerManager = 0; + delete _mutexManager; + _mutexManager = 0; + +#ifdef USE_OPENGL + delete[] _graphicsModes; +#endif + + delete _logger; + _logger = 0; + + SDL_Quit(); } void OSystem_SDL::init() { @@ -200,36 +226,6 @@ void OSystem_SDL::initSDL() { } } -void OSystem_SDL::deinit() { - SDL_ShowCursor(SDL_ENABLE); - - delete _savefileManager; - _savefileManager = 0; - delete _graphicsManager; - _graphicsManager = 0; - delete _eventManager; - _eventManager = 0; - delete _eventSource; - _eventSource = 0; - delete _audiocdManager; - _audiocdManager = 0; - delete _mixerManager; - _mixerManager = 0; - delete _timerManager; - _timerManager = 0; - delete _mutexManager; - _mutexManager = 0; - -#ifdef USE_OPENGL - delete[] _graphicsModes; -#endif - - delete _logger; - _logger = 0; - - SDL_Quit(); -} - void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { #ifdef DATA_PATH @@ -364,10 +360,16 @@ void OSystem_SDL::setWindowCaption(const char *caption) { } void OSystem_SDL::quit() { - deinit(); + delete this; exit(0); } +void OSystem_SDL::fatalError() { + delete this; + exit(1); +} + + void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) { ModularBackend::logMessage(type, message); if (_logger) diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 9a69bed691..7c82159d40 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -63,7 +63,7 @@ public: virtual void initBackend(); virtual Common::HardwareKeySet *getHardwareKeySet(); virtual void quit(); - virtual void deinit(); + virtual void fatalError(); // Logging virtual void logMessage(LogMessageType::Type type, const char *message); |