diff options
author | Patryk Obara <dreamer.tan@gmail.com> | 2019-09-17 09:42:36 +0300 |
---|---|---|
committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-09-17 20:29:05 +0300 |
commit | 23cdca390269cc5c2de8682f5f3b35f3de408bfc (patch) | |
tree | a7d23e1c36dd76c4189584b3e4f503e04ec7fbfa | |
parent | 353645817c413eaf7da170e8bff8a33717a7396c (diff) |
Remove last SDL_sound referencespo/dynamic-sdl-sound
Update INSTALL instructions, remove buildsystem references, remove
ifdefs and replace last few lines of code depending on it.
-rw-r--r-- | INSTALL | 16 | ||||
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | src/dos/cdrom.h | 10 | ||||
-rw-r--r-- | src/dos/cdrom_image.cpp | 28 |
4 files changed, 26 insertions, 43 deletions
@@ -32,17 +32,21 @@ SDL_Net (optional) For modem/ipx support. Get it from http://www.libsdl.org/projects/SDL_net/ Licensed under LGPL -SDL_Sound - For compressed audio on diskimages. (optional) - This is for cue/bin cdrom images with compressed (mp3/ogg) audio tracks. - Get it from http://icculus.org/SDL_sound - Licenced under LGPL - ALSA_Headers (optional) for Alsa support under linux. Part of the linux kernel sources Licensed under LGPL + +Runtime dependencies + +SDL_Sound (optional) + For compressed audio on diskimages. + This is for cue/bin cdrom images with compressed (mp3/ogg) audio tracks. + Get it from http://icculus.org/SDL_sound + Licenced under LGPL + + If you want compile from developer sources (SVN) under a unix system, you'll also need automake (>=1.6), autoconf(>=2.50). Should be available at http://www.gnu.org diff --git a/configure.ac b/configure.ac index ffa7b1d55..f2e8db7f0 100644 --- a/configure.ac +++ b/configure.ac @@ -519,21 +519,6 @@ case "$host" in esac fi -AH_TEMPLATE(C_SDL_SOUND,[Define to 1 to enable SDL_sound support]) -AC_CHECK_HEADER(SDL_sound.h,have_SDL_sound_h=yes,) -AC_CHECK_LIB(SDL_sound, Sound_Init, have_SDL_sound_init=yes,,) -AC_CHECK_LIB(SDL_sound, Sound_Seek, have_SDL_sound_seek=yes,,) -if test x$have_SDL_sound_h = xyes -a x$have_SDL_sound_init = xyes ; then - if test x$have_SDL_sound_seek = xyes ; then - LIBS="-lSDL_sound $LIBS" - AC_DEFINE(C_SDL_SOUND,1) - else - AC_MSG_WARN([Can't find SoundSeek in libSDL_Sound, libSDL_sound support disabled]) - fi -else - AC_MSG_WARN([Can't find libSDL_sound, libSDL_sound support disabled]) -fi - dnl Check for mprotect. Needed for 64 bits linux AH_TEMPLATE(C_HAVE_MPROTECT,[Define to 1 if you have the mprotect function]) AC_CHECK_HEADER([sys/mman.h], [ diff --git a/src/dos/cdrom.h b/src/dos/cdrom.h index da0ffd70f..0625880cf 100644 --- a/src/dos/cdrom.h +++ b/src/dos/cdrom.h @@ -35,10 +35,6 @@ #include "SDL.h" #include "SDL_thread.h" -#if defined(C_SDL_SOUND) -#include "SDL_sound.h" -#endif - #define RAW_SECTOR_SIZE 2352 #define COOKED_SECTOR_SIZE 2048 @@ -152,8 +148,7 @@ private: BinaryFile(); std::ifstream *file; }; - - #if defined(C_SDL_SOUND) + class AudioFile : public TrackFile { public: AudioFile(const char *filename, bool &error); @@ -166,8 +161,7 @@ private: int lastCount; int lastSeek; }; - #endif - + struct Track { int number; int attr; diff --git a/src/dos/cdrom_image.cpp b/src/dos/cdrom_image.cpp index cfaad25b9..fbadc7a9d 100644 --- a/src/dos/cdrom_image.cpp +++ b/src/dos/cdrom_image.cpp @@ -72,7 +72,6 @@ int CDROM_Interface_Image::BinaryFile::getLength() return length; } -#if defined(C_SDL_SOUND) CDROM_Interface_Image::AudioFile::AudioFile(const char *filename, bool &error) { sample = sound::NewSampleFromFile(filename, RAW_SECTOR_SIZE); @@ -104,16 +103,17 @@ bool CDROM_Interface_Image::AudioFile::read(Bit8u *buffer, int seek, int count) } else { memcpy(buffer, sample->buffer, count); } - - return !(sample->flags & SOUND_SAMPLEFLAG_ERROR); + + return !(sample->flags & sound::SOUND_SAMPLEFLAG_ERROR); } int CDROM_Interface_Image::AudioFile::getLength() { int time = 1; int shift = 0; - if (!(sample->flags & SOUND_SAMPLEFLAG_CANSEEK)) return -1; - + if (!(sample->flags & sound::SOUND_SAMPLEFLAG_CANSEEK)) + return -1; + while (true) { int success = sound::Seek(sample, (unsigned int)(shift + time)); if (!success) { @@ -126,7 +126,6 @@ int CDROM_Interface_Image::AudioFile::getLength() } } } -#endif // initialize static members int CDROM_Interface_Image::refCount = 0; @@ -530,16 +529,17 @@ bool CDROM_Interface_Image::LoadCueSheet(char *cuefile) bool error = true; if (type == "BINARY") { track.file = new BinaryFile(filename.c_str(), error); - } -#if defined(C_SDL_SOUND) - //The next if has been surpassed by the else, but leaving it in as not - //to break existing cue sheets that depend on this.(mine with OGG tracks specifying MP3 as type) - else if (type == "WAVE" || type == "AIFF" || type == "MP3") { - track.file = new AudioFile(filename.c_str(), error); - } else if (sound::SupportsType(type)) { + } else if (type == "WAVE" || type == "AIFF" || type == "MP3" || sound::SupportsType(type)) { + // "WAVE" is not correct type name (correct one is "WAV"), + // but it might appear in some .cue sheets. + // + // Also, some .cue sheets incorrectly set file type, it + // usually happens for .ogg files specified with "MP3" + // type. This problem appears in some games distributed + // through Steam and GOG. + // track.file = new AudioFile(filename.c_str(), error); } -#endif if (error) { delete track.file; track.file = NULL; |