- 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
#ifndef COMMON_H
#define COMMON_H
+
// MSVC has a different name for several standard functions
#ifdef WIN32
# define snprintf _snprintf
# define strncasecmp strnicmp
#endif
+// Create our own define for Mac OS X
+#if defined(__APPLE__) && defined(__MACH__)
+# define MACOSX
+#endif
+
//============================================================================
// 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
/*
- $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>
// 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;
os = "NetBSD";
#elif defined(__OpenBSD__)
os = "OpenBSD";
+#elif defined(MACOSX)
+ os = "Mac OS X";
#else
os = "Unknown";
#endif
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;
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;
}