changeset 605:6399f4e90211

IRIX patches from Andrea Suatoni
author Sam Lantinga <slouken@libsdl.org>
date Thu, 06 Mar 2003 06:12:41 +0000
parents 31d3af76488b
children 84d043703e77
files configure.in src/audio/dmedia/SDL_irixaudio.c src/audio/nas/SDL_nasaudio.h src/video/x11/SDL_x11image.c test/testoverlay.c
diffstat 5 files changed, 24 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Thu Mar 06 06:02:16 2003 +0000
+++ b/configure.in	Thu Mar 06 06:12:41 2003 +0000
@@ -415,14 +415,22 @@
         have_nas=no
         if test -r /usr/X11R6/include/audio/audiolib.h; then
             have_nas=yes
-        fi
-        AC_MSG_RESULT($have_nas)
-        if test x$have_nas = xyes; then
             CFLAGS="$CFLAGS -DNAS_SUPPORT"
             SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
             AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
             AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
+
+        dnl On IRIX, the NAS includes are in a different directory,
+        dnl and libnas must be explicitly linked in
+
+        elif test -r /usr/freeware/include/nas/audiolib.h; then
+            have_nas=yes
+            CFLAGS="$CFLAGS -DNAS_SUPPORT"
+            SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
+            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
+            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
         fi
+        AC_MSG_RESULT($have_nas)
     fi
 }
 
--- a/src/audio/dmedia/SDL_irixaudio.c	Thu Mar 06 06:02:16 2003 +0000
+++ b/src/audio/dmedia/SDL_irixaudio.c	Thu Mar 06 06:12:41 2003 +0000
@@ -129,7 +129,7 @@
 		mixbuf = NULL;
 	}
 	if ( audio_port != NULL ) {
-		ALcloseport(audio_port);
+		alClosePort(audio_port);
 		audio_port = NULL;
 	}
 }
@@ -180,7 +180,7 @@
 	     (alSetWidth(audio_config, width) >= 0) &&
 	     (alSetQueueSize(audio_config, spec->samples*2) >= 0) &&
 	     (alSetChannels(audio_config, spec->channels) >= 0) ) {
-		audio_port = ALopenport("SDL audio", "w", audio_config);
+		audio_port = alOpenPort("SDL audio", "w", audio_config);
 	}
 	alFreeConfig(audio_config);
 	if( audio_port == NULL ) {
--- a/src/audio/nas/SDL_nasaudio.h	Thu Mar 06 06:02:16 2003 +0000
+++ b/src/audio/nas/SDL_nasaudio.h	Thu Mar 06 06:12:41 2003 +0000
@@ -32,7 +32,11 @@
 #ifndef _SDL_nasaudio_h
 #define _SDL_nasaudio_h
 
+#ifdef __sgi
+#include <nas/audiolib.h>
+#else
 #include <audio/audiolib.h>
+#endif
 #include <sys/time.h>
 #include "SDL_sysaudio.h"
 
--- a/src/video/x11/SDL_x11image.c	Thu Mar 06 06:02:16 2003 +0000
+++ b/src/video/x11/SDL_x11image.c	Thu Mar 06 06:12:41 2003 +0000
@@ -168,6 +168,8 @@
                }
                fclose(pstat);
            }
+#elif defined(__sgi)
+	   num_cpus = sysconf(_SC_NPROC_ONLN);
 #elif defined(_SC_NPROCESSORS_ONLN)
 	   /* number of processors online (SVR4.0MP compliant machines) */
            num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
--- a/test/testoverlay.c	Thu Mar 06 06:02:16 2003 +0000
+++ b/test/testoverlay.c	Thu Mar 06 06:12:41 2003 +0000
@@ -92,7 +92,7 @@
 	/* Convert */
 	for(y=0; y<s->h && y<o->h; y++)
 	{
-		p=s->pixels+s->pitch*y;
+		p=((Uint8 *) s->pixels)+s->pitch*y;
 		op[0]=o->pixels[0]+o->pitches[0]*y;
 		op[1]=o->pixels[1]+o->pitches[1]*(y/2);
 		op[2]=o->pixels[2]+o->pitches[2]*(y/2);
@@ -132,7 +132,7 @@
 	/* Convert */
 	for(y=0; y<s->h && y<o->h; y++)
 	{
-		p=s->pixels+s->pitch*y;
+		p=((Uint8 *) s->pixels)+s->pitch*y;
 		op[0]=o->pixels[0]+o->pitches[0]*y;
 		op[1]=o->pixels[1]+o->pitches[1]*(y/2);
 		op[2]=o->pixels[2]+o->pitches[2]*(y/2);
@@ -164,7 +164,7 @@
 
 	for(y=0; y<s->h && y<o->h; y++)
 	{
-		p=s->pixels+s->pitch*y;
+		p=((Uint8 *) s->pixels)+s->pitch*y;
 		op=o->pixels[0]+o->pitches[0]*y;
 		for(x=0; x<s->w && x<o->w; x++)
 		{
@@ -197,7 +197,7 @@
 
 	for(y=0; y<s->h && y<o->h; y++)
 	{
-		p=s->pixels+s->pitch*y;
+		p=((Uint8 *) s->pixels)+s->pitch*y;
 		op=o->pixels[0]+o->pitches[0]*y;
 		for(x=0; x<s->w && x<o->w; x++)
 		{
@@ -233,7 +233,7 @@
 
 	for(y=0; y<s->h && y<o->h; y++)
 	{
-		p=s->pixels+s->pitch*y;
+		p=((Uint8 *) s->pixels)+s->pitch*y;
 		op=o->pixels[0]+o->pitches[0]*y;
 		for(x=0; x<s->w && x<o->w; x++)
 		{