summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2007-11-28 01:29:19 +0000
committerTim Angus <tim@ngus.net>2007-11-28 01:29:19 +0000
commit8ae105ea923749d62c707160f87972182b00d42d (patch)
tree51abbd27a5fc57c0b593b83ead4d3871a017b91d
parentac0f597e31c7ef74796fb13f9c3a6336e315f202 (diff)
* Merge ioq3-r1220
-rw-r--r--Makefile48
-rw-r--r--src/asm/qasm.h6
-rw-r--r--src/client/cl_main.c8
-rw-r--r--src/client/snd_codec.c7
-rw-r--r--src/client/snd_codec.h2
-rw-r--r--src/client/snd_codec_ogg.c12
-rw-r--r--src/client/snd_codec_wav.c4
-rw-r--r--src/client/snd_openal.c7
-rw-r--r--src/qcommon/cvar.c2
-rw-r--r--src/qcommon/net_ip.c1
-rw-r--r--src/qcommon/q_platform.h79
-rw-r--r--src/renderer/tr_init.c106
-rw-r--r--src/sdl/sdl_glimp.c6
-rw-r--r--src/server/sv_init.c5
-rw-r--r--src/sys/con_tty.c5
-rw-r--r--src/sys/sys_local.h5
-rw-r--r--src/sys/sys_main.c30
17 files changed, 151 insertions, 182 deletions
diff --git a/Makefile b/Makefile
index f55b50d0..63526571 100644
--- a/Makefile
+++ b/Makefile
@@ -6,8 +6,8 @@
COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]')
-ifeq ($(COMPILE_PLATFORM),darwin)
- # Apple does some things a little differently...
+ifeq ($(COMPILE_PLATFORM),sunos)
+ # Solaris uname and GNU uname differ
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/)
else
COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/x86/)
@@ -632,12 +632,15 @@ else # ifeq netbsd
# SETUP AND BUILD -- IRIX
#############################################################################
-ifeq ($(PLATFORM),irix)
+ifeq ($(PLATFORM),irix64)
ARCH=mips #default to MIPS
- BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 -mips3 \
- -nostdinc -I. -I$(ROOT)/usr/include -DNO_VM_COMPILED
+ CC = c99
+ MKDIR = mkdir -p
+
+ BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 \
+ -I. $(shell sdl-config --cflags) -I$(ROOT)/usr/include -DNO_VM_COMPILED
RELEASE_CFLAGS=$(BASE_CFLAGS) -O3
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
@@ -645,8 +648,10 @@ ifeq ($(PLATFORM),irix)
SHLIBCFLAGS=
SHLIBLDFLAGS=-shared
- LDFLAGS=-ldl -lm
- CLIENT_LDFLAGS=-L/usr/X11/$(LIB) -lGL -lX11 -lXext -lm
+ LDFLAGS=-ldl -lm -lgen
+ # FIXME: The X libraries probably aren't necessary?
+ CLIENT_LDFLAGS=-L/usr/X11/$(LIB) $(shell sdl-config --libs) -lGL \
+ -lX11 -lXext -lm
else # ifeq IRIX
@@ -819,7 +824,7 @@ endef
define DO_AS
$(echo_cmd) "AS $<"
-$(Q)$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+$(Q)$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
endef
define DO_DED_CC
@@ -856,7 +861,7 @@ endif
# Create the build directories, check libraries and print out
# an informational message, then start building
-targets: makedirs libversioncheck
+targets: makedirs
@echo ""
@echo "Building Tremulous in $(B):"
@echo " PLATFORM: $(PLATFORM)"
@@ -1035,29 +1040,6 @@ $(Q3ASM): $(Q3ASMOBJ)
#############################################################################
-# LIBRARY VERSION CHECKS
-#############################################################################
-
-MINSDL_MAJOR = 1
-MINSDL_MINOR = 2
-MINSDL_PATCH = 7
-
-BASE_CFLAGS += -DMINSDL_MAJOR=$(MINSDL_MAJOR) \
- -DMINSDL_MINOR=$(MINSDL_MINOR) \
- -DMINSDL_PATCH=$(MINSDL_PATCH)
-
-libversioncheck:
- @/bin/echo -e "#include \"SDL_version.h\"\n" \
- "#if SDL_VERSION_ATLEAST(" \
- "$(MINSDL_MAJOR),$(MINSDL_MINOR),$(MINSDL_PATCH)" \
- ")\nMINSDL_PASSED\n#endif" | \
- $(CC) $(BASE_CFLAGS) -E - | grep -q MINSDL_PASSED || \
- ( /bin/echo "SDL version" \
- "$(MINSDL_MAJOR).$(MINSDL_MINOR).$(MINSDL_PATCH)" \
- "or greater required" && exit 1 )
-
-
-#############################################################################
# CLIENT/SERVER
#############################################################################
@@ -1607,6 +1589,6 @@ TOOLSOBJ_D_FILES=$(filter %.d,$(TOOLSOBJ:%.o=%.d))
-include $(OBJ_D_FILES) $(TOOLSOBJ_D_FILES)
.PHONY: all clean clean2 clean-debug clean-release copyfiles \
- debug default dist distclean libversioncheck makedirs \
+ debug default dist distclean makedirs \
release targets \
toolsclean toolsclean2 toolsclean-debug toolsclean-release
diff --git a/src/asm/qasm.h b/src/asm/qasm.h
index cd199d7c..b26e9524 100644
--- a/src/asm/qasm.h
+++ b/src/asm/qasm.h
@@ -24,15 +24,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/q_platform.h"
-#if defined(__MINGW32__) || defined(MACOS_X)
-#undef ELF
-#endif
-
#ifdef __ELF__
.section .note.GNU-stack,"",@progbits
#endif
-#ifdef ELF
+#ifdef __ELF__
#define C(label) label
#else
#define C(label) _##label
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 413a0948..a1701d77 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -37,6 +37,7 @@ cvar_t *rconAddress;
cvar_t *cl_timeout;
cvar_t *cl_maxpackets;
cvar_t *cl_packetdup;
+cvar_t *cl_master;
cvar_t *cl_timeNudge;
cvar_t *cl_showTimeDelta;
cvar_t *cl_freezeDemo;
@@ -933,6 +934,8 @@ void CL_Disconnect( qboolean showMainMenu ) {
// Stop recording any video
if( CL_VideoRecording( ) ) {
+ // Finish rendering current frame
+ SCR_UpdateScreen( );
CL_CloseAVI( );
}
CL_UpdateGUID( NULL, 0 );
@@ -2618,6 +2621,7 @@ void CL_Init( void ) {
cl_timeout = Cvar_Get ("cl_timeout", "200", 0);
+ cl_master = Cvar_Get ("cl_master", MASTER_SERVER_NAME, CVAR_ARCHIVE);
cl_timeNudge = Cvar_Get ("cl_timeNudge", "0", CVAR_TEMP );
cl_shownet = Cvar_Get ("cl_shownet", "0", CVAR_TEMP );
cl_showSend = Cvar_Get ("cl_showSend", "0", CVAR_TEMP );
@@ -3212,12 +3216,12 @@ void CL_GlobalServers_f( void ) {
// -1 is used to distinguish a "no response"
if( cls.masterNum == 1 ) {
- NET_StringToAdr( MASTER_SERVER_NAME, &to );
+ NET_StringToAdr( cl_master->string, &to );
cls.nummplayerservers = -1;
cls.pingUpdateSource = AS_MPLAYER;
}
else {
- NET_StringToAdr( MASTER_SERVER_NAME, &to );
+ NET_StringToAdr( cl_master->string, &to );
cls.numglobalservers = -1;
cls.pingUpdateSource = AS_GLOBAL;
}
diff --git a/src/client/snd_codec.c b/src/client/snd_codec.c
index 0f947551..1b680f87 100644
--- a/src/client/snd_codec.c
+++ b/src/client/snd_codec.c
@@ -227,8 +227,9 @@ snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec)
S_CodecUtilClose
=================
*/
-void S_CodecUtilClose(snd_stream_t *stream)
+void S_CodecUtilClose(snd_stream_t **stream)
{
- FS_FCloseFile(stream->file);
- Z_Free(stream);
+ FS_FCloseFile((*stream)->file);
+ Z_Free(*stream);
+ *stream = NULL;
}
diff --git a/src/client/snd_codec.h b/src/client/snd_codec.h
index 582e65ef..717ae171 100644
--- a/src/client/snd_codec.h
+++ b/src/client/snd_codec.h
@@ -78,7 +78,7 @@ int S_CodecReadStream(snd_stream_t *stream, int bytes, void *buffer);
// Util functions (used by codecs)
snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec);
-void S_CodecUtilClose(snd_stream_t *stream);
+void S_CodecUtilClose(snd_stream_t **stream);
// WAV Codec
extern snd_codec_t wav_codec;
diff --git a/src/client/snd_codec_ogg.c b/src/client/snd_codec_ogg.c
index 764bbd25..3b322b97 100644
--- a/src/client/snd_codec_ogg.c
+++ b/src/client/snd_codec_ogg.c
@@ -251,7 +251,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
vf = Z_Malloc(sizeof(OggVorbis_File));
if(!vf)
{
- S_CodecUtilClose(stream);
+ S_CodecUtilClose(&stream);
return NULL;
}
@@ -261,7 +261,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
{
Z_Free(vf);
- S_CodecUtilClose(stream);
+ S_CodecUtilClose(&stream);
return NULL;
}
@@ -273,7 +273,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
Z_Free(vf);
- S_CodecUtilClose(stream);
+ S_CodecUtilClose(&stream);
return NULL;
}
@@ -285,7 +285,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
Z_Free(vf);
- S_CodecUtilClose(stream);
+ S_CodecUtilClose(&stream);
return NULL;
}
@@ -298,7 +298,7 @@ snd_stream_t *S_OGG_CodecOpenStream(const char *filename)
Z_Free(vf);
- S_CodecUtilClose(stream);
+ S_CodecUtilClose(&stream);
return NULL;
}
@@ -343,7 +343,7 @@ void S_OGG_CodecCloseStream(snd_stream_t *stream)
Z_Free(stream->ptr);
// close the stream
- S_CodecUtilClose(stream);
+ S_CodecUtilClose(&stream);
}
/*
diff --git a/src/client/snd_codec_wav.c b/src/client/snd_codec_wav.c
index e38b360e..9c6598f6 100644
--- a/src/client/snd_codec_wav.c
+++ b/src/client/snd_codec_wav.c
@@ -256,7 +256,7 @@ snd_stream_t *S_WAV_CodecOpenStream(const char *filename)
// Read the RIFF header
if(!S_ReadRIFFHeader(rv->file, &rv->info))
{
- S_CodecUtilClose(rv);
+ S_CodecUtilClose(&rv);
return NULL;
}
@@ -270,7 +270,7 @@ S_WAV_CodecCloseStream
*/
void S_WAV_CodecCloseStream(snd_stream_t *stream)
{
- S_CodecUtilClose(stream);
+ S_CodecUtilClose(&stream);
}
/*
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index d8ad48c8..0bda7a1a 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -1843,13 +1843,6 @@ void S_AL_Shutdown( void )
S_AL_SrcShutdown( );
S_AL_BufferShutdown( );
- // Check for Linux shutdown race condition
- // FIXME: this will probably not be necessary once OpenAL CVS
- // from 11/11/05 is released and prevelant
- if( Q_stricmp((const char*)qalGetString( AL_VENDOR ), "J. Valenzuela" ) ) {
- qalcMakeContextCurrent( NULL );
- }
-
qalcDestroyContext(alContext);
qalcCloseDevice(alDevice);
diff --git a/src/qcommon/cvar.c b/src/qcommon/cvar.c
index 5503bcc1..f4f0b489 100644
--- a/src/qcommon/cvar.c
+++ b/src/qcommon/cvar.c
@@ -285,6 +285,8 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) {
cvar_vars = var;
var->flags = flags;
+ // note what types of cvars have been modified (userinfo, archive, serverinfo, systeminfo)
+ cvar_modifiedFlags |= var->flags;
hash = generateHashValue(var_name);
var->hashNext = hashTable[hash];
diff --git a/src/qcommon/net_ip.c b/src/qcommon/net_ip.c
index 258a6cba..abff7313 100644
--- a/src/qcommon/net_ip.c
+++ b/src/qcommon/net_ip.c
@@ -50,6 +50,7 @@ static qboolean winsockInitialized = qfalse;
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
+#include <sys/time.h>
#include <unistd.h>
#ifdef MACOS_X
diff --git a/src/qcommon/q_platform.h b/src/qcommon/q_platform.h
index 9d0d6dd3..e6f50eef 100644
--- a/src/qcommon/q_platform.h
+++ b/src/qcommon/q_platform.h
@@ -20,7 +20,7 @@ along with Tremulous; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-//
+
#ifndef __Q_PLATFORM_H
#define __Q_PLATFORM_H
@@ -169,73 +169,28 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
-//=============================================================== FreeBSD ===
+//=================================================================== BSD ===
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#include <sys/types.h>
#include <machine/endian.h>
+#if defined(__FreeBSD__)
#define OS_STRING "freebsd"
-#define ID_INLINE inline
-#define PATH_SEP '/'
-
-#ifdef __i386__
-#define ARCH_STRING "x86"
-#elif defined __axp__
-#define ARCH_STRING "alpha"
-#endif
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define Q3_BIG_ENDIAN
-#else
-#define Q3_LITTLE_ENDIAN
-#endif
-
-#define DLL_EXT ".so"
-
-#endif
-
-//=============================================================== OpenBSD ===
-
-#ifdef __OpenBSD__
-
-#include <sys/types.h>
-#include <machine/endian.h>
-
+#elif defined(__OpenBSD__)
#define OS_STRING "openbsd"
-#define ID_INLINE inline
-#define PATH_SEP '/'
-
-#ifdef __i386__
-#define ARCH_STRING "i386"
-#endif
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define Q3_BIG_ENDIAN
-#else
-#define Q3_LITTLE_ENDIAN
-#endif
-
-#define DLL_EXT ".so"
-
+#elif defined(__NetBSD__)
+#define OS_STRING "netbsd"
#endif
-//================================================================ NetBSD ===
-
-// This is very much like the FreeBSD one and can probably be merged
-#ifdef __NetBSD__
-
-#include <sys/types.h>
-#include <machine/endian.h>
-
-#define OS_STRING "netbsd"
#define ID_INLINE inline
#define PATH_SEP '/'
#ifdef __i386__
#define ARCH_STRING "x86"
-// Netbsd has alot of platforms
+#elif defined __axp__
+#define ARCH_STRING "alpha"
#endif
#if BYTE_ORDER == BIG_ENDIAN
@@ -275,6 +230,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
+//================================================================== IRIX ===
+
+#ifdef __sgi
+
+#define OS_STRING "irix"
+#define ID_INLINE __inline
+#define PATH_SEP '/'
+
+#define ARCH_STRING "mips"
+
+#define Q3_BIG_ENDIAN // SGI's MIPS are always big endian
+
+#define DLL_EXT ".so"
+
+#endif
+
//================================================================== Q3VM ===
#ifdef Q3_VM
diff --git a/src/renderer/tr_init.c b/src/renderer/tr_init.c
index 1f3d19dc..534dec3a 100644
--- a/src/renderer/tr_init.c
+++ b/src/renderer/tr_init.c
@@ -323,41 +323,41 @@ GL_CheckErrors
==================
*/
void GL_CheckErrors( void ) {
- int err;
- char s[64];
-
- err = qglGetError();
- if ( err == GL_NO_ERROR ) {
- return;
- }
- if ( r_ignoreGLErrors->integer ) {
- return;
- }
- switch( err ) {
- case GL_INVALID_ENUM:
- strcpy( s, "GL_INVALID_ENUM" );
- break;
- case GL_INVALID_VALUE:
- strcpy( s, "GL_INVALID_VALUE" );
- break;
- case GL_INVALID_OPERATION:
- strcpy( s, "GL_INVALID_OPERATION" );
- break;
- case GL_STACK_OVERFLOW:
- strcpy( s, "GL_STACK_OVERFLOW" );
- break;
- case GL_STACK_UNDERFLOW:
- strcpy( s, "GL_STACK_UNDERFLOW" );
- break;
- case GL_OUT_OF_MEMORY:
- strcpy( s, "GL_OUT_OF_MEMORY" );
- break;
- default:
- Com_sprintf( s, sizeof(s), "%i", err);
- break;
- }
-
- ri.Error( ERR_FATAL, "GL_CheckErrors: %s", s );
+ int err;
+ char s[64];
+
+ err = qglGetError();
+ if ( err == GL_NO_ERROR ) {
+ return;
+ }
+ if ( r_ignoreGLErrors->integer ) {
+ return;
+ }
+ switch( err ) {
+ case GL_INVALID_ENUM:
+ strcpy( s, "GL_INVALID_ENUM" );
+ break;
+ case GL_INVALID_VALUE:
+ strcpy( s, "GL_INVALID_VALUE" );
+ break;
+ case GL_INVALID_OPERATION:
+ strcpy( s, "GL_INVALID_OPERATION" );
+ break;
+ case GL_STACK_OVERFLOW:
+ strcpy( s, "GL_STACK_OVERFLOW" );
+ break;
+ case GL_STACK_UNDERFLOW:
+ strcpy( s, "GL_STACK_UNDERFLOW" );
+ break;
+ case GL_OUT_OF_MEMORY:
+ strcpy( s, "GL_OUT_OF_MEMORY" );
+ break;
+ default:
+ Com_sprintf( s, sizeof(s), "%i", err);
+ break;
+ }
+
+ ri.Error( ERR_FATAL, "GL_CheckErrors: %s", s );
}
@@ -366,25 +366,25 @@ void GL_CheckErrors( void ) {
*/
typedef struct vidmode_s
{
- const char *description;
- int width, height;
- float pixelAspect; // pixel width / height
+ const char *description;
+ int width, height;
+ float pixelAspect; // pixel width / height
} vidmode_t;
vidmode_t r_vidModes[] =
{
- { "Mode 0: 320x240", 320, 240, 1 },
- { "Mode 1: 400x300", 400, 300, 1 },
- { "Mode 2: 512x384", 512, 384, 1 },
- { "Mode 3: 640x480", 640, 480, 1 },
- { "Mode 4: 800x600", 800, 600, 1 },
- { "Mode 5: 960x720", 960, 720, 1 },
- { "Mode 6: 1024x768", 1024, 768, 1 },
- { "Mode 7: 1152x864", 1152, 864, 1 },
- { "Mode 8: 1280x1024", 1280, 1024, 1 },
- { "Mode 9: 1600x1200", 1600, 1200, 1 },
- { "Mode 10: 2048x1536", 2048, 1536, 1 },
- { "Mode 11: 856x480 (wide)",856, 480, 1 }
+ { "Mode 0: 320x240", 320, 240, 1 },
+ { "Mode 1: 400x300", 400, 300, 1 },
+ { "Mode 2: 512x384", 512, 384, 1 },
+ { "Mode 3: 640x480", 640, 480, 1 },
+ { "Mode 4: 800x600", 800, 600, 1 },
+ { "Mode 5: 960x720", 960, 720, 1 },
+ { "Mode 6: 1024x768", 1024, 768, 1 },
+ { "Mode 7: 1152x864", 1152, 864, 1 },
+ { "Mode 8: 1280x1024", 1280, 1024, 1 },
+ { "Mode 9: 1600x1200", 1600, 1200, 1 },
+ { "Mode 10: 2048x1536", 2048, 1536, 1 },
+ { "Mode 11: 856x480 (wide)",856, 480, 1 }
};
static int s_numVidModes = ( sizeof( r_vidModes ) / sizeof( r_vidModes[0] ) );
@@ -392,8 +392,8 @@ qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
vidmode_t *vm;
float pixelAspect;
- if ( mode < -1 ) {
- return qfalse;
+ if ( mode < -1 ) {
+ return qfalse;
}
if ( mode >= s_numVidModes ) {
return qfalse;
@@ -403,7 +403,7 @@ qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
*width = r_customwidth->integer;
*height = r_customheight->integer;
pixelAspect = r_customPixelAspect->value;
- } else {
+ } else {
vm = &r_vidModes[mode];
*width = vm->width;
diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c
index cb3e8e0d..347505b8 100644
--- a/src/sdl/sdl_glimp.c
+++ b/src/sdl/sdl_glimp.c
@@ -396,9 +396,9 @@ static void GLimp_InitExtensions( void )
{
if ( r_ext_multitexture->value )
{
- qglMultiTexCoord2fARB = ( PFNGLMULTITEXCOORD2FARBPROC ) SDL_GL_GetProcAddress( "glMultiTexCoord2fARB" );
- qglActiveTextureARB = ( PFNGLACTIVETEXTUREARBPROC ) SDL_GL_GetProcAddress( "glActiveTextureARB" );
- qglClientActiveTextureARB = ( PFNGLCLIENTACTIVETEXTUREARBPROC ) SDL_GL_GetProcAddress( "glClientActiveTextureARB" );
+ qglMultiTexCoord2fARB = SDL_GL_GetProcAddress( "glMultiTexCoord2fARB" );
+ qglActiveTextureARB = SDL_GL_GetProcAddress( "glActiveTextureARB" );
+ qglClientActiveTextureARB = SDL_GL_GetProcAddress( "glClientActiveTextureARB" );
if ( qglActiveTextureARB )
{
diff --git a/src/server/sv_init.c b/src/server/sv_init.c
index 1496f776..4a7e292a 100644
--- a/src/server/sv_init.c
+++ b/src/server/sv_init.c
@@ -281,6 +281,11 @@ void SV_Startup( void ) {
}
svs.initialized = qtrue;
+ // Don't respect sv_killserver unless a server is actually running
+ if ( sv_killserver->integer ) {
+ Cvar_Set( "sv_killserver", "0" );
+ }
+
Cvar_Set( "sv_running", "1" );
}
diff --git a/src/sys/con_tty.c b/src/sys/con_tty.c
index 06dcc166..f128b0d7 100644
--- a/src/sys/con_tty.c
+++ b/src/sys/con_tty.c
@@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <signal.h>
#include <termios.h>
#include <fcntl.h>
+#include <sys/time.h>
/*
=============================================================
@@ -169,7 +170,7 @@ void CON_Shutdown( void )
}
// Restore blocking to stdin reads
- fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~O_NDELAY );
+ fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) & ~O_NONBLOCK );
}
/*
@@ -257,7 +258,7 @@ void CON_Init( void )
signal(SIGTTOU, SIG_IGN);
// Make stdin reads non-blocking
- fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) | O_NDELAY );
+ fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) | O_NONBLOCK );
if (isatty(STDIN_FILENO)!=1)
{
diff --git a/src/sys/sys_local.h b/src/sys/sys_local.h
index f2a4dddc..60c7e63a 100644
--- a/src/sys/sys_local.h
+++ b/src/sys/sys_local.h
@@ -23,6 +23,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/q_shared.h"
#include "../qcommon/qcommon.h"
+// Require a minimum version of SDL
+#define MINSDL_MAJOR 1
+#define MINSDL_MINOR 2
+#define MINSDL_PATCH 7
+
// Input subsystem
void IN_Init (void);
void IN_Frame (void);
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index 32c55e37..512c43b8 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -587,21 +587,29 @@ int main( int argc, char **argv )
char commandLine[ MAX_STRING_CHARS ] = { 0 };
#ifndef DEDICATED
- const SDL_version *ver = SDL_Linked_Version( );
+ // SDL version check
+
+ // Compile time
+# if !SDL_VERSION_ATLEAST(MINSDL_MAJOR,MINSDL_MINOR,MINSDL_PATCH)
+# error A more recent version of SDL is required
+# endif
+
+ // Run time
+ const SDL_version *ver = SDL_Linked_Version( );
#define STRING(s) #s
#define XSTRING(s) STRING(s)
#define MINSDL_VERSION \
- XSTRING(MINSDL_MAJOR) "." \
- XSTRING(MINSDL_MINOR) "." \
- XSTRING(MINSDL_PATCH)
-
- if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) <
- SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
- {
- Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" );
- Sys_Exit( 1 );
- }
+ XSTRING(MINSDL_MAJOR) "." \
+ XSTRING(MINSDL_MINOR) "." \
+ XSTRING(MINSDL_PATCH)
+
+ if( SDL_VERSIONNUM( ver->major, ver->minor, ver->patch ) <
+ SDL_VERSIONNUM( MINSDL_MAJOR, MINSDL_MINOR, MINSDL_PATCH ) )
+ {
+ Sys_Print( "SDL version " MINSDL_VERSION " or greater required\n" );
+ Sys_Exit( 1 );
+ }
#endif
Sys_ParseArgs( argc, argv );