diff options
author | Matthew Hoops | 2015-10-03 14:07:30 -0400 |
---|---|---|
committer | Johannes Schickel | 2016-03-13 13:53:40 +0100 |
commit | 55a87c59b61fe6758faee3a3e388b2a8979c7cb8 (patch) | |
tree | b7e8aca20bf61747396299175714622faf86f11b /backends/platform | |
parent | 30e68efac41a96e97fc9d42d0b7f9903e76ccfb5 (diff) | |
download | scummvm-rg350-55a87c59b61fe6758faee3a3e388b2a8979c7cb8.tar.gz scummvm-rg350-55a87c59b61fe6758faee3a3e388b2a8979c7cb8.tar.bz2 scummvm-rg350-55a87c59b61fe6758faee3a3e388b2a8979c7cb8.zip |
BACKENDS: Use a virtual function for creating the SDL audio CD manager
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 19 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 5 |
2 files changed, 15 insertions, 9 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index fffb9d56d9..a110a9ff2f 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -245,15 +245,7 @@ void OSystem_SDL::initBackend() { _timerManager = new SdlTimerManager(); #endif - if (_audiocdManager == 0) { - // Audio CD support was removed with SDL 2.0 -#if SDL_VERSION_ATLEAST(2, 0, 0) - _audiocdManager = new DefaultAudioCDManager(); -#else - _audiocdManager = new SdlAudioCDManager(); -#endif - - } + _audiocdManager = createAudioCDManager(); // Setup a custom program icon. _window->setupIcon(); @@ -491,6 +483,15 @@ Common::TimerManager *OSystem_SDL::getTimerManager() { #endif } +AudioCDManager *OSystem_SDL::createAudioCDManager() { + // Audio CD support was removed with SDL 1.3 +#if SDL_VERSION_ATLEAST(1, 3, 0) + return new DefaultAudioCDManager(); +#else + return new SdlAudioCDManager(); +#endif +} + #ifdef USE_OPENGL const OSystem::GraphicsMode *OSystem_SDL::getSupportedGraphicsModes() const { diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 5ee56d0568..c93c8308a7 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -104,6 +104,11 @@ protected: */ virtual void initSDL(); + /** + * Create the audio CD manager + */ + virtual AudioCDManager *createAudioCDManager(); + // Logging virtual Common::WriteStream *createLogFile() { return 0; } Backends::Log::Log *_logger; |