BACKENDS: Use a virtual function for creating the SDL audio CD manager

This commit is contained in:
Matthew Hoops 2015-10-03 14:07:30 -04:00 committed by Johannes Schickel
parent 30e68efac4
commit 55a87c59b6
2 changed files with 15 additions and 9 deletions

View file

@ -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 {