]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
- DP now defines MACOSX when relevant
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 3 Dec 2004 08:32:08 +0000 (08:32 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 3 Dec 2004 08:32:08 +0000 (08:32 +0000)
- added a "Mac OS X" string in Sys_Shared_EarlyInit
- removed an unused "rcsid" string
- fixed SDL audio on big endian systems
- fixed SDL video initialization on Mac OS X

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4822 d7cf8633-e32d-0410-b094-e92efae38249

common.h
keys.c
snd_sdl.c
sys_shared.c
vid_sdl.c

index 9da99680cc2399cbdb46734f24fee0c655351bf1..aa2d29d5b804b1648cd2540316ce569ae469a714 100644 (file)
--- a/common.h
+++ b/common.h
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #ifndef COMMON_H
 #define COMMON_H
 
+
 // MSVC has a different name for several standard functions
 #ifdef WIN32
 # define snprintf _snprintf
@@ -29,6 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # define strncasecmp strnicmp
 #endif
 
+// Create our own define for Mac OS X
+#if defined(__APPLE__) && defined(__MACH__)
+# define MACOSX
+#endif
+
 
 //============================================================================
 
@@ -229,7 +235,7 @@ char *SearchInfostring(const char *infostring, const char *key);
 
 // strlcat and strlcpy, from OpenBSD
 // Most (all?) BSDs already have them
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__))
+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(MACOSX)
 # define HAVE_STRLCAT 1
 # define HAVE_STRLCPY 1
 #endif
diff --git a/keys.c b/keys.c
index dd9e182e551de796acf3972e657af82b9f1dfe98..b12bd2c95ea78b08d01007a07f0a423056a69c9c 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1,6 +1,4 @@
 /*
-       $RCSfile$
-
        Copyright (C) 1996-1997  Id Software, Inc.
 
        This program is free software; you can redistribute it and/or
                Free Software Foundation, Inc.
                59 Temple Place - Suite 330
                Boston, MA  02111-1307, USA
-
 */
-static const char rcsid[] =
-    "$Id$";
 
 #include "quakedef.h"
 #include <ctype.h>
index de0f3dc9a2cc222d1ecf8289f8dadf92f841440b..38fb20531a896af68c3432414e07191e7e6b1c56 100644 (file)
--- a/snd_sdl.c
+++ b/snd_sdl.c
@@ -118,7 +118,7 @@ qboolean SNDDMA_Init(void)
        // Init the SDL Audio subsystem
        spec.callback = Buffer_Callback;
        spec.channels = shm->format.channels;
-       spec.format = AUDIO_S16LSB;
+       spec.format = AUDIO_S16SYS;
        spec.freq = shm->format.speed;
        spec.userdata = NULL;
        spec.samples = AUDIO_SDL_SAMPLES; 
index 9bebbde3175b270ae217aec611f190061beb93f5..28529c596d625d3c7c8838e728f564dede386201 100644 (file)
@@ -48,6 +48,8 @@ void Sys_Shared_EarlyInit(void)
        os = "NetBSD";
 #elif defined(__OpenBSD__)
        os = "OpenBSD";
+#elif defined(MACOSX)
+       os = "Mac OS X";
 #else
        os = "Unknown";
 #endif
index ce9f0f6eb4e3f97d1a756ba5701dc64b39f84967..0961a199c138f3f255366b492454f55154fa998e 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -378,7 +378,9 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
                We cant switch from one OpenGL video mode to another.
                Thus we first switch to some stupid 2D mode and then back to OpenGL.
        */
+#ifndef MACOSX
        SDL_SetVideoMode( 0, 0, 0, 0 );
+#endif
 
        // SDL usually knows best
        drivername = NULL;
@@ -387,9 +389,9 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
        i = COM_CheckParm("-gl_driver");
        if (i && i < com_argc - 1)
                drivername = com_argv[i + 1];
-       if (SDL_GL_LoadLibrary(drivername))
+       if (SDL_GL_LoadLibrary(drivername) < 0)
        {   
-               Con_Printf("Unable to load GL driver \"%s\": ", drivername, SDL_GetError());
+               Con_Printf("Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
                return false;
        }