Dummy audio and video drivers are enabled (thanks Ryan!)
authorSam Lantinga <slouken@lokigames.com>
Mon, 02 Jul 2001 00:20:29 +0000
changeset 8613e4c612098d
parent 85 60c7960354e0
child 87 3ef4bc90c388
Dummy audio and video drivers are enabled (thanks Ryan!)
configure.in
src/audio/disk/SDL_diskaudio.c
src/video/dummy/SDL_nullvideo.c
     1.1 --- a/configure.in	Mon Jul 02 00:10:19 2001 +0000
     1.2 +++ b/configure.in	Mon Jul 02 00:20:29 2001 +0000
     1.3 @@ -368,13 +368,12 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 -
     1.8  dnl rcg07142001 See if the user wants the disk writer audio driver...
     1.9  CheckDiskAudio()
    1.10  {
    1.11      AC_ARG_ENABLE(diskaudio,
    1.12 -[  --enable-diskaudio  	  support the disk writer audio driver [default=no]],
    1.13 -                  , enable_diskaudio=no)
    1.14 +[  --enable-diskaudio  	  support the disk writer audio driver [default=yes]],
    1.15 +                  , enable_diskaudio=yes)
    1.16      if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
    1.17          CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
    1.18          AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
    1.19 @@ -382,7 +381,6 @@
    1.20      fi
    1.21  }
    1.22  
    1.23 -
    1.24  dnl See if we can use x86 assembly blitters
    1.25  CheckNASM()
    1.26  {
    1.27 @@ -810,8 +808,8 @@
    1.28  CheckDummyVideo()
    1.29  {
    1.30      AC_ARG_ENABLE(video-dummy,
    1.31 -[  --enable-video-dummy    use dummy video driver [default=no]],
    1.32 -                  , enable_video_dummy=no)
    1.33 +[  --enable-video-dummy    use dummy video driver [default=yes]],
    1.34 +                  , enable_video_dummy=yes)
    1.35      if test x$enable_video_dummy = xyes; then
    1.36        CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
    1.37        VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
    1.38 @@ -902,7 +900,7 @@
    1.39                    , enable_pthreads=yes)
    1.40      dnl This is used on Linux for glibc binary compatibility (Doh!)
    1.41      AC_ARG_ENABLE(pthread-sem,
    1.42 -[    --enable-pthread-sem  use pthread semaphores [default=yes]],
    1.43 +[  --enable-pthread-sem    use pthread semaphores [default=yes]],
    1.44                    , enable_pthread_sem=yes)
    1.45      ac_save_libs="$LIBS"
    1.46      case "$target" in
     2.1 --- a/src/audio/disk/SDL_diskaudio.c	Mon Jul 02 00:10:19 2001 +0000
     2.2 +++ b/src/audio/disk/SDL_diskaudio.c	Mon Jul 02 00:20:29 2001 +0000
     2.3 @@ -80,23 +80,30 @@
     2.4      int exists = 0;
     2.5      struct stat statbuf;
     2.6      const char *fname = DISKAUD_GetOutputFilename();
     2.7 -
     2.8 +	const char *envr = getenv("SDL_AUDIODRIVER");
     2.9  	available = 0;
    2.10  
    2.11 -    if (stat(fname, &statbuf) == 0)
    2.12 -        exists = 1;
    2.13 +	if ((envr) && (strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) {
    2.14 +		if (stat(fname, &statbuf) == 0)
    2.15 +			exists = 1;
    2.16  
    2.17 -    fd = open(fname, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
    2.18 -	if ( fd != -1 ) {
    2.19 -		available = 1;
    2.20 -		close(fd);
    2.21 -        if (!exists) {
    2.22 -            unlink(fname);
    2.23 -        }
    2.24 +		fd = open(fname, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
    2.25 +		if ( fd != -1 ) {
    2.26 +			available = 1;
    2.27 +			close(fd);
    2.28 +			if (!exists) {
    2.29 +				unlink(fname);
    2.30 +			}
    2.31 +		}
    2.32  	}
    2.33  	return(available);
    2.34  #else
    2.35 -    return(1);
    2.36 +	const char *envr = getenv("SDL_AUDIODRIVER");
    2.37 +	if ((envr) && (strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) {
    2.38 +		return(1);
    2.39 +	}
    2.40 +
    2.41 +	return(0);
    2.42  #endif
    2.43  }
    2.44  
     3.1 --- a/src/video/dummy/SDL_nullvideo.c	Mon Jul 02 00:10:19 2001 +0000
     3.2 +++ b/src/video/dummy/SDL_nullvideo.c	Mon Jul 02 00:20:29 2001 +0000
     3.3 @@ -55,6 +55,8 @@
     3.4  #include "SDL_nullevents_c.h"
     3.5  #include "SDL_nullmouse_c.h"
     3.6  
     3.7 +#define DUMMYVID_DRIVER_NAME "dummy"
     3.8 +
     3.9  /* Initialization/Query functions */
    3.10  static int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat);
    3.11  static SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
    3.12 @@ -76,7 +78,12 @@
    3.13  
    3.14  static int DUMMY_Available(void)
    3.15  {
    3.16 -	return 1; /* Always available ! */
    3.17 +	const char *envr = getenv("SDL_VIDEODRIVER");
    3.18 +	if ((envr) && (strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) {
    3.19 +		return(1);
    3.20 +	}
    3.21 +
    3.22 +	return(0);
    3.23  }
    3.24  
    3.25  static void DUMMY_DeleteDevice(SDL_VideoDevice *device)
    3.26 @@ -136,7 +143,7 @@
    3.27  }
    3.28  
    3.29  VideoBootStrap DUMMY_bootstrap = {
    3.30 -	"dummy", "SDL dummy video driver",
    3.31 +	DUMMYVID_DRIVER_NAME, "SDL dummy video driver",
    3.32  	DUMMY_Available, DUMMY_CreateDevice
    3.33  };
    3.34