diff options
Diffstat (limited to 'intern/SoundSystem/sdl')
-rw-r--r-- | intern/SoundSystem/sdl/SND_SDLCDDevice.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp b/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp index 8bb6c642b11..b1bac964c61 100644 --- a/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp +++ b/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp @@ -41,7 +41,9 @@ #include "SND_SDLCDDevice.h" #include "SoundDefines.h" +#ifndef DISABLE_SDL #include <SDL.h> +#endif SND_SDLCDDevice::SND_SDLCDDevice() : m_cdrom(NULL), @@ -55,6 +57,10 @@ SND_SDLCDDevice::SND_SDLCDDevice() : void SND_SDLCDDevice::init() { +#ifdef DISABLE_SDL + fprintf(stderr, "Blender compiled without SDL, no CDROM support\n"); + return; +#else if (SDL_InitSubSystem(SDL_INIT_CDROM)) { fprintf(stderr, "Error initializing CDROM\n"); @@ -75,19 +81,23 @@ void SND_SDLCDDevice::init() /* Did if open? Check if cdrom is NULL */ if(!m_cdrom) { - fprintf(stderr, "Couldn't open drive: %s", SDL_GetError()); + fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError()); return; } +#endif } SND_SDLCDDevice::~SND_SDLCDDevice() { +#ifndef DISABLE_SDL StopCD(); SDL_CDClose(m_cdrom); +#endif } void SND_SDLCDDevice::NextFrame() { +#ifndef DISABLE_SDL m_frame++; m_frame &= 127; @@ -111,20 +121,24 @@ void SND_SDLCDDevice::NextFrame() } } +#endif } void SND_SDLCDDevice::PlayCD(int track) { +#ifndef DISABLE_SDL if ( m_cdrom && CD_INDRIVE(SDL_CDStatus(m_cdrom)) ) { SDL_CDPlayTracks(m_cdrom, track-1, 0, track, 0); m_cdplaying = true; m_cdtrack = track; } +#endif } void SND_SDLCDDevice::PauseCD(bool pause) { +#ifndef DISABLE_SDL if (!m_cdrom) return; @@ -132,13 +146,16 @@ void SND_SDLCDDevice::PauseCD(bool pause) SDL_CDPause(m_cdrom); else SDL_CDResume(m_cdrom); +#endif } void SND_SDLCDDevice::StopCD() { +#ifndef DISABLE_SDL if (m_cdrom) SDL_CDStop(m_cdrom); m_cdplaying = false; +#endif } void SND_SDLCDDevice::SetCDPlaymode(int playmode) |