Changes since SDL 1.2.0 release
authorSam Lantinga <slouken@lokigames.com>
Thu, 26 Apr 2001 16:50:19 +0000
changeset 1cf2af46e9e2a
parent 0 74212992fb08
child 2 836aaee3f39e
Changes since SDL 1.2.0 release
acinclude.m4
configure.in
docs.html
include/SDL_audio.h
include/SDL_byteorder.h
include/SDL_version.h
ltconfig
ltmain.sh
sdl.m4
src/SDL_error.c
src/SDL_fatal.c
src/audio/SDL_audiomem.c
src/audio/SDL_mixer.c
src/audio/dma/SDL_dmaaudio.c
src/audio/dsp/SDL_dspaudio.c
src/cdrom/openbsd/SDL_syscdrom.c
src/timer/SDL_timer.c
src/timer/linux/SDL_systimer.c
src/video/Makefile.am
src/video/SDL_RLEaccel.c
src/video/SDL_blit_A.c
src/video/SDL_cursor.c
src/video/SDL_memops.h
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/bwindow/SDL_BView.h
src/video/bwindow/SDL_BWin.h
src/video/bwindow/SDL_sysevents.cc
src/video/dummy/Makefile.am
src/video/dummy/SDL_nullevents.c
src/video/dummy/SDL_nullevents_c.h
src/video/dummy/SDL_nullmouse.c
src/video/dummy/SDL_nullmouse_c.h
src/video/dummy/SDL_nullvideo.c
src/video/dummy/SDL_nullvideo.h
src/video/svga/SDL_svgavideo.c
src/video/wincommon/SDL_sysevents.c
src/video/windx5/SDL_dx5video.c
strip_fPIC.sh
test/acinclude.m4
     1.1 --- a/acinclude.m4	Thu Apr 26 16:45:43 2001 +0000
     1.2 +++ b/acinclude.m4	Thu Apr 26 16:50:19 2001 +0000
     1.3 @@ -434,7 +434,8 @@
     1.4  if test "$ac_cv_prog_gcc" = yes; then
     1.5    # Check if gcc -print-prog-name=ld gives a path.
     1.6    AC_MSG_CHECKING([for ld used by GCC])
     1.7 -  ac_prog=`($CC -print-prog-name=ld | tr -d '\r') 2>&5`
     1.8 +  DELCR='tr -d \015'
     1.9 +  ac_prog=`($CC -print-prog-name=ld | $DELCR) 2>&5`
    1.10    case "$ac_prog" in
    1.11      # Accept absolute paths.
    1.12  changequote(,)dnl
     2.1 --- a/configure.in	Thu Apr 26 16:45:43 2001 +0000
     2.2 +++ b/configure.in	Thu Apr 26 16:50:19 2001 +0000
     2.3 @@ -14,9 +14,9 @@
     2.4  #
     2.5  SDL_MAJOR_VERSION=1
     2.6  SDL_MINOR_VERSION=2
     2.7 -SDL_MICRO_VERSION=0
     2.8 -SDL_INTERFACE_AGE=0
     2.9 -SDL_BINARY_AGE=0
    2.10 +SDL_MICRO_VERSION=1
    2.11 +SDL_INTERFACE_AGE=1
    2.12 +SDL_BINARY_AGE=1
    2.13  SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
    2.14  
    2.15  AC_SUBST(SDL_MAJOR_VERSION)
    2.16 @@ -251,6 +251,9 @@
    2.17            #ifdef __bsdi__
    2.18            #include <sys/soundcard.h>
    2.19            #endif
    2.20 +          #ifdef __OpenBSD__
    2.21 +          #include <soundcard.h>
    2.22 +          #endif
    2.23            #ifdef __USLC__
    2.24            #include <sys/soundcard.h>
    2.25            #endif
    2.26 @@ -680,6 +683,19 @@
    2.27      fi
    2.28  }
    2.29  
    2.30 +dnl rcg04172001 Set up the Null video driver.
    2.31 +CheckDummyVideo()
    2.32 +{
    2.33 +    AC_ARG_ENABLE(video-dummy,
    2.34 +[  --enable-video-dummy   use dummy video driver [default=no]],
    2.35 +                  , enable_video_dummy=no)
    2.36 +    if test x$enable_video_dummy = xyes; then
    2.37 +      CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
    2.38 +      VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
    2.39 +      VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
    2.40 +    fi
    2.41 +}
    2.42 +
    2.43  dnl Check to see if OpenGL support is desired
    2.44  AC_ARG_ENABLE(video-opengl,
    2.45  [  --enable-video-opengl   include OpenGL context creation [default=yes]],
    2.46 @@ -1012,6 +1028,7 @@
    2.47  case "$target" in
    2.48      *-*-linux*)
    2.49          ARCH=linux
    2.50 +        CheckDummyVideo
    2.51          CheckNASM
    2.52          CheckOSS
    2.53          CheckALSA
    2.54 @@ -1076,6 +1093,7 @@
    2.55          ;;
    2.56      *-*-bsdi*)
    2.57          ARCH=bsdi
    2.58 +        CheckDummyVideo
    2.59          CheckNASM
    2.60          CheckOSS
    2.61          CheckNAS
    2.62 @@ -1116,6 +1134,7 @@
    2.63          ;;
    2.64      *-*-freebsd*)
    2.65          ARCH=freebsd
    2.66 +        CheckDummyVideo
    2.67          CheckNASM
    2.68          CheckOSS
    2.69          CheckARTSC
    2.70 @@ -1167,6 +1186,7 @@
    2.71          ;;
    2.72      *-*-netbsd*)
    2.73          ARCH=netbsd
    2.74 +        CheckDummyVideo
    2.75          CheckNASM
    2.76          CheckOSS
    2.77          CheckARTSC
    2.78 @@ -1199,7 +1219,11 @@
    2.79              COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
    2.80              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
    2.81              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
    2.82 -            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
    2.83 +	    if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
    2.84 +		COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
    2.85 +	    else
    2.86 +		COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
    2.87 +	    fi
    2.88              COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
    2.89              COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
    2.90              COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
    2.91 @@ -1213,6 +1237,8 @@
    2.92          ;;
    2.93      *-*-openbsd*)
    2.94          ARCH=openbsd
    2.95 +        CFLAGS="$CFLAGS -Dunix"
    2.96 +        CheckDummyVideo
    2.97          CheckNASM
    2.98          CheckOSS
    2.99          CheckARTSC
   2.100 @@ -1261,6 +1287,7 @@
   2.101          ;;
   2.102      *-*-sysv5*)
   2.103          ARCH=sysv5
   2.104 +        CheckDummyVideo
   2.105          CheckNASM
   2.106          CheckOSS
   2.107          CheckARTSC
   2.108 @@ -1306,6 +1333,8 @@
   2.109          ;;
   2.110      *-*-solaris*)
   2.111          ARCH=solaris
   2.112 +        CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
   2.113 +        CheckDummyVideo
   2.114          CheckNASM
   2.115          CheckARTSC
   2.116          CheckESD
   2.117 @@ -1350,6 +1379,7 @@
   2.118          ;;
   2.119      *-*-irix*)
   2.120          ARCH=irix
   2.121 +        CheckDummyVideo
   2.122          CheckNAS
   2.123          CheckX11
   2.124          CheckAAlib
   2.125 @@ -1407,6 +1437,7 @@
   2.126          ;;
   2.127      *-*-hpux*)
   2.128          ARCH=hpux
   2.129 +        CheckDummyVideo
   2.130          CheckNAS
   2.131          CheckX11
   2.132          CheckGGI
   2.133 @@ -1449,6 +1480,7 @@
   2.134          ;;
   2.135      *-*-aix*)
   2.136          ARCH=aix
   2.137 +        CheckDummyVideo
   2.138          CheckNAS
   2.139          CheckX11
   2.140          CheckGGI
   2.141 @@ -1490,6 +1522,7 @@
   2.142          ;;
   2.143      *-*-osf*)
   2.144          ARCH=osf
   2.145 +        CheckDummyVideo
   2.146          CheckNAS
   2.147          CheckX11
   2.148          CheckGGI
   2.149 @@ -1532,6 +1565,7 @@
   2.150          ;;
   2.151      *-*-qnx*)
   2.152          ARCH=qnx
   2.153 +        CheckDummyVideo
   2.154          CheckNAS
   2.155          CheckPHOTON
   2.156          CheckX11
   2.157 @@ -1581,8 +1615,11 @@
   2.158              ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
   2.159          else
   2.160              # Look for the location of the tools and install there
   2.161 -            ac_default_prefix=$BUILD_PREFIX
   2.162 +            if [ "$BUILD_PREFIX" != "" ]; then
   2.163 +                ac_default_prefix=$BUILD_PREFIX
   2.164 +            fi
   2.165          fi
   2.166 +        CheckDummyVideo
   2.167          CheckWIN32
   2.168          CheckDIRECTX
   2.169          CheckNASM
   2.170 @@ -1623,11 +1660,22 @@
   2.171          fi
   2.172          # The Win32 platform requires special setup
   2.173          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
   2.174 -        SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
   2.175 +        case "$target" in
   2.176 +            *-*-cygwin*)
   2.177 +                CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
   2.178 +                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix"
   2.179 +                LIBS="$LIBS -mno-cygwin"
   2.180 +                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
   2.181 +                ;;
   2.182 +            *-*-mingw32*)
   2.183 +                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
   2.184 +                ;;
   2.185 +        esac
   2.186          ;;
   2.187      *-*-beos*)
   2.188          ARCH=beos
   2.189          ac_default_prefix=/boot/develop/tools/gnupro
   2.190 +        CheckDummyVideo
   2.191          CheckNASM
   2.192          CheckBWINDOW
   2.193          CheckBeGL
   2.194 @@ -1672,6 +1720,7 @@
   2.195          # use it at present, but Apple is working on a X-to-9 compiler
   2.196          # for which this case would be handy.
   2.197          ARCH=macos
   2.198 +        CheckDummyVideo
   2.199          CheckTOOLBOX
   2.200          CheckMacGL
   2.201          # Set up files for the main() stub
   2.202 @@ -1714,6 +1763,7 @@
   2.203          # just the OS X kernel sans upper layers like Carbon.  But
   2.204          # config.guess comes back with "darwin", so go with the flow.
   2.205          ARCH=macos
   2.206 +        CheckDummyVideo
   2.207          CheckCARBON
   2.208          CheckMacGL
   2.209          CheckPTHREAD
   2.210 @@ -1790,6 +1840,10 @@
   2.211    SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
   2.212  fi
   2.213  
   2.214 +if test $ARCH = openbsd; then
   2.215 +  SDL_RLD_FLAGS="-Wl,-R\${exec_prefix}/lib -Wl,-R\${X11BASE}/lib"
   2.216 +fi
   2.217 +
   2.218  dnl Output the video drivers we use
   2.219  if test x$enable_video = xtrue; then
   2.220      if test "$VIDEO_SUBDIRS" = ""; then
   2.221 @@ -1873,6 +1927,7 @@
   2.222  src/video/windx5/Makefile
   2.223  src/video/bwindow/Makefile
   2.224  src/video/photon/Makefile
   2.225 +src/video/dummy/Makefile
   2.226  src/events/Makefile
   2.227  src/joystick/Makefile
   2.228  src/joystick/beos/Makefile
     3.1 --- a/docs.html	Thu Apr 26 16:45:43 2001 +0000
     3.2 +++ b/docs.html	Thu Apr 26 16:50:19 2001 +0000
     3.3 @@ -16,6 +16,9 @@
     3.4  Major changes since SDL 1.0.0:
     3.5  </H2>
     3.6  <UL>
     3.7 +	<LI> 1.2.1: Added support for building under Cygwin on Windows
     3.8 +	<LI> 1.2.1: Added a dummy video driver for benchmarking (thanks Ryan!)
     3.9 +	<LI> 1.2.1: Fixed fullscreen cursor offset bug on BeOS
    3.10  	<LI> 1.2.0: Added initial support for HP-UX (thanks Stephanie)
    3.11  	<LI> 1.2.0: Added initial support for BSDI (thanks Kurt)
    3.12  	<LI> 1.2.0: Fixed blitting 32-bit ARGB images to SDL_OPENGLBLIT screens
     4.1 --- a/include/SDL_audio.h	Thu Apr 26 16:45:43 2001 +0000
     4.2 +++ b/include/SDL_audio.h	Thu Apr 26 16:50:19 2001 +0000
     4.3 @@ -234,7 +234,7 @@
     4.4   * This is provided for convenience -- you can mix your own audio data.
     4.5   */
     4.6  #define SDL_MIX_MAXVOLUME 128
     4.7 -extern DECLSPEC void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume);
     4.8 +extern DECLSPEC void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
     4.9  
    4.10  /*
    4.11   * The lock manipulated by these functions protects the callback function.
     5.1 --- a/include/SDL_byteorder.h	Thu Apr 26 16:45:43 2001 +0000
     5.2 +++ b/include/SDL_byteorder.h	Thu Apr 26 16:50:19 2001 +0000
     5.3 @@ -42,7 +42,8 @@
     5.4  #if  defined(__i386__) || defined(WIN32) || \
     5.5      (defined(__alpha__) || defined(__alpha)) || \
     5.6       defined(__arm__) || \
     5.7 -    (defined(__mips__) && defined(__MIPSEL__))
     5.8 +    (defined(__mips__) && defined(__MIPSEL__)) || \
     5.9 +     defined(__LITTLE_ENDIAN__)
    5.10  #define SDL_BYTEORDER	SDL_LIL_ENDIAN
    5.11  #else
    5.12  #define SDL_BYTEORDER	SDL_BIG_ENDIAN
     6.1 --- a/include/SDL_version.h	Thu Apr 26 16:45:43 2001 +0000
     6.2 +++ b/include/SDL_version.h	Thu Apr 26 16:50:19 2001 +0000
     6.3 @@ -42,7 +42,7 @@
     6.4  */
     6.5  #define SDL_MAJOR_VERSION	1
     6.6  #define SDL_MINOR_VERSION	2
     6.7 -#define SDL_PATCHLEVEL		0
     6.8 +#define SDL_PATCHLEVEL		1
     6.9  
    6.10  typedef struct {
    6.11  	Uint8 major;
     7.1 --- a/ltconfig	Thu Apr 26 16:45:43 2001 +0000
     7.2 +++ b/ltconfig	Thu Apr 26 16:50:19 2001 +0000
     7.3 @@ -1105,6 +1105,9 @@
     7.4      with_gnu_ld=no
     7.5    fi
     7.6    ;;
     7.7 +openbsd*)
     7.8 +  with_gnu_ld=no
     7.9 +  ;;
    7.10  
    7.11  esac
    7.12  
    7.13 @@ -1155,6 +1158,12 @@
    7.14      ;;
    7.15  
    7.16    cygwin* | mingw*)
    7.17 +    # Special flag that tells Cygwin to use the native MSVC runtime
    7.18 +    case "$host_os" in
    7.19 +    cygwin*)
    7.20 +      cygwin_use_msvcrt=true
    7.21 +      ;;
    7.22 +    esac
    7.23      # hardcode_libdir_flag_spec is actually meaningless, as there is
    7.24      # no search path for DLLs.
    7.25      hardcode_libdir_flag_spec='-L$libdir'
    7.26 @@ -1165,13 +1174,40 @@
    7.27      # then regenerate the def file from the symbol export list, so that
    7.28      # the compiled dll only exports the symbol export list.
    7.29      # Be careful not to strip the DATA tag left by newer dlltools.
    7.30 -    export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
    7.31 +    if [ "$cygwin_use_msvcrt" = "true" ]; then
    7.32 +      export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
    7.33 +      test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -U__CYGWIN__ -U__CYGWIN32__ -c $soname-ltdll.c)~
    7.34 +      $DLLTOOL --exclude-symbols _DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs $convenience~
    7.35 +      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols'
    7.36 +    else
    7.37 +      export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
    7.38        test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
    7.39        $DLLTOOL --exclude-symbols _DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs $convenience~
    7.40        sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols'
    7.41 +    fi
    7.42  
    7.43      # If DATA tags from a recent dlltool are present, honour them!
    7.44 -    archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
    7.45 +    if [ "$cygwin_use_msvcrt" = "true" ]; then
    7.46 +      archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
    7.47 +      _lt_hint=1;
    7.48 +      cat $export_symbols | while read symbol; do
    7.49 +        set dummy \$symbol;
    7.50 +        case \$# in
    7.51 +          2) echo "	\$2 @ \$_lt_hint ; " >> $objdir/$soname-def;;
    7.52 +          *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;;
    7.53 +        esac;
    7.54 +	_lt_hint=`expr 1 + \$_lt_hint`;
    7.55 +      done~
    7.56 +      test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
    7.57 +      test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -U__CYGWIN__ -U__CYGWIN32__ -c $soname-ltdll.c)~
    7.58 +      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,_DllMain@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts -L/usr/lib/mingw -mno-cygwin~
    7.59 +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols _DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
    7.60 +      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,_DllMain@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts -L/usr/lib/mingw -mno-cygwin~
    7.61 +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols _DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
    7.62 +      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,_DllMain@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts -L/usr/lib/mingw -mno-cygwin~
    7.63 +      : strip_is_broken_with_dlls_on_win95B - strip $lib'
    7.64 +    else
    7.65 +      archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
    7.66        _lt_hint=1;
    7.67        cat $export_symbols | while read symbol; do
    7.68          set dummy \$symbol;
    7.69 @@ -1189,8 +1225,8 @@
    7.70        $DLLTOOL --as=$AS --dllname $soname --exclude-symbols _DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
    7.71        $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,_DllMain@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
    7.72        : strip_is_broken_with_dlls_on_win95B - strip $lib'
    7.73 -
    7.74 -      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
    7.75 +    fi
    7.76 +    old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
    7.77      ;;
    7.78  
    7.79    netbsd*)
    7.80 @@ -1403,10 +1439,21 @@
    7.81      ;;
    7.82  
    7.83    openbsd*)
    7.84 -    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
    7.85 -    hardcode_libdir_flag_spec='-R$libdir'
    7.86      hardcode_direct=yes
    7.87      hardcode_shlibpath_var=no
    7.88 +    case "$host_os" in
    7.89 +      openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
    7.90 +	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
    7.91 +	hardcode_libdir_flag_spec='-R$libdir'
    7.92 +      ;;
    7.93 +      *)
    7.94 +	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linkopts'
    7.95 +	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
    7.96 +	 if [ "`/usr/bin/file /usr/lib/libc.so.* | grep ELF`" != "" ]; then
    7.97 +	   export_dynamic_flag_spec='${wl}-E'
    7.98 +	 fi
    7.99 +      ;;
   7.100 +    esac
   7.101      ;;
   7.102  
   7.103    os2*)
   7.104 @@ -1883,7 +1930,7 @@
   7.105      # See where the system libraries really are - /usr/lib won't cut it
   7.106      libuser32=`$CC --print-file-name=libuser32.a`
   7.107      win32libs=`expr $libuser32 : '\(.*\)/.*'`
   7.108 -    sys_lib_search_path_spec="$sys_lib_search_path $win32libs"
   7.109 +    sys_lib_search_path_spec="$sys_lib_search_path_spec $win32libs"
   7.110    fi
   7.111    lt_cv_dlopen="LoadLibrary"
   7.112    lt_cv_dlopen_libs=
   7.113 @@ -2030,13 +2077,10 @@
   7.114  
   7.115  openbsd*)
   7.116    version_type=sunos
   7.117 -  if test "$with_gnu_ld" = yes; then
   7.118 -    need_lib_prefix=no
   7.119 -    need_version=no
   7.120 -  fi
   7.121    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
   7.122    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   7.123    shlibpath_var=LD_LIBRARY_PATH
   7.124 +  deplibs_check_method='pass_all'
   7.125    ;;
   7.126  
   7.127  os2*)
     8.1 --- a/ltmain.sh	Thu Apr 26 16:45:43 2001 +0000
     8.2 +++ b/ltmain.sh	Thu Apr 26 16:50:19 2001 +0000
     8.3 @@ -1079,7 +1079,18 @@
     8.4  	    # These systems don't actually have c library (as such)
     8.5  	    continue
     8.6  	    ;;
     8.7 +          *-*-openbsd*)
     8.8 +            # Do not include libc due to us having libc/libc_r.
     8.9 +            continue
    8.10 +            ;;
    8.11  	  esac
    8.12 +        elif test "$arg" = "-lc_r"; then
    8.13 +          case "$host" in
    8.14 +          *-*-openbsd*)
    8.15 +            # Do not include libc_r directly, use -pthread flag.
    8.16 +            continue
    8.17 +            ;;
    8.18 +          esac
    8.19  	elif test "$arg" = "-lm"; then
    8.20  	  case "$host" in
    8.21  	  *-*-cygwin* | *-*-beos*)
    8.22 @@ -1091,6 +1102,10 @@
    8.23  	deplibs="$deplibs $arg"
    8.24  	;;
    8.25  
    8.26 +      -?thread)
    8.27 +        deplibs="$deplibs $arg"
    8.28 +        ;;
    8.29 +
    8.30        -module)
    8.31  	module=yes
    8.32  	continue
    8.33 @@ -1799,6 +1814,9 @@
    8.34  	  # rhapsody is a little odd...
    8.35  	  deplibs="$deplibs -framework System"
    8.36  	  ;;
    8.37 +	*-*-openbsd*)
    8.38 +	  # do not include libc due to us having libc/libc_r.
    8.39 +	  ;;
    8.40  	*)
    8.41  	  # Add libc to deplibs on all other systems.
    8.42  	  deplibs="$deplibs -lc"
     9.1 --- a/sdl.m4	Thu Apr 26 16:45:43 2001 +0000
     9.2 +++ b/sdl.m4	Thu Apr 26 16:50:19 2001 +0000
     9.3 @@ -140,6 +140,11 @@
     9.4            AC_TRY_LINK([
     9.5  #include <stdio.h>
     9.6  #include "SDL.h"
     9.7 +
     9.8 +int main(int argc, char *argv[])
     9.9 +{ return 0; }
    9.10 +#undef  main
    9.11 +#define main K_and_R_C_main
    9.12  ],      [ return 0; ],
    9.13          [ echo "*** The test program compiled, but did not run. This usually means"
    9.14            echo "*** that the run-time linker is not finding SDL or finding the wrong"
    10.1 --- a/src/SDL_error.c	Thu Apr 26 16:45:43 2001 +0000
    10.2 +++ b/src/SDL_error.c	Thu Apr 26 16:50:19 2001 +0000
    10.3 @@ -47,6 +47,10 @@
    10.4  #define SDL_GetErrBuf()	(&SDL_global_error)
    10.5  #endif /* DISABLE_THREADS */
    10.6  
    10.7 +#ifdef __CYGWIN__
    10.8 +#define DISABLE_STDIO
    10.9 +#endif
   10.10 +
   10.11  #define SDL_ERRBUFIZE	1024
   10.12  
   10.13  /* Private functions */
   10.14 @@ -120,6 +124,7 @@
   10.15  	}
   10.16  	va_end(ap);
   10.17  
   10.18 +#ifndef DISABLE_STDIO
   10.19  	/* If we are in debug mode, print out an error message */
   10.20  #ifdef DEBUG_ERROR
   10.21  	fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
   10.22 @@ -128,6 +133,7 @@
   10.23  		fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
   10.24  	}
   10.25  #endif
   10.26 +#endif /* !DISABLE_STDIO */
   10.27  }
   10.28  
   10.29  /* Print out an integer value to a UNICODE buffer */
    11.1 --- a/src/SDL_fatal.c	Thu Apr 26 16:45:43 2001 +0000
    11.2 +++ b/src/SDL_fatal.c	Thu Apr 26 16:50:19 2001 +0000
    11.3 @@ -51,46 +51,59 @@
    11.4  #include "SDL.h"
    11.5  #include "SDL_fatal.h"
    11.6  
    11.7 +#ifdef __CYGWIN__
    11.8 +#define DISABLE_STDIO
    11.9 +#endif
   11.10 +
   11.11  /* This installs some signal handlers for the more common fatal signals,
   11.12     so that if the programmer is lazy, the app doesn't die so horribly if
   11.13     the program crashes.
   11.14  */
   11.15  
   11.16 +static void print_msg(const char *text)
   11.17 +{
   11.18 +#ifndef DISABLE_STDIO
   11.19 +	fprintf(stderr, "%s", text);
   11.20 +#endif
   11.21 +}
   11.22 +
   11.23  static void SDL_Parachute(int sig)
   11.24  {
   11.25  	signal(sig, SIG_DFL);
   11.26 -	fprintf(stderr, "Fatal signal: ");
   11.27 +	print_msg("Fatal signal: ");
   11.28  	switch (sig) {
   11.29  		case SIGSEGV:
   11.30 -			fprintf(stderr, "Segmentation Fault");
   11.31 +			print_msg("Segmentation Fault");
   11.32  			break;
   11.33  #ifdef SIGBUS
   11.34  #if SIGBUS != SIGSEGV
   11.35  		case SIGBUS:
   11.36 -			fprintf(stderr, "Bus Error");
   11.37 +			print_msg("Bus Error");
   11.38  			break;
   11.39  #endif
   11.40  #endif /* SIGBUS */
   11.41  #ifdef SIGFPE
   11.42  		case SIGFPE:
   11.43 -			fprintf(stderr, "Floating Point Exception");
   11.44 +			print_msg("Floating Point Exception");
   11.45  			break;
   11.46  #endif /* SIGFPE */
   11.47  #ifdef SIGQUIT
   11.48  		case SIGQUIT:
   11.49 -			fprintf(stderr, "Keyboard Quit");
   11.50 +			print_msg("Keyboard Quit");
   11.51  			break;
   11.52  #endif /* SIGQUIT */
   11.53  #ifdef SIGPIPE
   11.54  		case SIGPIPE:
   11.55 -			fprintf(stderr, "Broken Pipe");
   11.56 +			print_msg("Broken Pipe");
   11.57  			break;
   11.58  #endif /* SIGPIPE */
   11.59  		default:
   11.60 +#ifndef DISABLE_STDIO
   11.61  			fprintf(stderr, "# %d", sig);
   11.62 +#endif
   11.63  			break;
   11.64  	}
   11.65 -	fprintf(stderr, " (SDL Parachute Deployed)\n");
   11.66 +	print_msg(" (SDL Parachute Deployed)\n");
   11.67  	SDL_Quit();
   11.68  	exit(-sig);
   11.69  }
    12.1 --- a/src/audio/SDL_audiomem.c	Thu Apr 26 16:45:43 2001 +0000
    12.2 +++ b/src/audio/SDL_audiomem.c	Thu Apr 26 16:50:19 2001 +0000
    12.3 @@ -29,13 +29,12 @@
    12.4  	(necessary because SDL audio emulates threads with fork()
    12.5   */
    12.6  
    12.7 +#include <stdlib.h>
    12.8  #ifdef FORK_HACK
    12.9  #include <sys/types.h>
   12.10  #include <sys/ipc.h>
   12.11  #include <sys/shm.h>
   12.12  #include <stddef.h>
   12.13 -#else
   12.14 -#include <stdlib.h>
   12.15  #endif
   12.16  
   12.17  #include "SDL_audiomem.h"
    13.1 --- a/src/audio/SDL_mixer.c	Thu Apr 26 16:45:43 2001 +0000
    13.2 +++ b/src/audio/SDL_mixer.c	Thu Apr 26 16:50:19 2001 +0000
    13.3 @@ -96,7 +96,7 @@
    13.4  #define ADJUST_VOLUME(s, v)	(s = (s*v)/SDL_MIX_MAXVOLUME)
    13.5  #define ADJUST_VOLUME_U8(s, v)	(s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128)
    13.6  
    13.7 -void SDL_MixAudio (Uint8 *dst, Uint8 *src, Uint32 len, int volume)
    13.8 +void SDL_MixAudio (Uint8 *dst, const Uint8 *src, Uint32 len, int volume)
    13.9  {
   13.10  	Uint16 format;
   13.11  
    14.1 --- a/src/audio/dma/SDL_dmaaudio.c	Thu Apr 26 16:45:43 2001 +0000
    14.2 +++ b/src/audio/dma/SDL_dmaaudio.c	Thu Apr 26 16:50:19 2001 +0000
    14.3 @@ -48,6 +48,9 @@
    14.4  #ifdef __FreeBSD__
    14.5  #include <machine/soundcard.h>
    14.6  #endif
    14.7 +#ifdef __OpenBSD__
    14.8 +#include <soundcard.h>
    14.9 +#endif
   14.10  #ifdef __USLC__
   14.11  #include <sys/soundcard.h>
   14.12  #endif
    15.1 --- a/src/audio/dsp/SDL_dspaudio.c	Thu Apr 26 16:45:43 2001 +0000
    15.2 +++ b/src/audio/dsp/SDL_dspaudio.c	Thu Apr 26 16:50:19 2001 +0000
    15.3 @@ -46,6 +46,9 @@
    15.4  #ifdef __FreeBSD__
    15.5  #include <machine/soundcard.h>
    15.6  #endif
    15.7 +#ifdef __OpenBSD__
    15.8 +#include <soundcard.h>
    15.9 +#endif
   15.10  #ifdef __USLC__
   15.11  #include <sys/soundcard.h>
   15.12  #endif
    16.1 --- a/src/cdrom/openbsd/SDL_syscdrom.c	Thu Apr 26 16:45:43 2001 +0000
    16.2 +++ b/src/cdrom/openbsd/SDL_syscdrom.c	Thu Apr 26 16:50:19 2001 +0000
    16.3 @@ -36,6 +36,7 @@
    16.4  #include <string.h>
    16.5  #include <errno.h>
    16.6  #include <unistd.h>
    16.7 +#include <sys/ioctl.h>
    16.8  #include <sys/cdio.h>
    16.9  
   16.10  #include "SDL_error.h"
   16.11 @@ -64,7 +65,8 @@
   16.12  
   16.13  /* Some ioctl() errno values which occur when the tray is empty */
   16.14  #define ERRNO_TRAYEMPTY(errno)	\
   16.15 -	((errno == EIO) || (errno == ENOENT) || (errno == EINVAL))
   16.16 +	((errno == EIO) || (errno == ENOENT) || (errno == EINVAL) || \
   16.17 +	 (errno == ENODEV))
   16.18  
   16.19  /* Check a drive to see if it is a CD-ROM */
   16.20  static int CheckDrive(char *drive, struct stat *stbuf)
   16.21 @@ -96,6 +98,8 @@
   16.22  			}
   16.23  			close(cdfd);
   16.24  		}
   16.25 +		else if (ERRNO_TRAYEMPTY(errno))
   16.26 +			is_cd = 1;
   16.27  	}
   16.28  	return(is_cd);
   16.29  }
   16.30 @@ -137,7 +141,11 @@
   16.31  int  SDL_SYS_CDInit(void)
   16.32  {
   16.33  	static char *checklist[] = {
   16.34 +#ifdef __OpenBSD__
   16.35 +		"?0 cd?a", "cdrom", NULL
   16.36 +#else
   16.37  		"?0 cd?c", "?0 acd?c", "cdrom", NULL
   16.38 +#endif
   16.39  	};
   16.40  	char *SDLcdrom;
   16.41  	int i, j, exists;
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/src/timer/SDL_timer.c	Thu Apr 26 16:50:19 2001 +0000
    17.3 @@ -0,0 +1,286 @@
    17.4 +/*
    17.5 +    SDL - Simple DirectMedia Layer
    17.6 +    Copyright (C) 1997, 1998  Sam Lantinga
    17.7 +
    17.8 +    This library is free software; you can redistribute it and/or
    17.9 +    modify it under the terms of the GNU Library General Public
   17.10 +    License as published by the Free Software Foundation; either
   17.11 +    version 2 of the License, or (at your option) any later version.
   17.12 +
   17.13 +    This library is distributed in the hope that it will be useful,
   17.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   17.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   17.16 +    Library General Public License for more details.
   17.17 +
   17.18 +    You should have received a copy of the GNU Library General Public
   17.19 +    License along with this library; if not, write to the Free
   17.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   17.21 +
   17.22 +    Sam Lantinga
   17.23 +    5635-34 Springhouse Dr.
   17.24 +    Pleasanton, CA 94588 (USA)
   17.25 +    slouken@devolution.com
   17.26 +*/
   17.27 +
   17.28 +#ifdef SAVE_RCSID
   17.29 +static char rcsid =
   17.30 + "@(#) $Id$";
   17.31 +#endif
   17.32 +
   17.33 +#include <stdlib.h>
   17.34 +#include <stdio.h>			/* For the definition of NULL */
   17.35 +
   17.36 +#include "SDL_error.h"
   17.37 +#include "SDL_timer.h"
   17.38 +#include "SDL_timer_c.h"
   17.39 +#include "SDL_mutex.h"
   17.40 +#include "SDL_systimer.h"
   17.41 +
   17.42 +/* #define DEBUG_TIMERS */
   17.43 +
   17.44 +int SDL_timer_started = 0;
   17.45 +int SDL_timer_running = 0;
   17.46 +
   17.47 +/* Data to handle a single periodic alarm */
   17.48 +Uint32 SDL_alarm_interval = 0;
   17.49 +SDL_TimerCallback SDL_alarm_callback;
   17.50 +
   17.51 +static SDL_bool list_changed = SDL_FALSE;
   17.52 +
   17.53 +/* Data used for a thread-based timer */
   17.54 +static int SDL_timer_threaded = 0;
   17.55 +
   17.56 +struct _SDL_TimerID {
   17.57 +	Uint32 interval;
   17.58 +	SDL_NewTimerCallback cb;
   17.59 +	void *param;
   17.60 +	Uint32 last_alarm;
   17.61 +	struct _SDL_TimerID *next;
   17.62 +};
   17.63 +
   17.64 +static SDL_TimerID SDL_timers = NULL;
   17.65 +static Uint32 num_timers = 0;
   17.66 +static SDL_mutex *SDL_timer_mutex;
   17.67 +
   17.68 +/* Set whether or not the timer should use a thread.
   17.69 +   This should not be called while the timer subsystem is running.
   17.70 +*/
   17.71 +int SDL_SetTimerThreaded(int value)
   17.72 +{
   17.73 +	int retval;
   17.74 +
   17.75 +	if ( SDL_timer_started ) {
   17.76 +		SDL_SetError("Timer already initialized");
   17.77 +		retval = -1;
   17.78 +	} else {
   17.79 +		retval = 0;
   17.80 +		SDL_timer_threaded = value;
   17.81 +	}
   17.82 +	return retval;
   17.83 +}
   17.84 +
   17.85 +int SDL_TimerInit(void)
   17.86 +{
   17.87 +	int retval;
   17.88 +
   17.89 +	SDL_timer_running = 0;
   17.90 +	SDL_SetTimer(0, NULL);
   17.91 +	retval = 0;
   17.92 +	if ( ! SDL_timer_threaded ) {
   17.93 +		retval = SDL_SYS_TimerInit();
   17.94 +	}
   17.95 +	if ( SDL_timer_threaded ) {
   17.96 +		SDL_timer_mutex = SDL_CreateMutex();
   17.97 +	}
   17.98 +	SDL_timer_started = 1;
   17.99 +	return(retval);
  17.100 +}
  17.101 +
  17.102 +void SDL_TimerQuit(void)
  17.103 +{
  17.104 +	SDL_SetTimer(0, NULL);
  17.105 +	if ( SDL_timer_threaded < 2 ) {
  17.106 +		SDL_SYS_TimerQuit();
  17.107 +	}
  17.108 +	if ( SDL_timer_threaded ) {
  17.109 +		SDL_DestroyMutex(SDL_timer_mutex);
  17.110 +	}
  17.111 +	SDL_timer_started = 0;
  17.112 +	SDL_timer_threaded = 0;
  17.113 +}
  17.114 +
  17.115 +void SDL_ThreadedTimerCheck(void)
  17.116 +{
  17.117 +	Uint32 now, ms;
  17.118 +	SDL_TimerID t, prev, next;
  17.119 +	int removed;
  17.120 +
  17.121 +	now = SDL_GetTicks();
  17.122 +
  17.123 +	SDL_mutexP(SDL_timer_mutex);
  17.124 +	for ( prev = NULL, t = SDL_timers; t; t = next ) {
  17.125 +		removed = 0;
  17.126 +		ms = t->interval - SDL_TIMESLICE;
  17.127 +		next = t->next;
  17.128 +		if ( (t->last_alarm < now) && ((now - t->last_alarm) > ms) ) {
  17.129 +			if ( (now - t->last_alarm) < t->interval ) {
  17.130 +				t->last_alarm += t->interval;
  17.131 +			} else {
  17.132 +				t->last_alarm = now;
  17.133 +			}
  17.134 +			list_changed = SDL_FALSE;
  17.135 +#ifdef DEBUG_TIMERS
  17.136 +			printf("Executing timer %p (thread = %d)\n",
  17.137 +						t, SDL_ThreadID());
  17.138 +#endif
  17.139 +			SDL_mutexV(SDL_timer_mutex);
  17.140 +			ms = t->cb(t->interval, t->param);
  17.141 +			SDL_mutexP(SDL_timer_mutex);
  17.142 +			if ( list_changed ) {
  17.143 +				/* Abort, list of timers has been modified */
  17.144 +				break;
  17.145 +			}
  17.146 +			if ( ms != t->interval ) {
  17.147 +				if ( ms ) {
  17.148 +					t->interval = ROUND_RESOLUTION(ms);
  17.149 +				} else { /* Remove the timer from the linked list */
  17.150 +#ifdef DEBUG_TIMERS
  17.151 +					printf("SDL: Removing timer %p\n", t);
  17.152 +#endif
  17.153 +					if ( prev ) {
  17.154 +						prev->next = next;
  17.155 +					} else {
  17.156 +						SDL_timers = next;
  17.157 +					}
  17.158 +					free(t);
  17.159 +					-- num_timers;
  17.160 +					removed = 1;
  17.161 +				}
  17.162 +			}
  17.163 +		}
  17.164 +		/* Don't update prev if the timer has disappeared */
  17.165 +		if ( ! removed ) {
  17.166 +			prev = t;
  17.167 +		}
  17.168 +	}
  17.169 +	SDL_mutexV(SDL_timer_mutex);
  17.170 +}
  17.171 +
  17.172 +SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param)
  17.173 +{
  17.174 +	SDL_TimerID t;
  17.175 +	if ( ! SDL_timer_mutex ) {
  17.176 +		if ( SDL_timer_started ) {
  17.177 +			SDL_SetError("This platform doesn't support multiple timers");
  17.178 +		} else {
  17.179 +			SDL_SetError("You must call SDL_Init(SDL_INIT_TIMER) first");
  17.180 +		}
  17.181 +		return NULL;
  17.182 +	}
  17.183 +	if ( ! SDL_timer_threaded ) {
  17.184 +		SDL_SetError("Multiple timers require threaded events!");
  17.185 +		return NULL;
  17.186 +	}
  17.187 +	SDL_mutexP(SDL_timer_mutex);
  17.188 +	t = (SDL_TimerID) malloc(sizeof(struct _SDL_TimerID));
  17.189 +	if ( t ) {
  17.190 +		t->interval = ROUND_RESOLUTION(interval);
  17.191 +		t->cb = callback;
  17.192 +		t->param = param;
  17.193 +		t->last_alarm = SDL_GetTicks();
  17.194 +		t->next = SDL_timers;
  17.195 +		SDL_timers = t;
  17.196 +		++ num_timers;
  17.197 +		list_changed = SDL_TRUE;
  17.198 +		SDL_timer_running = 1;
  17.199 +	}
  17.200 +#ifdef DEBUG_TIMERS
  17.201 +	printf("SDL_AddTimer(%d) = %08x num_timers = %d\n", interval, (Uint32)t, num_timers);
  17.202 +#endif
  17.203 +	SDL_mutexV(SDL_timer_mutex);
  17.204 +	return t;
  17.205 +}
  17.206 +
  17.207 +SDL_bool SDL_RemoveTimer(SDL_TimerID id)
  17.208 +{
  17.209 +	SDL_TimerID t, prev = NULL;
  17.210 +	SDL_bool removed;
  17.211 +
  17.212 +	removed = SDL_FALSE;
  17.213 +	SDL_mutexP(SDL_timer_mutex);
  17.214 +	/* Look for id in the linked list of timers */
  17.215 +	for (t = SDL_timers; t; prev=t, t = t->next ) {
  17.216 +		if ( t == id ) {
  17.217 +			if(prev) {
  17.218 +				prev->next = t->next;
  17.219 +			} else {
  17.220 +				SDL_timers = t->next;
  17.221 +			}
  17.222 +			free(t);
  17.223 +			-- num_timers;
  17.224 +			removed = SDL_TRUE;
  17.225 +			list_changed = SDL_TRUE;
  17.226 +			break;
  17.227 +		}
  17.228 +	}
  17.229 +#ifdef DEBUG_TIMERS
  17.230 +	printf("SDL_RemoveTimer(%08x) = %d num_timers = %d thread = %d\n", (Uint32)id, removed, num_timers, SDL_ThreadID());
  17.231 +#endif
  17.232 +	SDL_mutexV(SDL_timer_mutex);
  17.233 +	return removed;
  17.234 +}
  17.235 +
  17.236 +static void SDL_RemoveAllTimers(SDL_TimerID t)
  17.237 +{
  17.238 +	SDL_TimerID freeme;
  17.239 +
  17.240 +	/* Changed to non-recursive implementation.
  17.241 +	   The recursive implementation is elegant, but subject to 
  17.242 +	   stack overflow if there are lots and lots of timers.
  17.243 +	 */
  17.244 +	while ( t ) {
  17.245 +		freeme = t;
  17.246 +		t = t->next;
  17.247 +		free(freeme);
  17.248 +	}
  17.249 +}
  17.250 +
  17.251 +/* Old style callback functions are wrapped through this */
  17.252 +static Uint32 callback_wrapper(Uint32 ms, void *param)
  17.253 +{
  17.254 +	SDL_TimerCallback func = (SDL_TimerCallback) param;
  17.255 +	return (*func)(ms);
  17.256 +}
  17.257 +
  17.258 +int SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback)
  17.259 +{
  17.260 +	int retval;
  17.261 +
  17.262 +#ifdef DEBUG_TIMERS
  17.263 +	printf("SDL_SetTimer(%d)\n", ms);
  17.264 +#endif
  17.265 +	retval = 0;
  17.266 +	if ( SDL_timer_running ) {	/* Stop any currently running timer */
  17.267 +		SDL_timer_running = 0;
  17.268 +		if ( SDL_timer_threaded ) {
  17.269 +			SDL_mutexP(SDL_timer_mutex);
  17.270 +			SDL_RemoveAllTimers(SDL_timers);
  17.271 +			SDL_timers = NULL;
  17.272 +			SDL_mutexV(SDL_timer_mutex);
  17.273 +		} else {
  17.274 +			SDL_SYS_StopTimer();
  17.275 +		}
  17.276 +	}
  17.277 +	if ( ms ) {
  17.278 +		if ( SDL_timer_threaded ) {
  17.279 +			retval = (SDL_AddTimer(ms, callback_wrapper,
  17.280 +					       (void *)callback) != NULL);
  17.281 +		} else {
  17.282 +			SDL_timer_running = 1;
  17.283 +			SDL_alarm_interval = ms;
  17.284 +			SDL_alarm_callback = callback;
  17.285 +			retval = SDL_SYS_StartTimer();
  17.286 +		}
  17.287 +	}
  17.288 +	return retval;
  17.289 +}
    18.1 --- a/src/timer/linux/SDL_systimer.c	Thu Apr 26 16:45:43 2001 +0000
    18.2 +++ b/src/timer/linux/SDL_systimer.c	Thu Apr 26 16:50:19 2001 +0000
    18.3 @@ -36,6 +36,10 @@
    18.4  #include "SDL_timer.h"
    18.5  #include "SDL_timer_c.h"
    18.6  
    18.7 +#if _POSIX_THREAD_SYSCALL_SOFT
    18.8 +#include <pthread.h>
    18.9 +#endif
   18.10 +
   18.11  #if defined(DISABLE_THREADS) || defined(FORK_HACK)
   18.12  #define USE_ITIMER
   18.13  #endif
   18.14 @@ -96,6 +100,9 @@
   18.15  	do {
   18.16  		errno = 0;
   18.17  
   18.18 +#if _POSIX_THREAD_SYSCALL_SOFT
   18.19 +		pthread_yield_np();
   18.20 +#endif
   18.21  #ifdef USE_NANOSLEEP
   18.22  		tv.tv_sec = elapsed.tv_sec;
   18.23  		tv.tv_nsec = elapsed.tv_nsec;
    19.1 --- a/src/video/Makefile.am	Thu Apr 26 16:45:43 2001 +0000
    19.2 +++ b/src/video/Makefile.am	Thu Apr 26 16:50:19 2001 +0000
    19.3 @@ -5,7 +5,7 @@
    19.4  
    19.5  # Define which subdirectories need to be built
    19.6  SUBDIRS = @VIDEO_SUBDIRS@
    19.7 -DIST_SUBDIRS = x11 dga fbcon svga ggi aalib \
    19.8 +DIST_SUBDIRS = dummy x11 dga fbcon svga ggi aalib \
    19.9                 wincommon windib windx5 \
   19.10                 maccommon macdsp macrom bwindow photon cybergfx
   19.11  
    20.1 --- a/src/video/SDL_RLEaccel.c	Thu Apr 26 16:45:43 2001 +0000
    20.2 +++ b/src/video/SDL_RLEaccel.c	Thu Apr 26 16:50:19 2001 +0000
    20.3 @@ -109,12 +109,21 @@
    20.4  #define MIN(a, b) ((a) < (b) ? (a) : (b))
    20.5  #endif
    20.6  
    20.7 +#define PIXEL_COPY(to, from, len, bpp)			\
    20.8 +do {							\
    20.9 +    if(bpp == 4) {					\
   20.10 +	SDL_memcpy4(to, from, (unsigned)(len));		\
   20.11 +    } else {						\
   20.12 +	SDL_memcpy(to, from, (unsigned)(len) * (bpp));	\
   20.13 +    }							\
   20.14 +} while(0)
   20.15 +
   20.16  /*
   20.17   * Various colorkey blit methods, for opaque and per-surface alpha
   20.18   */
   20.19  
   20.20  #define OPAQUE_BLIT(to, from, length, bpp, alpha)	\
   20.21 -    SDL_memcpy(to, from, (unsigned)(length * bpp))
   20.22 +    PIXEL_COPY(to, from, length, bpp)
   20.23  
   20.24  /*
   20.25   * For 32bpp pixels on the form 0x00rrggbb:
   20.26 @@ -657,9 +666,9 @@
   20.27  		    if(crun > right - cofs)				  \
   20.28  			crun = right - cofs;				  \
   20.29  		    if(crun > 0)					  \
   20.30 -			SDL_memcpy(dstbuf + cofs * sizeof(Ptype),	  \
   20.31 +			PIXEL_COPY(dstbuf + cofs * sizeof(Ptype),	  \
   20.32  				   srcbuf + (cofs - ofs) * sizeof(Ptype), \
   20.33 -				   (unsigned)crun * sizeof(Ptype));	  \
   20.34 +				   (unsigned)crun, sizeof(Ptype));	  \
   20.35  		    srcbuf += run * sizeof(Ptype);			  \
   20.36  		    ofs += run;						  \
   20.37  		} else if(!ofs)						  \
   20.38 @@ -816,8 +825,8 @@
   20.39  		    run = ((Ctype *)srcbuf)[1];				 \
   20.40  		    srcbuf += 2 * sizeof(Ctype);			 \
   20.41  		    if(run) {						 \
   20.42 -			SDL_memcpy(dstbuf + ofs * sizeof(Ptype), srcbuf, \
   20.43 -				   run * sizeof(Ptype));		 \
   20.44 +			PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \
   20.45 +				   run, sizeof(Ptype));			 \
   20.46  			srcbuf += run * sizeof(Ptype);			 \
   20.47  			ofs += run;					 \
   20.48  		    } else if(!ofs)					 \
    21.1 --- a/src/video/SDL_blit_A.c	Thu Apr 26 16:45:43 2001 +0000
    21.2 +++ b/src/video/SDL_blit_A.c	Thu Apr 26 16:50:19 2001 +0000
    21.3 @@ -195,8 +195,8 @@
    21.4  	}
    21.5  }
    21.6  
    21.7 -/* fast RGB888->(A)RGB888 blending with surface alpha */
    21.8 -static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info)
    21.9 +/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
   21.10 +static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info)
   21.11  {
   21.12  	int width = info->d_width;
   21.13  	int height = info->d_height;
   21.14 @@ -204,32 +204,58 @@
   21.15  	int srcskip = info->s_skip >> 2;
   21.16  	Uint32 *dstp = (Uint32 *)info->d_pixels;
   21.17  	int dstskip = info->d_skip >> 2;
   21.18 -	SDL_PixelFormat *srcfmt = info->src;
   21.19 -	unsigned alpha = srcfmt->alpha;
   21.20  
   21.21  	while(height--) {
   21.22  	    DUFFS_LOOP4({
   21.23 -		Uint32 s;
   21.24 -		Uint32 d;
   21.25 -		Uint32 s1;
   21.26 -		Uint32 d1;
   21.27 -		s = *srcp;
   21.28 -		d = *dstp;
   21.29 -		s1 = s & 0xff00ff;
   21.30 -		d1 = d & 0xff00ff;
   21.31 -		d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;
   21.32 -		s &= 0xff00;
   21.33 -		d &= 0xff00;
   21.34 -		d = (d + ((s - d) * alpha >> 8)) & 0xff00;
   21.35 -		*dstp = d1 | d | 0xff000000;
   21.36 -		++srcp;
   21.37 -		++dstp;
   21.38 +		    Uint32 s = *srcp++;
   21.39 +		    Uint32 d = *dstp;
   21.40 +		    *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
   21.41 +			       + (s & d & 0x00010101)) | 0xff000000;
   21.42  	    }, width);
   21.43  	    srcp += srcskip;
   21.44  	    dstp += dstskip;
   21.45  	}
   21.46  }
   21.47  
   21.48 +/* fast RGB888->(A)RGB888 blending with surface alpha */
   21.49 +static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info)
   21.50 +{
   21.51 +	unsigned alpha = info->src->alpha;
   21.52 +	if(alpha == 128) {
   21.53 +		BlitRGBtoRGBSurfaceAlpha128(info);
   21.54 +	} else {
   21.55 +		int width = info->d_width;
   21.56 +		int height = info->d_height;
   21.57 +		Uint32 *srcp = (Uint32 *)info->s_pixels;
   21.58 +		int srcskip = info->s_skip >> 2;
   21.59 +		Uint32 *dstp = (Uint32 *)info->d_pixels;
   21.60 +		int dstskip = info->d_skip >> 2;
   21.61 +
   21.62 +		while(height--) {
   21.63 +			DUFFS_LOOP4({
   21.64 +				Uint32 s;
   21.65 +				Uint32 d;
   21.66 +				Uint32 s1;
   21.67 +				Uint32 d1;
   21.68 +				s = *srcp;
   21.69 +				d = *dstp;
   21.70 +				s1 = s & 0xff00ff;
   21.71 +				d1 = d & 0xff00ff;
   21.72 +				d1 = (d1 + ((s1 - d1) * alpha >> 8))
   21.73 +				     & 0xff00ff;
   21.74 +				s &= 0xff00;
   21.75 +				d &= 0xff00;
   21.76 +				d = (d + ((s - d) * alpha >> 8)) & 0xff00;
   21.77 +				*dstp = d1 | d | 0xff000000;
   21.78 +				++srcp;
   21.79 +				++dstp;
   21.80 +			}, width);
   21.81 +			srcp += srcskip;
   21.82 +			dstp += dstskip;
   21.83 +		}
   21.84 +	}
   21.85 +}
   21.86 +
   21.87  /* fast ARGB888->(A)RGB888 blending with pixel alpha */
   21.88  static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info)
   21.89  {
   21.90 @@ -277,8 +303,18 @@
   21.91  	}
   21.92  }
   21.93  
   21.94 -/* fast RGB565->RGB565 blending with surface alpha */
   21.95 -static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
   21.96 +/* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */
   21.97 +
   21.98 +/* blend a single 16 bit pixel at 50% */
   21.99 +#define BLEND16_50(d, s, mask)						\
  21.100 +	((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
  21.101 +
  21.102 +/* blend two 16 bit pixels at 50% */
  21.103 +#define BLEND2x16_50(d, s, mask)					     \
  21.104 +	(((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
  21.105 +	 + (s & d & (~(mask | mask << 16))))
  21.106 +
  21.107 +static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask)
  21.108  {
  21.109  	int width = info->d_width;
  21.110  	int height = info->d_height;
  21.111 @@ -286,56 +322,163 @@
  21.112  	int srcskip = info->s_skip >> 1;
  21.113  	Uint16 *dstp = (Uint16 *)info->d_pixels;
  21.114  	int dstskip = info->d_skip >> 1;
  21.115 -	unsigned alpha = info->src->alpha >> 3; /* downscale alpha to 5 bits */
  21.116  
  21.117  	while(height--) {
  21.118 -	    DUFFS_LOOP4({
  21.119 -		Uint32 s = *srcp++;
  21.120 -		Uint32 d = *dstp;
  21.121 -		/*
  21.122 -		 * shift out the middle component (green) to the high 16
  21.123 -		 * bits, and process all three RGB components at the same
  21.124 -		 * time.
  21.125 -		 */
  21.126 -		s = (s | s << 16) & 0x07e0f81f;
  21.127 -		d = (d | d << 16) & 0x07e0f81f;
  21.128 -		d += (s - d) * alpha >> 5;
  21.129 -		d &= 0x07e0f81f;
  21.130 -		*dstp++ = d | d >> 16;
  21.131 -	    }, width);
  21.132 -	    srcp += srcskip;
  21.133 -	    dstp += dstskip;
  21.134 +		if(((unsigned long)srcp ^ (unsigned long)dstp) & 2) {
  21.135 +			/*
  21.136 +			 * Source and destination not aligned, pipeline it.
  21.137 +			 * This is mostly a win for big blits but no loss for
  21.138 +			 * small ones
  21.139 +			 */
  21.140 +			Uint32 prev_sw;
  21.141 +			int w = width;
  21.142 +
  21.143 +			/* handle odd destination */
  21.144 +			if((unsigned long)dstp & 2) {
  21.145 +				Uint16 d = *dstp, s = *srcp;
  21.146 +				*dstp = BLEND16_50(d, s, mask);
  21.147 +				dstp++;
  21.148 +				srcp++;
  21.149 +				w--;
  21.150 +			}
  21.151 +			srcp++;	/* srcp is now 32-bit aligned */
  21.152 +
  21.153 +			/* bootstrap pipeline with first halfword */
  21.154 +			prev_sw = ((Uint32 *)srcp)[-1];
  21.155 +
  21.156 +			while(w > 1) {
  21.157 +				Uint32 sw, dw, s;
  21.158 +				sw = *(Uint32 *)srcp;
  21.159 +				dw = *(Uint32 *)dstp;
  21.160 +				if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
  21.161 +					s = (prev_sw << 16) + (sw >> 16);
  21.162 +				else
  21.163 +					s = (prev_sw >> 16) + (sw << 16);
  21.164 +				prev_sw = sw;
  21.165 +				*(Uint32 *)dstp = BLEND2x16_50(dw, s, mask);
  21.166 +				dstp += 2;
  21.167 +				srcp += 2;
  21.168 +				w -= 2;
  21.169 +			}
  21.170 +
  21.171 +			/* final pixel if any */
  21.172 +			if(w) {
  21.173 +				Uint16 d = *dstp, s;
  21.174 +				if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
  21.175 +					s = prev_sw;
  21.176 +				else
  21.177 +					s = prev_sw >> 16;
  21.178 +				*dstp = BLEND16_50(d, s, mask);
  21.179 +				srcp++;
  21.180 +				dstp++;
  21.181 +			}
  21.182 +			srcp += srcskip - 1;
  21.183 +			dstp += dstskip;
  21.184 +		} else {
  21.185 +			/* source and destination are aligned */
  21.186 +			int w = width;
  21.187 +
  21.188 +			/* first odd pixel? */
  21.189 +			if((unsigned long)srcp & 2) {
  21.190 +				Uint16 d = *dstp, s = *srcp;
  21.191 +				*dstp = BLEND16_50(d, s, mask);
  21.192 +				srcp++;
  21.193 +				dstp++;
  21.194 +				w--;
  21.195 +			}
  21.196 +			/* srcp and dstp are now 32-bit aligned */
  21.197 +
  21.198 +			while(w > 1) {
  21.199 +				Uint32 sw = *(Uint32 *)srcp;
  21.200 +				Uint32 dw = *(Uint32 *)dstp;
  21.201 +				*(Uint32 *)dstp = BLEND2x16_50(dw, sw, mask);
  21.202 +				srcp += 2;
  21.203 +				dstp += 2;
  21.204 +				w -= 2;
  21.205 +			}
  21.206 +
  21.207 +			/* last odd pixel? */
  21.208 +			if(w) {
  21.209 +				Uint16 d = *dstp, s = *srcp;
  21.210 +				*dstp = BLEND16_50(d, s, mask);
  21.211 +				srcp++;
  21.212 +				dstp++;
  21.213 +			}
  21.214 +			srcp += srcskip;
  21.215 +			dstp += dstskip;
  21.216 +		}
  21.217 +	}
  21.218 +}
  21.219 +
  21.220 +/* fast RGB565->RGB565 blending with surface alpha */
  21.221 +static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
  21.222 +{
  21.223 +	unsigned alpha = info->src->alpha;
  21.224 +	if(alpha == 128) {
  21.225 +		Blit16to16SurfaceAlpha128(info, 0xf7de);
  21.226 +	} else {
  21.227 +		int width = info->d_width;
  21.228 +		int height = info->d_height;
  21.229 +		Uint16 *srcp = (Uint16 *)info->s_pixels;
  21.230 +		int srcskip = info->s_skip >> 1;
  21.231 +		Uint16 *dstp = (Uint16 *)info->d_pixels;
  21.232 +		int dstskip = info->d_skip >> 1;
  21.233 +		alpha >>= 3;	/* downscale alpha to 5 bits */
  21.234 +
  21.235 +		while(height--) {
  21.236 +			DUFFS_LOOP4({
  21.237 +				Uint32 s = *srcp++;
  21.238 +				Uint32 d = *dstp;
  21.239 +				/*
  21.240 +				 * shift out the middle component (green) to
  21.241 +				 * the high 16 bits, and process all three RGB
  21.242 +				 * components at the same time.
  21.243 +				 */
  21.244 +				s = (s | s << 16) & 0x07e0f81f;
  21.245 +				d = (d | d << 16) & 0x07e0f81f;
  21.246 +				d += (s - d) * alpha >> 5;
  21.247 +				d &= 0x07e0f81f;
  21.248 +				*dstp++ = d | d >> 16;
  21.249 +			}, width);
  21.250 +			srcp += srcskip;
  21.251 +			dstp += dstskip;
  21.252 +		}
  21.253  	}
  21.254  }
  21.255  
  21.256  /* fast RGB555->RGB555 blending with surface alpha */
  21.257  static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info)
  21.258  {
  21.259 -	int width = info->d_width;
  21.260 -	int height = info->d_height;
  21.261 -	Uint16 *srcp = (Uint16 *)info->s_pixels;
  21.262 -	int srcskip = info->s_skip >> 1;
  21.263 -	Uint16 *dstp = (Uint16 *)info->d_pixels;
  21.264 -	int dstskip = info->d_skip >> 1;
  21.265 -	unsigned alpha = info->src->alpha >> 3; /* downscale alpha to 5 bits */
  21.266 +	unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */
  21.267 +	if(alpha == 128) {
  21.268 +		Blit16to16SurfaceAlpha128(info, 0xfbde);
  21.269 +	} else {
  21.270 +		int width = info->d_width;
  21.271 +		int height = info->d_height;
  21.272 +		Uint16 *srcp = (Uint16 *)info->s_pixels;
  21.273 +		int srcskip = info->s_skip >> 1;
  21.274 +		Uint16 *dstp = (Uint16 *)info->d_pixels;
  21.275 +		int dstskip = info->d_skip >> 1;
  21.276 +		alpha >>= 3;		/* downscale alpha to 5 bits */
  21.277  
  21.278 -	while(height--) {
  21.279 -	    DUFFS_LOOP4({
  21.280 -		Uint32 s = *srcp++;
  21.281 -		Uint32 d = *dstp;
  21.282 -		/*
  21.283 -		 * shift out the middle component (green) to the high 16
  21.284 -		 * bits, and process all three RGB components at the same
  21.285 -		 * time.
  21.286 -		 */
  21.287 -		s = (s | s << 16) & 0x03e07c1f;
  21.288 -		d = (d | d << 16) & 0x03e07c1f;
  21.289 -		d += (s - d) * alpha >> 5;
  21.290 -		d &= 0x03e07c1f;
  21.291 -		*dstp++ = d | d >> 16;
  21.292 -	    }, width);
  21.293 -	    srcp += srcskip;
  21.294 -	    dstp += dstskip;
  21.295 +		while(height--) {
  21.296 +			DUFFS_LOOP4({
  21.297 +				Uint32 s = *srcp++;
  21.298 +				Uint32 d = *dstp;
  21.299 +				/*
  21.300 +				 * shift out the middle component (green) to
  21.301 +				 * the high 16 bits, and process all three RGB
  21.302 +				 * components at the same time.
  21.303 +				 */
  21.304 +				s = (s | s << 16) & 0x03e07c1f;
  21.305 +				d = (d | d << 16) & 0x03e07c1f;
  21.306 +				d += (s - d) * alpha >> 5;
  21.307 +				d &= 0x03e07c1f;
  21.308 +				*dstp++ = d | d >> 16;
  21.309 +			}, width);
  21.310 +			srcp += srcskip;
  21.311 +			dstp += dstskip;
  21.312 +		}
  21.313  	}
  21.314  }
  21.315  
    22.1 --- a/src/video/SDL_cursor.c	Thu Apr 26 16:45:43 2001 +0000
    22.2 +++ b/src/video/SDL_cursor.c	Thu Apr 26 16:50:19 2001 +0000
    22.3 @@ -723,7 +723,9 @@
    22.4  		SDL_Rect area;
    22.5  
    22.6  		SDL_MouseRect(&area);
    22.7 -		video->UpdateRects(this, 1, &area);
    22.8 +		if ( video->UpdateRects ) {
    22.9 +			video->UpdateRects(this, 1, &area);
   22.10 +		}
   22.11  	}
   22.12  }
   22.13  
    23.1 --- a/src/video/SDL_memops.h	Thu Apr 26 16:45:43 2001 +0000
    23.2 +++ b/src/video/SDL_memops.h	Thu Apr 26 16:50:19 2001 +0000
    23.3 @@ -53,6 +53,17 @@
    23.4  		: "memory" );						  \
    23.5  } while(0)
    23.6  
    23.7 +#define SDL_memcpy4(dst, src, len)				\
    23.8 +do {								\
    23.9 +	int ecx, edi, esi;					\
   23.10 +	__asm__ __volatile__ (					\
   23.11 +		"cld\n\t"					\
   23.12 +		"rep ; movsl"					\
   23.13 +		: "=&c" (ecx), "=&D" (edi), "=&S" (esi)		\
   23.14 +		: "0" ((unsigned)(len)), "1" (dst), "2" (src)	\
   23.15 +		: "memory" );					\
   23.16 +} while(0)
   23.17 +
   23.18  #define SDL_revcpy(dst, src, len)			\
   23.19  do {							\
   23.20  	int u0, u1, u2;					\
   23.21 @@ -104,9 +115,15 @@
   23.22  #ifndef SDL_memcpy
   23.23  #define SDL_memcpy(dst, src, len)	memcpy(dst, src, len)
   23.24  #endif
   23.25 +
   23.26 +#ifndef SDL_memcpy4
   23.27 +#define SDL_memcpy4(dst, src, len)	memcpy(dst, src, (len) << 2)
   23.28 +#endif
   23.29 +
   23.30  #ifndef SDL_revcpy
   23.31  #define SDL_revcpy(dst, src, len)	memmove(dst, src, len)
   23.32  #endif
   23.33 +
   23.34  #ifndef SDL_memset4
   23.35  #define SDL_memset4(dst, val, len)		\
   23.36  do {						\
    24.1 --- a/src/video/SDL_sysvideo.h	Thu Apr 26 16:45:43 2001 +0000
    24.2 +++ b/src/video/SDL_sysvideo.h	Thu Apr 26 16:50:19 2001 +0000
    24.3 @@ -355,6 +355,9 @@
    24.4  #ifdef ENABLE_BWINDOW
    24.5  extern VideoBootStrap BWINDOW_bootstrap;
    24.6  #endif
    24.7 +#ifdef ENABLE_DUMMYVIDEO
    24.8 +extern VideoBootStrap DUMMY_bootstrap;
    24.9 +#endif
   24.10  /* MacOS X gets the proper defines from configure */
   24.11  #if defined(macintosh) && !defined(MACOSX)
   24.12  #define ENABLE_TOOLBOX
    25.1 --- a/src/video/SDL_video.c	Thu Apr 26 16:45:43 2001 +0000
    25.2 +++ b/src/video/SDL_video.c	Thu Apr 26 16:50:19 2001 +0000
    25.3 @@ -84,6 +84,9 @@
    25.4  #ifdef ENABLE_CYBERGRAPHICS
    25.5  	&CGX_bootstrap,
    25.6  #endif
    25.7 +#ifdef ENABLE_DUMMYVIDEO
    25.8 +	&DUMMY_bootstrap,
    25.9 +#endif
   25.10  	NULL
   25.11  };
   25.12  SDL_VideoDevice *current_video = NULL;
    26.1 --- a/src/video/bwindow/SDL_BView.h	Thu Apr 26 16:45:43 2001 +0000
    26.2 +++ b/src/video/bwindow/SDL_BView.h	Thu Apr 26 16:50:19 2001 +0000
    26.3 @@ -50,6 +50,10 @@
    26.4  		xoff = x;
    26.5  		yoff = y;
    26.6  	}
    26.7 +	virtual void GetXYOffset(int &x, int &y) {
    26.8 +		x = xoff;
    26.9 +		y = yoff;
   26.10 +	}
   26.11  	/* The view changed size. If it means we're in fullscreen, we
   26.12  	 * draw a nice black box in the entire view to get black borders.
   26.13  	 */
    27.1 --- a/src/video/bwindow/SDL_BWin.h	Thu Apr 26 16:45:43 2001 +0000
    27.2 +++ b/src/video/bwindow/SDL_BWin.h	Thu Apr 26 16:50:19 2001 +0000
    27.3 @@ -156,6 +156,16 @@
    27.4  #endif
    27.5  		SDL_View->SetXYOffset(x, y);		
    27.6  	}
    27.7 +	virtual void GetXYOffset(int &x, int &y) {
    27.8 +#ifdef HAVE_OPENGL
    27.9 +		if ( the_view == SDL_GLView ) {
   27.10 +			x = 0;
   27.11 +			y = 0;
   27.12 +			return;
   27.13 +		}
   27.14 +#endif
   27.15 +		SDL_View->GetXYOffset(x, y);
   27.16 +	}
   27.17  	virtual bool BeginDraw(void) {
   27.18  		return(Lock());
   27.19  	}
    28.1 --- a/src/video/bwindow/SDL_sysevents.cc	Thu Apr 26 16:45:43 2001 +0000
    28.2 +++ b/src/video/bwindow/SDL_sysevents.cc	Thu Apr 26 16:50:19 2001 +0000
    28.3 @@ -262,7 +262,12 @@
    28.4  
    28.5  	/* Check for mouse motion */
    28.6  	if ( point != last_point ) {
    28.7 -		SDL_PrivateMouseMotion(0, 0, (int)point.x, (int)point.y);
    28.8 +		int x, y;
    28.9 +
   28.10 +		SDL_Win->GetXYOffset(x, y);
   28.11 +		x = (int)point.x - x;
   28.12 +		y = (int)point.y - y;
   28.13 +		SDL_PrivateMouseMotion(0, 0, x, y);
   28.14  	}
   28.15  	last_point = point;
   28.16  
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/src/video/dummy/Makefile.am	Thu Apr 26 16:50:19 2001 +0000
    29.3 @@ -0,0 +1,15 @@
    29.4 +
    29.5 +## Makefile.am for SDL using the null video driver
    29.6 +
    29.7 +noinst_LTLIBRARIES = libvideo_null.la
    29.8 +libvideo_null_la_SOURCES = $(NULL_SRCS)
    29.9 +
   29.10 +# The SDL null video driver sources
   29.11 +NULL_SRCS = 			\
   29.12 +	SDL_nullvideo.h		\
   29.13 +	SDL_nullevents.c	\
   29.14 +	SDL_nullevents_c.h	\
   29.15 +	SDL_nullmouse.c		\
   29.16 +	SDL_nullmouse_c.h	\
   29.17 +	SDL_nullvideo.c
   29.18 +
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/src/video/dummy/SDL_nullevents.c	Thu Apr 26 16:50:19 2001 +0000
    30.3 @@ -0,0 +1,48 @@
    30.4 +/*
    30.5 +    SDL - Simple DirectMedia Layer
    30.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
    30.7 +
    30.8 +    This library is free software; you can redistribute it and/or
    30.9 +    modify it under the terms of the GNU Library General Public
   30.10 +    License as published by the Free Software Foundation; either
   30.11 +    version 2 of the License, or (at your option) any later version.
   30.12 +
   30.13 +    This library is distributed in the hope that it will be useful,
   30.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   30.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   30.16 +    Library General Public License for more details.
   30.17 +
   30.18 +    You should have received a copy of the GNU Library General Public
   30.19 +    License along with this library; if not, write to the Free
   30.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   30.21 +
   30.22 +    Sam Lantinga
   30.23 +    slouken@devolution.com
   30.24 +*/
   30.25 +
   30.26 +#ifdef SAVE_RCSID
   30.27 +static char rcsid =
   30.28 + "@(#) $Id$";
   30.29 +#endif
   30.30 +
   30.31 +/* Being a null driver, there's no event stream. We just define stubs for
   30.32 +   most of the API. */
   30.33 +
   30.34 +#include "SDL.h"
   30.35 +#include "SDL_sysevents.h"
   30.36 +#include "SDL_events_c.h"
   30.37 +#include "SDL_nullvideo.h"
   30.38 +#include "SDL_nullevents_c.h"
   30.39 +
   30.40 +void DUMMY_PumpEvents(_THIS)
   30.41 +{
   30.42 +	/* do nothing. */
   30.43 +}
   30.44 +
   30.45 +void DUMMY_InitOSKeymap(_THIS)
   30.46 +{
   30.47 +	/* do nothing. */
   30.48 +}
   30.49 +
   30.50 +/* end of SDL_nullevents.c ... */
   30.51 +
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/src/video/dummy/SDL_nullevents_c.h	Thu Apr 26 16:50:19 2001 +0000
    31.3 @@ -0,0 +1,37 @@
    31.4 +/*
    31.5 +    SDL - Simple DirectMedia Layer
    31.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
    31.7 +
    31.8 +    This library is free software; you can redistribute it and/or
    31.9 +    modify it under the terms of the GNU Library General Public
   31.10 +    License as published by the Free Software Foundation; either
   31.11 +    version 2 of the License, or (at your option) any later version.
   31.12 +
   31.13 +    This library is distributed in the hope that it will be useful,
   31.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   31.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   31.16 +    Library General Public License for more details.
   31.17 +
   31.18 +    You should have received a copy of the GNU Library General Public
   31.19 +    License along with this library; if not, write to the Free
   31.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   31.21 +
   31.22 +    Sam Lantinga
   31.23 +    slouken@devolution.com
   31.24 +*/
   31.25 +
   31.26 +#ifdef SAVE_RCSID
   31.27 +static char rcsid =
   31.28 + "@(#) $Id$";
   31.29 +#endif
   31.30 +
   31.31 +#include "SDL_nullvideo.h"
   31.32 +
   31.33 +/* Variables and functions exported by SDL_sysevents.c to other parts 
   31.34 +   of the native video subsystem (SDL_sysvideo.c)
   31.35 +*/
   31.36 +extern void DUMMY_InitOSKeymap(_THIS);
   31.37 +extern void DUMMY_PumpEvents(_THIS);
   31.38 +
   31.39 +/* end of SDL_nullevents_c.h ... */
   31.40 +
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/src/video/dummy/SDL_nullmouse.c	Thu Apr 26 16:50:19 2001 +0000
    32.3 @@ -0,0 +1,40 @@
    32.4 +/*
    32.5 +    SDL - Simple DirectMedia Layer
    32.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
    32.7 +
    32.8 +    This library is free software; you can redistribute it and/or
    32.9 +    modify it under the terms of the GNU Library General Public
   32.10 +    License as published by the Free Software Foundation; either
   32.11 +    version 2 of the License, or (at your option) any later version.
   32.12 +
   32.13 +    This library is distributed in the hope that it will be useful,
   32.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   32.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   32.16 +    Library General Public License for more details.
   32.17 +
   32.18 +    You should have received a copy of the GNU Library General Public
   32.19 +    License along with this library; if not, write to the Free
   32.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   32.21 +
   32.22 +    Sam Lantinga
   32.23 +    slouken@devolution.com
   32.24 +*/
   32.25 +
   32.26 +#ifdef SAVE_RCSID
   32.27 +static char rcsid =
   32.28 + "@(#) $Id$";
   32.29 +#endif
   32.30 +
   32.31 +#include <stdio.h>
   32.32 +
   32.33 +#include "SDL_error.h"
   32.34 +#include "SDL_mouse.h"
   32.35 +#include "SDL_events_c.h"
   32.36 +
   32.37 +#include "SDL_nullmouse_c.h"
   32.38 +
   32.39 +
   32.40 +/* The implementation dependent data for the window manager cursor */
   32.41 +struct WMcursor {
   32.42 +	int unused;
   32.43 +};
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/src/video/dummy/SDL_nullmouse_c.h	Thu Apr 26 16:50:19 2001 +0000
    33.3 @@ -0,0 +1,30 @@
    33.4 +/*
    33.5 +    SDL - Simple DirectMedia Layer
    33.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
    33.7 +
    33.8 +    This library is free software; you can redistribute it and/or
    33.9 +    modify it under the terms of the GNU Library General Public
   33.10 +    License as published by the Free Software Foundation; either
   33.11 +    version 2 of the License, or (at your option) any later version.
   33.12 +
   33.13 +    This library is distributed in the hope that it will be useful,
   33.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   33.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   33.16 +    Library General Public License for more details.
   33.17 +
   33.18 +    You should have received a copy of the GNU Library General Public
   33.19 +    License along with this library; if not, write to the Free
   33.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   33.21 +
   33.22 +    Sam Lantinga
   33.23 +    slouken@devolution.com
   33.24 +*/
   33.25 +
   33.26 +#ifdef SAVE_RCSID
   33.27 +static char rcsid =
   33.28 + "@(#) $Id$";
   33.29 +#endif
   33.30 +
   33.31 +#include "SDL_nullvideo.h"
   33.32 +
   33.33 +/* Functions to be exported */
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/src/video/dummy/SDL_nullvideo.c	Thu Apr 26 16:50:19 2001 +0000
    34.3 @@ -0,0 +1,245 @@
    34.4 +/*
    34.5 +    SDL - Simple DirectMedia Layer
    34.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
    34.7 +
    34.8 +    This library is free software; you can redistribute it and/or
    34.9 +    modify it under the terms of the GNU Library General Public
   34.10 +    License as published by the Free Software Foundation; either
   34.11 +    version 2 of the License, or (at your option) any later version.
   34.12 +
   34.13 +    This library is distributed in the hope that it will be useful,
   34.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   34.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   34.16 +    Library General Public License for more details.
   34.17 +
   34.18 +    You should have received a copy of the GNU Library General Public
   34.19 +    License along with this library; if not, write to the Free
   34.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   34.21 +
   34.22 +    Sam Lantinga
   34.23 +    slouken@devolution.com
   34.24 +*/
   34.25 +
   34.26 +#ifdef SAVE_RCSID
   34.27 +static char rcsid =
   34.28 + "@(#) $Id$";
   34.29 +#endif
   34.30 +
   34.31 +/* Dummy SDL video driver implementation; this is just enough to make an
   34.32 + *  SDL-based application THINK it's got a working video driver, for
   34.33 + *  applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
   34.34 + *  and also for use as a collection of stubs when porting SDL to a new
   34.35 + *  platform for which you haven't yet written a valid video driver.
   34.36 + *
   34.37 + * This is also a great way to determine bottlenecks: if you think that SDL
   34.38 + *  is a performance problem for a given platform, enable this driver, and
   34.39 + *  then see if your application runs faster without video overhead.
   34.40 + *
   34.41 + * Initial work by Ryan C. Gordon (icculus@linuxgames.com). A good portion
   34.42 + *  of this was cut-and-pasted from Stephane Peter's work in the AAlib
   34.43 + *  SDL video driver.  Renamed to "DUMMY" by Sam Lantinga.
   34.44 + */
   34.45 +
   34.46 +#include <stdio.h>
   34.47 +#include <stdlib.h>
   34.48 +
   34.49 +#include "SDL.h"
   34.50 +#include "SDL_error.h"
   34.51 +#include "SDL_video.h"
   34.52 +#include "SDL_mouse.h"
   34.53 +#include "SDL_sysvideo.h"
   34.54 +#include "SDL_pixels_c.h"
   34.55 +#include "SDL_events_c.h"
   34.56 +
   34.57 +#include "SDL_nullvideo.h"
   34.58 +#include "SDL_nullevents_c.h"
   34.59 +#include "SDL_nullmouse_c.h"
   34.60 +
   34.61 +/* Initialization/Query functions */
   34.62 +static int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat);
   34.63 +static SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
   34.64 +static SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
   34.65 +static int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
   34.66 +static void DUMMY_VideoQuit(_THIS);
   34.67 +
   34.68 +/* Hardware surface functions */
   34.69 +static int DUMMY_AllocHWSurface(_THIS, SDL_Surface *surface);
   34.70 +static int DUMMY_LockHWSurface(_THIS, SDL_Surface *surface);
   34.71 +static int DUMMY_FlipHWSurface(_THIS, SDL_Surface *surface);
   34.72 +static void DUMMY_UnlockHWSurface(_THIS, SDL_Surface *surface);
   34.73 +static void DUMMY_FreeHWSurface(_THIS, SDL_Surface *surface);
   34.74 +
   34.75 +/* etc. */
   34.76 +static void DUMMY_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
   34.77 +
   34.78 +/* DUMMY driver bootstrap functions */
   34.79 +
   34.80 +static int DUMMY_Available(void)
   34.81 +{
   34.82 +	return 1; /* Always available ! */
   34.83 +}
   34.84 +
   34.85 +static void DUMMY_DeleteDevice(SDL_VideoDevice *device)
   34.86 +{
   34.87 +	free(device->hidden);
   34.88 +	free(device);
   34.89 +}
   34.90 +
   34.91 +static SDL_VideoDevice *DUMMY_CreateDevice(int devindex)
   34.92 +{
   34.93 +	SDL_VideoDevice *device;
   34.94 +
   34.95 +	/* Initialize all variables that we clean on shutdown */
   34.96 +	device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice));
   34.97 +	if ( device ) {
   34.98 +		memset(device, 0, (sizeof *device));
   34.99 +		device->hidden = (struct SDL_PrivateVideoData *)
  34.100 +				malloc((sizeof *device->hidden));
  34.101 +	}
  34.102 +	if ( (device == NULL) || (device->hidden == NULL) ) {
  34.103 +		SDL_OutOfMemory();
  34.104 +		if ( device ) {
  34.105 +			free(device);
  34.106 +		}
  34.107 +		return(0);
  34.108 +	}
  34.109 +	memset(device->hidden, 0, (sizeof *device->hidden));
  34.110 +
  34.111 +	/* Set the function pointers */
  34.112 +	device->VideoInit = DUMMY_VideoInit;
  34.113 +	device->ListModes = DUMMY_ListModes;
  34.114 +	device->SetVideoMode = DUMMY_SetVideoMode;
  34.115 +	device->CreateYUVOverlay = NULL;
  34.116 +	device->SetColors = DUMMY_SetColors;
  34.117 +	device->UpdateRects = DUMMY_UpdateRects;
  34.118 +	device->VideoQuit = DUMMY_VideoQuit;
  34.119 +	device->AllocHWSurface = DUMMY_AllocHWSurface;
  34.120 +	device->CheckHWBlit = NULL;
  34.121 +	device->FillHWRect = NULL;
  34.122 +	device->SetHWColorKey = NULL;
  34.123 +	device->SetHWAlpha = NULL;
  34.124 +	device->LockHWSurface = DUMMY_LockHWSurface;
  34.125 +	device->UnlockHWSurface = DUMMY_UnlockHWSurface;
  34.126 +	device->FlipHWSurface = NULL;
  34.127 +	device->FreeHWSurface = DUMMY_FreeHWSurface;
  34.128 +	device->SetCaption = NULL;
  34.129 +	device->SetIcon = NULL;
  34.130 +	device->IconifyWindow = NULL;
  34.131 +	device->GrabInput = NULL;
  34.132 +	device->GetWMInfo = NULL;
  34.133 +	device->InitOSKeymap = DUMMY_InitOSKeymap;
  34.134 +	device->PumpEvents = DUMMY_PumpEvents;
  34.135 +
  34.136 +	device->free = DUMMY_DeleteDevice;
  34.137 +
  34.138 +	return device;
  34.139 +}
  34.140 +
  34.141 +VideoBootStrap DUMMY_bootstrap = {
  34.142 +	"dummy", "SDL dummy video driver",
  34.143 +	DUMMY_Available, DUMMY_CreateDevice
  34.144 +};
  34.145 +
  34.146 +
  34.147 +int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat)
  34.148 +{
  34.149 +	fprintf(stderr, "WARNING: You are using the SDL dummy video driver!\n");
  34.150 +
  34.151 +	/* Determine the screen depth (use default 8-bit depth) */
  34.152 +	/* we change this during the SDL_SetVideoMode implementation... */
  34.153 +	vformat->BitsPerPixel = 8;
  34.154 +	vformat->BytesPerPixel = 1;
  34.155 +
  34.156 +	/* We're done! */
  34.157 +	return(0);
  34.158 +}
  34.159 +
  34.160 +SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
  34.161 +{
  34.162 +   	 return (SDL_Rect **) -1;
  34.163 +}
  34.164 +
  34.165 +SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current,
  34.166 +				int width, int height, int bpp, Uint32 flags)
  34.167 +{
  34.168 +	if ( this->hidden->buffer ) {
  34.169 +		free( this->hidden->buffer );
  34.170 +	}
  34.171 +
  34.172 +	this->hidden->buffer = malloc(width * height * (bpp / 8));
  34.173 +	if ( ! this->hidden->buffer ) {
  34.174 +		SDL_SetError("Couldn't allocate buffer for requested mode");
  34.175 +		return(NULL);
  34.176 +	}
  34.177 +
  34.178 +/* 	printf("Setting mode %dx%d\n", width, height); */
  34.179 +
  34.180 +	memset(this->hidden->buffer, 0, width * height * (bpp / 8));
  34.181 +
  34.182 +	/* Allocate the new pixel format for the screen */
  34.183 +	if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
  34.184 +		free(this->hidden->buffer);
  34.185 +		this->hidden->buffer = NULL;
  34.186 +		SDL_SetError("Couldn't allocate new pixel format for requested mode");
  34.187 +		return(NULL);
  34.188 +	}
  34.189 +
  34.190 +	/* Set up the new mode framebuffer */
  34.191 +	current->flags = flags & SDL_FULLSCREEN;
  34.192 +	this->hidden->w = current->w = width;
  34.193 +	this->hidden->h = current->h = height;
  34.194 +	current->pitch = current->w * (bpp / 8);
  34.195 +	current->pixels = this->hidden->buffer;
  34.196 +
  34.197 +	/* We're done */
  34.198 +	return(current);
  34.199 +}
  34.200 +
  34.201 +/* We don't actually allow hardware surfaces other than the main one */
  34.202 +static int DUMMY_AllocHWSurface(_THIS, SDL_Surface *surface)
  34.203 +{
  34.204 +	return(-1);
  34.205 +}
  34.206 +static void DUMMY_FreeHWSurface(_THIS, SDL_Surface *surface)
  34.207 +{
  34.208 +	return;
  34.209 +}
  34.210 +
  34.211 +/* We need to wait for vertical retrace on page flipped displays */
  34.212 +static int DUMMY_LockHWSurface(_THIS, SDL_Surface *surface)
  34.213 +{
  34.214 +	return(0);
  34.215 +}
  34.216 +
  34.217 +static void DUMMY_UnlockHWSurface(_THIS, SDL_Surface *surface)
  34.218 +{
  34.219 +	return;
  34.220 +}
  34.221 +
  34.222 +static int DUMMY_FlipHWSurface(_THIS, SDL_Surface *surface)
  34.223 +{
  34.224 +	return(0);
  34.225 +}
  34.226 +
  34.227 +static void DUMMY_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
  34.228 +{
  34.229 +	/* do nothing. */
  34.230 +}
  34.231 +
  34.232 +int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
  34.233 +{
  34.234 +	/* do nothing of note. */
  34.235 +	return(1);
  34.236 +}
  34.237 +
  34.238 +/* Note:  If we are terminated, this could be called in the middle of
  34.239 +   another SDL video routine -- notably UpdateRects.
  34.240 +*/
  34.241 +void DUMMY_VideoQuit(_THIS)
  34.242 +{
  34.243 +	if (this->screen->pixels != NULL)
  34.244 +	{
  34.245 +		free(this->screen->pixels);
  34.246 +		this->screen->pixels = NULL;
  34.247 +	}
  34.248 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/src/video/dummy/SDL_nullvideo.h	Thu Apr 26 16:50:19 2001 +0000
    35.3 @@ -0,0 +1,46 @@
    35.4 +/*
    35.5 +    SDL - Simple DirectMedia Layer
    35.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
    35.7 +
    35.8 +    This library is free software; you can redistribute it and/or
    35.9 +    modify it under the terms of the GNU Library General Public
   35.10 +    License as published by the Free Software Foundation; either
   35.11 +    version 2 of the License, or (at your option) any later version.
   35.12 +
   35.13 +    This library is distributed in the hope that it will be useful,
   35.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   35.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   35.16 +    Library General Public License for more details.
   35.17 +
   35.18 +    You should have received a copy of the GNU Library General Public
   35.19 +    License along with this library; if not, write to the Free
   35.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   35.21 +
   35.22 +    Sam Lantinga
   35.23 +    slouken@devolution.com
   35.24 +*/
   35.25 +
   35.26 +#ifdef SAVE_RCSID
   35.27 +static char rcsid =
   35.28 + "@(#) $Id$";
   35.29 +#endif
   35.30 +
   35.31 +#ifndef _SDL_nullvideo_h
   35.32 +#define _SDL_nullvideo_h
   35.33 +
   35.34 +#include "SDL_mouse.h"
   35.35 +#include "SDL_sysvideo.h"
   35.36 +#include "SDL_mutex.h"
   35.37 +
   35.38 +/* Hidden "this" pointer for the video functions */
   35.39 +#define _THIS	SDL_VideoDevice *this
   35.40 +
   35.41 +
   35.42 +/* Private display data */
   35.43 +
   35.44 +struct SDL_PrivateVideoData {
   35.45 +    int w, h;
   35.46 +    void *buffer;
   35.47 +};
   35.48 +
   35.49 +#endif /* _SDL_nullvideo_h */
    36.1 --- a/src/video/svga/SDL_svgavideo.c	Thu Apr 26 16:45:43 2001 +0000
    36.2 +++ b/src/video/svga/SDL_svgavideo.c	Thu Apr 26 16:50:19 2001 +0000
    36.3 @@ -370,6 +370,10 @@
    36.4  
    36.5  	/* Set up the new mode framebuffer */
    36.6  	current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
    36.7 +	if ( bpp == 8 ) {
    36.8 +		/* FIXME: What about DirectColor? */
    36.9 +		current->flags |= SDL_HWPALETTE;
   36.10 +	}
   36.11  	current->w = width;
   36.12  	current->h = height;
   36.13  	current->pitch = modeinfo->linewidth;
    37.1 --- a/src/video/wincommon/SDL_sysevents.c	Thu Apr 26 16:45:43 2001 +0000
    37.2 +++ b/src/video/wincommon/SDL_sysevents.c	Thu Apr 26 16:50:19 2001 +0000
    37.3 @@ -134,10 +134,10 @@
    37.4  		if ( keyboard[VK_RMENU] & 0x80) {
    37.5  			state |= KMOD_RALT;
    37.6  		}
    37.7 -		if ( keyboard[VK_NUMLOCK] & 0x80) {
    37.8 +		if ( keyboard[VK_NUMLOCK] & 0x01) {
    37.9  			state |= KMOD_NUM;
   37.10  		}
   37.11 -		if ( keyboard[VK_CAPITAL] & 0x80) {
   37.12 +		if ( keyboard[VK_CAPITAL] & 0x01) {
   37.13  			state |= KMOD_CAPS;
   37.14  		}
   37.15  	}
    38.1 --- a/src/video/windx5/SDL_dx5video.c	Thu Apr 26 16:45:43 2001 +0000
    38.2 +++ b/src/video/windx5/SDL_dx5video.c	Thu Apr 26 16:50:19 2001 +0000
    38.3 @@ -1684,6 +1684,7 @@
    38.4  	return(DX5_AllocDDSurface(this, surface, NULL, SDL_HWSURFACE));
    38.5  }
    38.6  
    38.7 +#ifdef DDRAW_DEBUG
    38.8  void PrintSurface(char *title, LPDIRECTDRAWSURFACE3 surface, Uint32 flags)
    38.9  {
   38.10  	DDSURFACEDESC ddsd;
   38.11 @@ -1717,6 +1718,7 @@
   38.12  	     		ddsd.ddpfPixelFormat.dwBBitMask);
   38.13  #endif
   38.14  }
   38.15 +#endif /* DDRAW_DEBUG */
   38.16  
   38.17  static int DX5_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
   38.18  					SDL_Surface *dst, SDL_Rect *dstrect)
    39.1 --- a/strip_fPIC.sh	Thu Apr 26 16:45:43 2001 +0000
    39.2 +++ b/strip_fPIC.sh	Thu Apr 26 16:50:19 2001 +0000
    39.3 @@ -3,7 +3,7 @@
    39.4  # libtool assumes that the compiler can handle the -fPIC flag
    39.5  # This isn't always true (for example, nasm can't handle it)
    39.6  command=""
    39.7 -while [ $1 ]; do
    39.8 +while [ $# -gt 0 ]; do
    39.9      if [ "$1" != "-fPIC" ]; then
   39.10          if [ "$1" != "-DPIC" ]; then
   39.11              command="$command $1"
    40.1 --- a/test/acinclude.m4	Thu Apr 26 16:45:43 2001 +0000
    40.2 +++ b/test/acinclude.m4	Thu Apr 26 16:50:19 2001 +0000
    40.3 @@ -140,6 +140,11 @@
    40.4            AC_TRY_LINK([
    40.5  #include <stdio.h>
    40.6  #include "SDL.h"
    40.7 +
    40.8 +int main(int argc, char *argv[])
    40.9 +{ return 0; }
   40.10 +#undef  main
   40.11 +#define main K_and_R_C_main
   40.12  ],      [ return 0; ],
   40.13          [ echo "*** The test program compiled, but did not run. This usually means"
   40.14            echo "*** that the run-time linker is not finding SDL or finding the wrong"