IRIX patches from Andrea Suatoni
authorSam Lantinga <slouken@libsdl.org>
Thu, 06 Mar 2003 06:12:41 +0000
changeset 6056399f4e90211
parent 604 31d3af76488b
child 606 84d043703e77
IRIX patches from Andrea Suatoni
configure.in
src/audio/dmedia/SDL_irixaudio.c
src/audio/nas/SDL_nasaudio.h
src/video/x11/SDL_x11image.c
test/testoverlay.c
     1.1 --- a/configure.in	Thu Mar 06 06:02:16 2003 +0000
     1.2 +++ b/configure.in	Thu Mar 06 06:12:41 2003 +0000
     1.3 @@ -415,14 +415,22 @@
     1.4          have_nas=no
     1.5          if test -r /usr/X11R6/include/audio/audiolib.h; then
     1.6              have_nas=yes
     1.7 -        fi
     1.8 -        AC_MSG_RESULT($have_nas)
     1.9 -        if test x$have_nas = xyes; then
    1.10              CFLAGS="$CFLAGS -DNAS_SUPPORT"
    1.11              SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
    1.12              AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
    1.13              AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
    1.14 +
    1.15 +        dnl On IRIX, the NAS includes are in a different directory,
    1.16 +        dnl and libnas must be explicitly linked in
    1.17 +
    1.18 +        elif test -r /usr/freeware/include/nas/audiolib.h; then
    1.19 +            have_nas=yes
    1.20 +            CFLAGS="$CFLAGS -DNAS_SUPPORT"
    1.21 +            SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
    1.22 +            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
    1.23 +            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
    1.24          fi
    1.25 +        AC_MSG_RESULT($have_nas)
    1.26      fi
    1.27  }
    1.28  
     2.1 --- a/src/audio/dmedia/SDL_irixaudio.c	Thu Mar 06 06:02:16 2003 +0000
     2.2 +++ b/src/audio/dmedia/SDL_irixaudio.c	Thu Mar 06 06:12:41 2003 +0000
     2.3 @@ -129,7 +129,7 @@
     2.4  		mixbuf = NULL;
     2.5  	}
     2.6  	if ( audio_port != NULL ) {
     2.7 -		ALcloseport(audio_port);
     2.8 +		alClosePort(audio_port);
     2.9  		audio_port = NULL;
    2.10  	}
    2.11  }
    2.12 @@ -180,7 +180,7 @@
    2.13  	     (alSetWidth(audio_config, width) >= 0) &&
    2.14  	     (alSetQueueSize(audio_config, spec->samples*2) >= 0) &&
    2.15  	     (alSetChannels(audio_config, spec->channels) >= 0) ) {
    2.16 -		audio_port = ALopenport("SDL audio", "w", audio_config);
    2.17 +		audio_port = alOpenPort("SDL audio", "w", audio_config);
    2.18  	}
    2.19  	alFreeConfig(audio_config);
    2.20  	if( audio_port == NULL ) {
     3.1 --- a/src/audio/nas/SDL_nasaudio.h	Thu Mar 06 06:02:16 2003 +0000
     3.2 +++ b/src/audio/nas/SDL_nasaudio.h	Thu Mar 06 06:12:41 2003 +0000
     3.3 @@ -32,7 +32,11 @@
     3.4  #ifndef _SDL_nasaudio_h
     3.5  #define _SDL_nasaudio_h
     3.6  
     3.7 +#ifdef __sgi
     3.8 +#include <nas/audiolib.h>
     3.9 +#else
    3.10  #include <audio/audiolib.h>
    3.11 +#endif
    3.12  #include <sys/time.h>
    3.13  #include "SDL_sysaudio.h"
    3.14  
     4.1 --- a/src/video/x11/SDL_x11image.c	Thu Mar 06 06:02:16 2003 +0000
     4.2 +++ b/src/video/x11/SDL_x11image.c	Thu Mar 06 06:12:41 2003 +0000
     4.3 @@ -168,6 +168,8 @@
     4.4                 }
     4.5                 fclose(pstat);
     4.6             }
     4.7 +#elif defined(__sgi)
     4.8 +	   num_cpus = sysconf(_SC_NPROC_ONLN);
     4.9  #elif defined(_SC_NPROCESSORS_ONLN)
    4.10  	   /* number of processors online (SVR4.0MP compliant machines) */
    4.11             num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
     5.1 --- a/test/testoverlay.c	Thu Mar 06 06:02:16 2003 +0000
     5.2 +++ b/test/testoverlay.c	Thu Mar 06 06:12:41 2003 +0000
     5.3 @@ -92,7 +92,7 @@
     5.4  	/* Convert */
     5.5  	for(y=0; y<s->h && y<o->h; y++)
     5.6  	{
     5.7 -		p=s->pixels+s->pitch*y;
     5.8 +		p=((Uint8 *) s->pixels)+s->pitch*y;
     5.9  		op[0]=o->pixels[0]+o->pitches[0]*y;
    5.10  		op[1]=o->pixels[1]+o->pitches[1]*(y/2);
    5.11  		op[2]=o->pixels[2]+o->pitches[2]*(y/2);
    5.12 @@ -132,7 +132,7 @@
    5.13  	/* Convert */
    5.14  	for(y=0; y<s->h && y<o->h; y++)
    5.15  	{
    5.16 -		p=s->pixels+s->pitch*y;
    5.17 +		p=((Uint8 *) s->pixels)+s->pitch*y;
    5.18  		op[0]=o->pixels[0]+o->pitches[0]*y;
    5.19  		op[1]=o->pixels[1]+o->pitches[1]*(y/2);
    5.20  		op[2]=o->pixels[2]+o->pitches[2]*(y/2);
    5.21 @@ -164,7 +164,7 @@
    5.22  
    5.23  	for(y=0; y<s->h && y<o->h; y++)
    5.24  	{
    5.25 -		p=s->pixels+s->pitch*y;
    5.26 +		p=((Uint8 *) s->pixels)+s->pitch*y;
    5.27  		op=o->pixels[0]+o->pitches[0]*y;
    5.28  		for(x=0; x<s->w && x<o->w; x++)
    5.29  		{
    5.30 @@ -197,7 +197,7 @@
    5.31  
    5.32  	for(y=0; y<s->h && y<o->h; y++)
    5.33  	{
    5.34 -		p=s->pixels+s->pitch*y;
    5.35 +		p=((Uint8 *) s->pixels)+s->pitch*y;
    5.36  		op=o->pixels[0]+o->pitches[0]*y;
    5.37  		for(x=0; x<s->w && x<o->w; x++)
    5.38  		{
    5.39 @@ -233,7 +233,7 @@
    5.40  
    5.41  	for(y=0; y<s->h && y<o->h; y++)
    5.42  	{
    5.43 -		p=s->pixels+s->pitch*y;
    5.44 +		p=((Uint8 *) s->pixels)+s->pitch*y;
    5.45  		op=o->pixels[0]+o->pitches[0]*y;
    5.46  		for(x=0; x<s->w && x<o->w; x++)
    5.47  		{