ioquake3 resync to revision 2398 from 2369.

This is the last ioquake3 revision before ioquake3 changed from subversion to git at the beginning of 2013.

#5808 - Include and use .glsl in source (rend2)
#5812 - Use refdef's coordinates when drawing to screen shadow fbo, and separate depth texture and screen texture coordinates in glsl shaders.
Include Rend2 renderer in MacOSX bundle
Include OpenGL1 and Rend2 renderers in MacOSX UB
Include Rend2 renderer in NSIS installer.
Include OpenGL1 and Rend2 renderers in Loki Setup Installer.
Have NSIS uninstaller delete rend2.
Split light sample into direct and ambient parts when using deluxemaps or per-vertex light vectors.  Fixes #5813.
Fix writting voip data in demos (broke in r2102).
Fix server ignoring client move commands if voip data is included.
Allow changing cl_voip without restarting.
Fix assert failing in CL_ParseVoip() while flipping cl_voip off and on.
Only declare var_SampleToView in lightall shader when it is actually used.
Fix a couple files not ending with a newline.
Fix clients being able to reset their player state and respawn using donedl.
Fix passing arg9 (qvm only), arg10, and arg11 to vmMain for native libs and non-i386 compiled or interpated qvms. (Currently they aren't use in vmMain in game, cgame, or ui.)
Fix passing args[11] to args[15] from vm to engine on ppc64 and sparc64. Some of the args are used by game bot prediction syscalls. May have been causing bugs. Note: This was fixed for x86_64 in r2163.
Fix reconnect command to work after leaving server. (#5794)
Fix dedicated server crashing when using MSG_ReadDelta*, though it only happens if someone modifies the engine. (#5449)
Makefile fixes for OpenBSD by Jonathan Gray. (#5728)
Save all arguments from connect for reconnect command.
Remove unnecessary localhost check from reconnect command.
Support r_srgb even without hardware support.  Also tweak default autoexposure/tonemap settings to look good on both r_srgb 0 and 1.
Changed the MacOS-X build system to make UB's containing i386 and x86_64 arches and made make-macosx.sh not build UB's but only standard binaries
Fix spectator client being switched from follow to free after map_restart if following a client with a higher client number.
Fix client unlinking issue caused by ent->s.number being set to followed client's ps->clientNum after map_restart. Reported by Ensiform.
Changes from Ensiform:
- In G_AddBot, try to allocate clientNum before doing anything else.
- In G_AddBot, don't set SVF_BOT and inuse. It's done in ClientConnect, plus inuse causes ClientDisconnect to be run for no reason.
- In G_AddBot, only set skill in bot useinfo once.
- Avoid using cl->ps.clientNum to check if cl is a bot.
Fix bot skill format so it doesn't always have a space at the beginning of it.
More fixes to the macosx buildsystem.  This removes the SDL Framework and makes use of a SDL library that is position independant.  This also brings back PPC builds into the UB and also as a standa alone build choice.
Have make-macosx.sh require the user to specify which architecture she/he wants to build for and suggest building UB's if the user is unaware of what architectures are
Lets list all the valid options.
This commit is contained in:
zturtleman 2017-07-09 21:21:12 +00:00
parent 5f97bc3e27
commit 6afd8f13d2
33 changed files with 432 additions and 1242 deletions

View file

@ -63,7 +63,7 @@ ifndef BUILD_DEFINES
endif
# ioquake3 svn version that this is based on
IOQ3_REVISION = 2369
IOQ3_REVISION = 2398
#############################################################################
#
@ -414,7 +414,7 @@ else # ifeq Linux
ifeq ($(PLATFORM),darwin)
HAVE_VM_COMPILED=true
LIBS = -framework Cocoa -framework SDL
LIBS = -framework Cocoa
CLIENT_LIBS=
RENDERER_LIBS=
OPTIMIZEVM=
@ -471,8 +471,8 @@ ifeq ($(PLATFORM),darwin)
LIBSDLMAIN=$(B)/libSDLmain.a
LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a
CLIENT_LIBS += -framework IOKit \
-framework SDL
RENDERER_LIBS += -framework OpenGL -framework SDL
$(LIBSDIR)/macosx/libSDL-1.2.0.dylib
RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL-1.2.0.dylib
OPTIMIZEVM += -falign-loops=16
OPTIMIZE = $(OPTIMIZEVM) -ffast-math
@ -683,8 +683,10 @@ ifeq ($(PLATFORM),openbsd)
USE_CURL_DLOPEN=0
endif
# no shm_open on OpenBSD
USE_MUMBLE=0
SHLIBEXT=so
SHLIBNAME=.$(SHLIBEXT)
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS)
@ -1043,6 +1045,14 @@ $(echo_cmd) "REF_CC $<"
$(Q)$(CC) $(SHLIBCFLAGS) $(CFLAGS) $(CLIENT_CFLAGS) $(OPTIMIZE) -o $@ -c $<
endef
define DO_REF_STR
$(echo_cmd) "REF_STR $<"
$(Q)rm -f $@
$(Q)echo "const char *fallbackShader_$(notdir $(basename $<)) =" >> $@
$(Q)cat $< | sed 's/^/\"/;s/$$/\\n\"/' >> $@
$(Q)echo ";" >> $@
endef
define DO_SMP_CC
$(echo_cmd) "SMP_CC $<"
$(Q)$(CC) $(SHLIBCFLAGS) $(CFLAGS) $(CLIENT_CFLAGS) $(OPTIMIZE) -DSMP -o $@ -c $<
@ -1209,6 +1219,7 @@ makedirs:
@if [ ! -d $(B)/client ];then $(MKDIR) $(B)/client;fi
@if [ ! -d $(B)/renderer ];then $(MKDIR) $(B)/renderer;fi
@if [ ! -d $(B)/rend2 ];then $(MKDIR) $(B)/rend2;fi
@if [ ! -d $(B)/rend2/glsl ];then $(MKDIR) $(B)/rend2/glsl;fi
@if [ ! -d $(B)/renderersmp ];then $(MKDIR) $(B)/renderersmp;fi
@if [ ! -d $(B)/ded ];then $(MKDIR) $(B)/ded;fi
@if [ ! -d $(B)/$(BASEGAME) ];then $(MKDIR) $(B)/$(BASEGAME);fi
@ -1552,6 +1563,36 @@ Q3R2OBJ = \
$(B)/rend2/tr_world.o \
\
$(B)/renderer/sdl_gamma.o
Q3R2STRINGOBJ = \
$(B)/rend2/glsl/bokeh_fp.o \
$(B)/rend2/glsl/bokeh_vp.o \
$(B)/rend2/glsl/calclevels4x_fp.o \
$(B)/rend2/glsl/calclevels4x_vp.o \
$(B)/rend2/glsl/depthblur_fp.o \
$(B)/rend2/glsl/depthblur_vp.o \
$(B)/rend2/glsl/dlight_fp.o \
$(B)/rend2/glsl/dlight_vp.o \
$(B)/rend2/glsl/down4x_fp.o \
$(B)/rend2/glsl/down4x_vp.o \
$(B)/rend2/glsl/fogpass_fp.o \
$(B)/rend2/glsl/fogpass_vp.o \
$(B)/rend2/glsl/generic_fp.o \
$(B)/rend2/glsl/generic_vp.o \
$(B)/rend2/glsl/lightall_fp.o \
$(B)/rend2/glsl/lightall_vp.o \
$(B)/rend2/glsl/pshadow_fp.o \
$(B)/rend2/glsl/pshadow_vp.o \
$(B)/rend2/glsl/shadowfill_fp.o \
$(B)/rend2/glsl/shadowfill_vp.o \
$(B)/rend2/glsl/shadowmask_fp.o \
$(B)/rend2/glsl/shadowmask_vp.o \
$(B)/rend2/glsl/ssao_fp.o \
$(B)/rend2/glsl/ssao_vp.o \
$(B)/rend2/glsl/texturecolor_fp.o \
$(B)/rend2/glsl/texturecolor_vp.o \
$(B)/rend2/glsl/tonemap_fp.o \
$(B)/rend2/glsl/tonemap_vp.o
Q3ROBJ = \
$(B)/renderer/tr_animation.o \
@ -1828,14 +1869,14 @@ $(B)/renderer_opengl1_smp_$(SHLIBNAME): $(Q3ROBJ) $(Q3RPOBJ_SMP) $(JPGOBJ)
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3ROBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) \
$(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS)
$(B)/renderer_rend2_$(SHLIBNAME): $(Q3R2OBJ) $(Q3RPOBJ_UP) $(JPGOBJ)
$(B)/renderer_rend2_$(SHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_UP) $(JPGOBJ)
$(echo_cmd) "LD $@"
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3RPOBJ_UP) $(JPGOBJ) \
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_UP) $(JPGOBJ) \
$(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS)
$(B)/renderer_rend2_smp_$(SHLIBNAME): $(Q3R2OBJ) $(Q3RPOBJ_SMP) $(JPGOBJ)
$(B)/renderer_rend2_smp_$(SHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_SMP) $(JPGOBJ)
$(echo_cmd) "LD $@"
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) \
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) \
$(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS)
else
@ -1851,16 +1892,16 @@ $(B)/$(CLIENTBIN)-smp$(FULLBINEXT): $(Q3OBJ) $(Q3ROBJ) $(Q3RPOBJ_SMP) $(JPGOBJ)
-o $@ $(Q3OBJ) $(Q3ROBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) \
$(THREAD_LIBS) $(LIBSDLMAIN) $(CLIENT_LIBS) $(RENDERER_LIBS) $(LIBS)
$(B)/$(CLIENTBIN)_rend2$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3RPOBJ_UP) $(JPGOBJ) $(LIBSDLMAIN)
$(B)/$(CLIENTBIN)_rend2$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_UP) $(JPGOBJ) $(LIBSDLMAIN)
$(echo_cmd) "LD $@"
$(Q)$(CC) $(CLIENT_CFLAGS) $(CFLAGS) $(CLIENT_LDFLAGS) $(LDFLAGS) \
-o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3RPOBJ_UP) $(JPGOBJ) \
-o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_UP) $(JPGOBJ) \
$(LIBSDLMAIN) $(CLIENT_LIBS) $(RENDERER_LIBS) $(LIBS)
$(B)/$(CLIENTBIN)_rend2-smp$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) $(LIBSDLMAIN)
$(B)/$(CLIENTBIN)_rend2-smp$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) $(LIBSDLMAIN)
$(echo_cmd) "LD $@"
$(Q)$(CC) $(CLIENT_CFLAGS) $(CFLAGS) $(CLIENT_LDFLAGS) $(LDFLAGS) $(THREAD_LDFLAGS) \
-o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) \
-o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(Q3RPOBJ_SMP) $(JPGOBJ) \
$(THREAD_LIBS) $(LIBSDLMAIN) $(CLIENT_LIBS) $(RENDERER_LIBS) $(LIBS)
endif
@ -2430,7 +2471,13 @@ $(B)/renderer/%.o: $(JPDIR)/%.c
$(B)/renderer/%.o: $(RDIR)/%.c
$(DO_REF_CC)
$(B)/rend2/glsl/%.c: $(R2DIR)/glsl/%.glsl
$(DO_REF_STR)
$(B)/rend2/glsl/%.o: $(B)/rend2/glsl/%.c
$(DO_REF_CC)
$(B)/rend2/%.o: $(R2DIR)/%.c
$(DO_REF_CC)
@ -2562,6 +2609,7 @@ OBJ = $(Q3OBJ) $(Q3ROBJ) $(Q3R2OBJ) $(Q3RPOBJ_UP) $(Q3RPOBJ_SMP) $(Q3DOBJ) $(JPG
$(MPGOBJ) $(Q3GOBJ) $(Q3CGOBJ) $(MPCGOBJ) $(Q3UIOBJ) $(MPUIOBJ) \
$(MPGVMOBJ) $(Q3GVMOBJ) $(Q3CGVMOBJ) $(MPCGVMOBJ) $(Q3UIVMOBJ) $(MPUIVMOBJ)
TOOLSOBJ = $(LBURGOBJ) $(Q3CPPOBJ) $(Q3RCCOBJ) $(Q3LCCOBJ) $(Q3ASMOBJ)
STRINGOBJ = $(Q3R2STRINGOBJ)
copyfiles: release
@ -2636,6 +2684,7 @@ clean2:
@echo "CLEAN $(B)"
@rm -f $(OBJ)
@rm -f $(OBJ_D_FILES)
@rm -f $(STRINGOBJ)
@rm -f $(TARGETS)
toolsclean: toolsclean-debug toolsclean-release

View file

@ -815,6 +815,7 @@ void CL_WritePacket( void ) {
MSG_WriteLong (&fakemsg, clc.voipOutgoingSequence);
MSG_WriteByte (&fakemsg, clc.voipOutgoingDataFrames);
MSG_WriteShort (&fakemsg, clc.voipOutgoingDataSize );
MSG_WriteBits (&fakemsg, clc.voipFlags, VOIP_FLAGCNT);
MSG_WriteData (&fakemsg, clc.voipOutgoingData, voipSize);
MSG_WriteByte (&fakemsg, svc_EOF);
CL_WriteDemoMessage (&fakemsg, 0);

View file

@ -120,11 +120,14 @@ cvar_t *cl_guidServerUniq;
cvar_t *cl_consoleKeys;
cvar_t *cl_rate;
clientActive_t cl;
clientConnection_t clc;
clientStatic_t cls;
vm_t *cgvm;
char cl_reconnectArgs[MAX_OSPATH];
char cl_oldGame[MAX_QPATH];
qboolean cl_oldGameSet;
@ -411,6 +414,22 @@ void CL_CaptureVoip(void)
return;
#endif
// If your data rate is too low, you'll get Connection Interrupted warnings
// when VoIP packets arrive, even if you have a broadband connection.
// This might work on rates lower than 25000, but for safety's sake, we'll
// just demand it. Who doesn't have at least a DSL line now, anyhow? If
// you don't, you don't need VoIP. :)
if (cl_voip->modified || cl_rate->modified) {
if ((cl_voip->integer) && (cl_rate->integer < 25000)) {
Com_Printf(S_COLOR_YELLOW "Your network rate is too slow for VoIP.\n");
Com_Printf("Set 'Data Rate' to 'LAN/Cable/xDSL' in 'Setup/System/Network'.\n");
Com_Printf("Until then, VoIP is disabled.\n");
Cvar_Set("cl_voip", "0");
}
cl_voip->modified = qfalse;
cl_rate->modified = qfalse;
}
if (!clc.speexInitialized)
return; // just in case this gets called at a bad time.
@ -1670,12 +1689,10 @@ CL_Reconnect_f
================
*/
void CL_Reconnect_f( void ) {
if ( !strlen( clc.servername ) || !strcmp( clc.servername, "localhost" ) ) {
Com_Printf( "Can't reconnect to localhost.\n" );
if ( !strlen( cl_reconnectArgs ) )
return;
}
Cvar_Set("ui_singlePlayerActive", "0");
Cbuf_AddText( va("connect %s\n", clc.servername ) );
Cbuf_AddText( va("connect %s\n", cl_reconnectArgs ) );
}
/*
@ -1709,6 +1726,9 @@ void CL_Connect_f( void ) {
server = Cmd_Argv(2);
}
// save arguments for reconnect
Q_strncpyz( cl_reconnectArgs, Cmd_Args(), sizeof( cl_reconnectArgs ) );
Cvar_Set("ui_singlePlayerActive", "0");
// fire a message off to the motd server
@ -3508,7 +3528,7 @@ void CL_Init( void ) {
// userinfo
Cvar_Get ("name", "UnnamedPlayer", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
cl_rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("model", "sarge", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("headmodel", "sarge", CVAR_USERINFO | CVAR_ARCHIVE );
@ -3541,20 +3561,8 @@ void CL_Init( void ) {
cl_voipShowMeter = Cvar_Get ("cl_voipShowMeter", "1", CVAR_ARCHIVE);
// This is a protocol version number.
cl_voip = Cvar_Get ("cl_voip", "1", CVAR_USERINFO | CVAR_ARCHIVE | CVAR_LATCH);
cl_voip = Cvar_Get ("cl_voip", "1", CVAR_USERINFO | CVAR_ARCHIVE);
Cvar_CheckRange( cl_voip, 0, 1, qtrue );
// If your data rate is too low, you'll get Connection Interrupted warnings
// when VoIP packets arrive, even if you have a broadband connection.
// This might work on rates lower than 25000, but for safety's sake, we'll
// just demand it. Who doesn't have at least a DSL line now, anyhow? If
// you don't, you don't need VoIP. :)
if ((cl_voip->integer) && (Cvar_VariableIntegerValue("rate") < 25000)) {
Com_Printf(S_COLOR_YELLOW "Your network rate is too slow for VoIP.\n");
Com_Printf("Set 'Data Rate' to 'LAN/Cable/xDSL' in 'Setup/System/Network' and restart.\n");
Com_Printf("Until then, VoIP is disabled.\n");
Cvar_Set("cl_voip", "0");
}
#endif

View file

@ -769,7 +769,7 @@ void CL_ParseVoip ( msg_t *msg ) {
// reset the bits just in case.
speex_bits_reset(&clc.speexDecoderBits[sender]);
seqdiff = 0;
} else if (seqdiff > 100) { // more than 2 seconds of audio dropped?
} else if (seqdiff * clc.speexFrameSize * 2 >= sizeof (decoded)) { // dropped more than we can handle?
// just start over.
Com_DPrintf("VoIP: Dropped way too many (%d) frames from client #%d\n",
seqdiff, sender);

View file

@ -253,7 +253,7 @@ void G_AddRandomBot( int team ) {
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
if ( !(g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT) ) {
if ( !(g_entities[i].r.svFlags & SVF_BOT) ) {
continue;
}
if ( team >= 0 && cl->sess.sessionTeam != team ) {
@ -276,7 +276,7 @@ void G_AddRandomBot( int team ) {
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
if ( !(g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT) ) {
if ( !(g_entities[i].r.svFlags & SVF_BOT) ) {
continue;
}
if ( team >= 0 && cl->sess.sessionTeam != team ) {
@ -310,7 +310,6 @@ G_RemoveRandomBot
*/
int G_RemoveRandomBot( int team ) {
int i;
char netname[36];
gclient_t *cl;
for ( i=0 ; i< g_maxclients.integer ; i++ ) {
@ -318,15 +317,13 @@ int G_RemoveRandomBot( int team ) {
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
if ( !(g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT) ) {
if ( !(g_entities[i].r.svFlags & SVF_BOT) ) {
continue;
}
if ( team >= 0 && cl->sess.sessionTeam != team ) {
continue;
}
strcpy(netname, cl->pers.netname);
Q_CleanStr(netname);
trap_SendConsoleCommand( EXEC_INSERT, va("kick %s\n", netname) );
trap_SendConsoleCommand( EXEC_INSERT, va("clientkick %d\n", i) );
return qtrue;
}
return qfalse;
@ -347,7 +344,7 @@ int G_CountHumanPlayers( int team ) {
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
if ( g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT ) {
if ( g_entities[i].r.svFlags & SVF_BOT ) {
continue;
}
if ( team >= 0 && cl->sess.sessionTeam != team ) {
@ -373,7 +370,7 @@ int G_CountBotPlayers( int team ) {
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
if ( !(g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT) ) {
if ( !(g_entities[i].r.svFlags & SVF_BOT) ) {
continue;
}
if ( team >= 0 && cl->sess.sessionTeam != team ) {
@ -575,7 +572,6 @@ G_AddBot
static void G_AddBot( const char *name, float skill, const char *team, int delay, char *altname) {
int clientNum;
char *botinfo;
gentity_t *bot;
char *key;
char *s;
char *botname;
@ -583,6 +579,14 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay
char *headmodel;
char userinfo[MAX_INFO_STRING];
// have the server allocate a client slot
clientNum = trap_BotAllocateClient();
if ( clientNum == -1 ) {
G_Printf( S_COLOR_RED "Unable to add bot. All player slots are in use.\n" );
G_Printf( S_COLOR_RED "Start server with more 'open' slots (or check setting of sv_maxclients cvar).\n" );
return;
}
// get the botinfo from bots.txt
botinfo = G_GetBotInfoByName( name );
if ( !botinfo ) {
@ -604,7 +608,7 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay
Info_SetValueForKey( userinfo, "name", botname );
Info_SetValueForKey( userinfo, "rate", "25000" );
Info_SetValueForKey( userinfo, "snaps", "20" );
Info_SetValueForKey( userinfo, "skill", va("%1.2f", skill) );
Info_SetValueForKey( userinfo, "skill", va("%.2f", skill) );
if ( skill >= 1 && skill < 2 ) {
Info_SetValueForKey( userinfo, "handicap", "50" );
@ -663,16 +667,8 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay
trap_Print( S_COLOR_RED "Error: bot has no aifile specified\n" );
return;
}
Info_SetValueForKey( userinfo, "characterfile", s );
// have the server allocate a client slot
clientNum = trap_BotAllocateClient();
if ( clientNum == -1 ) {
G_Printf( S_COLOR_RED "Unable to add bot. All player slots are in use.\n" );
G_Printf( S_COLOR_RED "Start server with more 'open' slots (or check setting of sv_maxclients cvar).\n" );
return;
}
// initialize the bot settings
if( !team || !*team ) {
if( g_gametype.integer >= GT_TEAM ) {
if( PickTeam(clientNum) == TEAM_RED) {
@ -687,14 +683,8 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay
}
}
Info_SetValueForKey( userinfo, "characterfile", Info_ValueForKey( botinfo, "aifile" ) );
Info_SetValueForKey( userinfo, "skill", va( "%5.2f", skill ) );
Info_SetValueForKey( userinfo, "team", team );
bot = &g_entities[ clientNum ];
bot->r.svFlags |= SVF_BOT;
bot->inuse = qtrue;
// register the userinfo
trap_SetUserinfo( clientNum, userinfo );

View file

@ -1723,8 +1723,11 @@ void ClientSpawn(gentity_t *ent) {
client->ps.commandTime = level.time - 100;
ent->client->pers.cmd.serverTime = level.time;
ClientThink( ent-g_entities );
// run the presend to set anything else
ClientEndFrame( ent );
// run the presend to set anything else, follow spectators wait
// until all clients have been reconnected after map_restart
if ( ent->client->sess.spectatorState != SPECTATOR_FOLLOW ) {
ClientEndFrame( ent );
}
// clear entity state values
BG_PlayerStateToEntityState( &client->ps, &ent->s, qtrue );

View file

@ -1496,7 +1496,7 @@ void CheckIntermissionExit( void ) {
if ( cl->pers.connected != CON_CONNECTED ) {
continue;
}
if ( g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT ) {
if ( g_entities[i].r.svFlags & SVF_BOT ) {
continue;
}

Binary file not shown.

View file

@ -562,7 +562,7 @@ delta functions
extern cvar_t *cl_shownet;
#define LOG(x) if( cl_shownet->integer == 4 ) { Com_Printf("%s ", x ); };
#define LOG(x) if( cl_shownet && cl_shownet->integer == 4 ) { Com_Printf("%s ", x ); };
void MSG_WriteDelta( msg_t *msg, int oldV, int newV, int bits ) {
if ( oldV == newV ) {
@ -1050,7 +1050,7 @@ void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
if ( MSG_ReadBits( msg, 1 ) == 1 ) {
Com_Memset( to, 0, sizeof( *to ) );
to->number = MAX_GENTITIES - 1;
if ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) {
if ( cl_shownet && ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) ) {
Com_Printf( "%3i: #%-3i remove\n", msg->readcount, number );
}
return;
@ -1072,7 +1072,7 @@ void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
// shownet 2/3 will interleave with other printed info, -1 will
// just print the delta records`
if ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) {
if ( cl_shownet && ( cl_shownet->integer >= 2 || cl_shownet->integer == -1 ) ) {
print = 1;
Com_Printf( "%3i: #%-3i ", msg->readcount, to->number );
} else {
@ -1389,7 +1389,7 @@ void MSG_ReadDeltaPlayerstate (msg_t *msg, playerState_t *from, playerState_t *t
// shownet 2/3 will interleave with other printed info, -2 will
// just print the delta records
if ( cl_shownet->integer >= 2 || cl_shownet->integer == -2 ) {
if ( cl_shownet && ( cl_shownet->integer >= 2 || cl_shownet->integer == -2 ) ) {
print = 1;
Com_Printf( "%3i: playerstate ", msg->readcount );
} else {

View file

@ -338,7 +338,7 @@ Dlls will call this directly
intptr_t QDECL VM_DllSyscall( intptr_t arg, ... ) {
#if !id386 || defined __clang__
// rcg010206 - see commentary above
intptr_t args[16];
intptr_t args[MAX_VMSYSCALL_ARGS];
int i;
va_list ap;
@ -823,7 +823,7 @@ intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... )
// if we have a dll loaded, call it directly
if ( vm->entryPoint ) {
//rcg010207 - see dissertation at top of VM_DllSyscall() in this file.
int args[10];
int args[MAX_VMMAIN_ARGS-1];
va_list ap;
va_start(ap, callnum);
for (i = 0; i < ARRAY_LEN(args); i++) {
@ -833,7 +833,7 @@ intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... )
r = vm->entryPoint( callnum, args[0], args[1], args[2], args[3],
args[4], args[5], args[6], args[7],
args[8], args[9]);
args[8], args[9], args[10], args[11]);
} else {
#if ( id386 || idsparc ) && !defined __clang__ // calling convention doesn't need conversion in some cases
#ifndef NO_VM_COMPILED
@ -845,7 +845,7 @@ intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... )
#else
struct {
int callnum;
int args[10];
int args[MAX_VMMAIN_ARGS-1];
} a;
va_list ap;

View file

@ -326,6 +326,7 @@ int VM_CallInterpreted( vm_t *vm, int *args ) {
int *codeImage;
int v1;
int dataMask;
int arg;
#ifdef DEBUG_VM
vmSymbol_t *profileSymbol;
#endif
@ -349,18 +350,11 @@ int VM_CallInterpreted( vm_t *vm, int *args ) {
programCounter = 0;
programStack -= 48;
programStack -= ( 8 + 4 * MAX_VMMAIN_ARGS );
for ( arg = 0; arg < MAX_VMMAIN_ARGS; arg++ )
*(int *)&image[ programStack + 8 + arg * 4 ] = args[ arg ];
*(int *)&image[ programStack + 44] = args[9];
*(int *)&image[ programStack + 40] = args[8];
*(int *)&image[ programStack + 36] = args[7];
*(int *)&image[ programStack + 32] = args[6];
*(int *)&image[ programStack + 28] = args[5];
*(int *)&image[ programStack + 24] = args[4];
*(int *)&image[ programStack + 20] = args[3];
*(int *)&image[ programStack + 16] = args[2];
*(int *)&image[ programStack + 12] = args[1];
*(int *)&image[ programStack + 8 ] = args[0];
*(int *)&image[ programStack + 4 ] = 0; // return stack
*(int *)&image[ programStack ] = -1; // will terminate the loop on return
@ -508,10 +502,10 @@ nextInstruction2:
// the vm has ints on the stack, we expect
// pointers so we might have to convert it
if (sizeof(intptr_t) != sizeof(int)) {
intptr_t argarr[16];
int *imagePtr = (int *)&image[programStack];
intptr_t argarr[ MAX_VMSYSCALL_ARGS ];
int *imagePtr = (int *)&image[ programStack ];
int i;
for (i = 0; i < 16; ++i) {
for (i = 0; i < ARRAY_LEN(argarr); ++i) {
argarr[i] = *(++imagePtr);
}
r = vm->systemCall( argarr );

View file

@ -22,6 +22,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "q_shared.h"
#include "qcommon.h"
// Max number of arguments to pass from engine to vm's vmMain function.
// command number + 12 arguments
#define MAX_VMMAIN_ARGS 13
// Max number of arguments to pass from a vm to engine's syscall handler function for the vm.
// syscall number + 15 arguments
#define MAX_VMSYSCALL_ARGS 16
// don't change, this is hardcoded into x86 VMs, opStack protection relies
// on this
#define OPSTACK_SIZE 1024

View file

@ -367,13 +367,13 @@ VM_AsmCall( int callSyscallInvNum, int callProgramStack )
ret = currentVM->systemCall( argPosition );
} else {
intptr_t args[11];
intptr_t args[MAX_VMSYSCALL_ARGS];
// generated code does not invert syscall number
args[0] = -1 - callSyscallInvNum;
int *argPosition = (int *)((byte *)currentVM->dataBase + callProgramStack + 4);
for( i = 1; i < 11; i++ )
for( i = 1; i < ARRAY_LEN(args); i++ )
args[ i ] = argPosition[ i ];
ret = currentVM->systemCall( args );
@ -2105,9 +2105,9 @@ VM_CallCompiled( vm_t *vm, int *args )
vm->currentlyInterpreting = qtrue;
programStack -= 48;
programStack -= ( 8 + 4 * MAX_VMMAIN_ARGS );
argPointer = (int *)&image[ programStack + 8 ];
memcpy( argPointer, args, 4 * 9 );
memcpy( argPointer, args, 4 * MAX_VMMAIN_ARGS );
argPointer[ -1 ] = 0;
argPointer[ -2 ] = -1;

View file

@ -808,11 +808,11 @@ static int asmcall(int call, int pstack)
argPosition[0] = -1 - call;
ret = currentVM->systemCall(argPosition);
} else {
intptr_t args[11];
intptr_t args[MAX_VMSYSCALL_ARGS];
args[0] = -1 - call;
int *argPosition = (int *)((byte *)currentVM->dataBase + pstack + 4);
for( i = 1; i < 11; i++ )
for( i = 1; i < ARRAY_LEN(args); i++ )
args[i] = argPosition[i];
ret = currentVM->systemCall(args);
@ -1650,9 +1650,9 @@ int VM_CallCompiled(vm_t *vm, int *args)
vm->currentlyInterpreting = qtrue;
programStack -= 48;
programStack -= ( 8 + 4 * MAX_VMMAIN_ARGS );
argPointer = (int *)&image[ programStack + 8 ];
memcpy( argPointer, args, 4 * 9 );
memcpy( argPointer, args, 4 * MAX_VMMAIN_ARGS );
argPointer[-1] = 0;
argPointer[-2] = -1;

View file

@ -416,7 +416,7 @@ static void DoSyscall(void)
int *data;
#if idx64
int index;
intptr_t args[16];
intptr_t args[MAX_VMSYSCALL_ARGS];
#endif
data = (int *) (savedVM->dataBase + vm_programStack + 4);
@ -1714,6 +1714,7 @@ int VM_CallCompiled(vm_t *vm, int *args)
byte *image;
int *opStack;
int opStackOfs;
int arg;
currentVM = vm;
@ -1726,18 +1727,11 @@ int VM_CallCompiled(vm_t *vm, int *args)
// set up the stack frame
image = vm->dataBase;
programStack -= 48;
programStack -= ( 8 + 4 * MAX_VMMAIN_ARGS );
for ( arg = 0; arg < MAX_VMMAIN_ARGS; arg++ )
*(int *)&image[ programStack + 8 + arg * 4 ] = args[ arg ];
*(int *)&image[ programStack + 44] = args[9];
*(int *)&image[ programStack + 40] = args[8];
*(int *)&image[ programStack + 36] = args[7];
*(int *)&image[ programStack + 32] = args[6];
*(int *)&image[ programStack + 28] = args[5];
*(int *)&image[ programStack + 24] = args[4];
*(int *)&image[ programStack + 20] = args[3];
*(int *)&image[ programStack + 16] = args[2];
*(int *)&image[ programStack + 12] = args[1];
*(int *)&image[ programStack + 8 ] = args[0];
*(int *)&image[ programStack + 4 ] = 0; // return stack
*(int *)&image[ programStack ] = -1; // will terminate the loop on return
@ -1799,7 +1793,7 @@ int VM_CallCompiled(vm_t *vm, int *args)
{
Com_Error(ERR_DROP, "opStack corrupted in compiled code");
}
if(programStack != stackOnEntry - 48)
if(programStack != stackOnEntry - (8 + 4 * MAX_VMMAIN_ARGS))
Com_Error(ERR_DROP, "programStack corrupted in compiled code");
vm->programStack = stackOnEntry;

View file

@ -86,8 +86,8 @@ static intptr_t CROSSCALL callAsmCall(intptr_t callProgramStack, int64_t callSys
{
vm_t *savedVM;
intptr_t ret = 0x77;
intptr_t args[16];
// int iargs[16];
intptr_t args[MAX_VMSYSCALL_ARGS];
// int iargs[MAX_VMSYSCALL_ARGS];
int i;
// Dfprintf(stderr, "callAsmCall(%ld, %ld)\n", callProgramStack, callSyscallNum);
@ -1024,6 +1024,7 @@ int VM_CallCompiled(vm_t *vm, int *args)
byte *image;
void *entryPoint;
int *opStack;
int arg;
currentVM = vm;
@ -1046,18 +1047,11 @@ int VM_CallCompiled(vm_t *vm, int *args)
programCounter = 0;
programStack -= 48;
programStack -= ( 8 + 4 * MAX_VMMAIN_ARGS );
for ( arg = 0; arg < MAX_VMMAIN_ARGS; arg++ )
*(int *)&image[ programStack + 8 + arg * 4 ] = args[ arg ];
*(int *)&image[ programStack + 44] = args[9];
*(int *)&image[ programStack + 40] = args[8];
*(int *)&image[ programStack + 36] = args[7];
*(int *)&image[ programStack + 32] = args[6];
*(int *)&image[ programStack + 28] = args[5];
*(int *)&image[ programStack + 24] = args[4];
*(int *)&image[ programStack + 20] = args[3];
*(int *)&image[ programStack + 16] = args[2];
*(int *)&image[ programStack + 12] = args[1];
*(int *)&image[ programStack + 8 ] = args[0];
*(int *)&image[ programStack + 4 ] = 0x77777777; // return stack
*(int *)&image[ programStack ] = -1; // will terminate the loop on return
@ -1091,7 +1085,7 @@ int VM_CallCompiled(vm_t *vm, int *args)
if(opStackRet != 1 || *opStack != 0xDEADBEEF)
Com_Error(ERR_DROP, "opStack corrupted in compiled code (offset %ld)", opStackRet);
if ( programStack != stackOnEntry - 48 ) {
if ( programStack != stackOnEntry - ( 8 + 4 * MAX_VMMAIN_ARGS ) ) {
Com_Error( ERR_DROP, "programStack corrupted in compiled code" );
}

View file

@ -1245,21 +1245,37 @@ const void *RB_DrawSurfs( const void *data ) {
{
vec4_t quadVerts[4];
vec2_t texCoords[4];
vec4_t box;
FBO_Bind(tr.screenShadowFbo);
qglViewport(0, 0, tr.screenShadowFbo->width, tr.screenShadowFbo->height);
qglScissor(0, 0, tr.screenShadowFbo->width, tr.screenShadowFbo->height);
box[0] = (backEnd.refdef.x ) * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
box[1] = (backEnd.refdef.y ) * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
box[2] = (backEnd.refdef.width ) * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
box[3] = (backEnd.refdef.height) * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
VectorSet4(quadVerts[0], -1, 1, 0, 1);
VectorSet4(quadVerts[1], 1, 1, 0, 1);
VectorSet4(quadVerts[2], 1, -1, 0, 1);
VectorSet4(quadVerts[3], -1, -1, 0, 1);
qglViewport(box[0], box[1], box[2], box[3]);
qglScissor(box[0], box[1], box[2], box[3]);
texCoords[0][0] = 0; texCoords[0][1] = 1;
texCoords[1][0] = 1; texCoords[1][1] = 1;
texCoords[2][0] = 1; texCoords[2][1] = 0;
texCoords[3][0] = 0; texCoords[3][1] = 0;
box[0] = (backEnd.refdef.x ) / (float)glConfig.vidWidth;
box[1] = (backEnd.refdef.y ) / (float)glConfig.vidHeight;
box[2] = (backEnd.refdef.x + backEnd.refdef.width ) / (float)glConfig.vidWidth;
box[3] = (backEnd.refdef.y + backEnd.refdef.height) / (float)glConfig.vidHeight;
texCoords[0][0] = box[0]; texCoords[0][1] = box[3];
texCoords[1][0] = box[2]; texCoords[1][1] = box[3];
texCoords[2][0] = box[2]; texCoords[2][1] = box[1];
texCoords[3][0] = box[0]; texCoords[3][1] = box[1];
box[0] = -1.0f;
box[1] = -1.0f;
box[2] = 1.0f;
box[3] = 1.0f;
VectorSet4(quadVerts[0], box[0], box[3], 0, 1);
VectorSet4(quadVerts[1], box[2], box[3], 0, 1);
VectorSet4(quadVerts[2], box[2], box[1], 0, 1);
VectorSet4(quadVerts[3], box[0], box[1], 0, 1);
GL_State( GLS_DEPTHTEST_DISABLE );
@ -1731,7 +1747,7 @@ const void *RB_PostProcess(const void *data)
autoExposure = r_autoExposure->integer || r_forceAutoExposure->integer;
RB_ToneMap(srcFbo, autoExposure);
}
else if (!glRefConfig.framebuffer_srgb && r_cameraExposure->value == 0.0f)
else if (r_cameraExposure->value == 0.0f)
{
FBO_FastBlit(srcFbo, NULL, tr.screenScratchFbo, NULL, GL_COLOR_BUFFER_BIT, GL_NEAREST);
}

View file

@ -3295,9 +3295,9 @@ void RE_LoadWorldMap( const char *name ) {
tr.autoExposureMinMax[1] = 2.0f;
// set default tone mapping settings
tr.toneMinAvgMaxLevel[0] = -3.25f;
tr.toneMinAvgMaxLevel[1] = -1.0f;
tr.toneMinAvgMaxLevel[2] = 1.0f;
tr.toneMinAvgMaxLevel[0] = -8.0f;
tr.toneMinAvgMaxLevel[1] = -2.0f;
tr.toneMinAvgMaxLevel[2] = 0.0f;
tr.worldMapLoaded = qtrue;

View file

@ -608,21 +608,6 @@ void GLimp_InitExtraExtensions()
ri.Printf(PRINT_ALL, result[2], extension);
}
// GL_EXT_framebuffer_sRGB
extension = "GL_EXT_framebuffer_sRGB";
glRefConfig.framebuffer_srgb = qfalse;
if (GLimp_HaveExtension(extension))
{
if (r_srgb->integer)
glRefConfig.framebuffer_srgb = qtrue;
ri.Printf(PRINT_ALL, result[glRefConfig.framebuffer_srgb], extension);
}
else
{
ri.Printf(PRINT_ALL, result[2], extension);
}
glRefConfig.textureCompression = TCR_NONE;
// GL_EXT_texture_compression_latc

View file

@ -40,4 +40,4 @@ typedef struct {
float sunAmbCol[3];
} refdefex_t;
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -2152,6 +2152,26 @@ static void Upload32( byte *data, int width, int height, imgType_t type, imgFlag
}
}
// Convert to RGB if sRGB textures aren't supported in hardware
if (!glRefConfig.texture_srgb && (flags & IMGFLAG_SRGB))
{
byte *in = data;
int c = width * height;
while (c--)
{
for (i = 0; i < 3; i++)
{
float x = ByteToFloat(in[i]);
x = sRGBtoRGB(x);
in[i] = FloatToByte(x);
}
in += 4;
}
// FIXME: Probably should mark the image as non-sRGB as well
flags &= ~IMGFLAG_SRGB;
}
// normals are always swizzled
if (type == IMGTYPE_NORMAL || type == IMGTYPE_NORMALHEIGHT)
{
@ -2947,10 +2967,7 @@ void R_CreateBuiltinImages( void ) {
{
int format;
if (glRefConfig.texture_srgb && glRefConfig.framebuffer_srgb)
format = GL_SRGB8_ALPHA8_EXT;
else
format = GL_RGBA8;
format = GL_RGBA8;
tr.screenScratchImage = R_CreateImage("*screenScratch", NULL, width, height, IMGTYPE_COLORALPHA, IMGFLAG_NO_COMPRESSION | IMGFLAG_CLAMPTOEDGE, format);
}
@ -3085,10 +3102,21 @@ void R_SetColorMappings( void ) {
}
for ( i = 0; i < 256; i++ ) {
int i2;
if (r_srgb->integer)
{
i2 = 255 * RGBtosRGB(i/255.0f) + 0.5f;
}
else
{
i2 = i;
}
if ( g == 1 ) {
inf = i;
inf = i2;
} else {
inf = 255 * pow ( i/255.0f, 1.0f / g ) + 0.5f;
inf = 255 * pow ( i2/255.0f, 1.0f / g ) + 0.5f;
}
inf <<= shift;
if (inf < 0) {

View file

@ -934,11 +934,6 @@ void GL_SetDefaultState( void )
glState.currentVBO = NULL;
glState.currentIBO = NULL;
if (glRefConfig.framebuffer_srgb)
{
qglEnable(GL_FRAMEBUFFER_SRGB_EXT);
}
qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
qglDepthMask( GL_TRUE );
qglDisable( GL_DEPTH_TEST );
@ -1159,9 +1154,9 @@ void R_Register( void )
r_toneMap = ri.Cvar_Get( "r_toneMap", "1", CVAR_ARCHIVE | CVAR_LATCH );
r_forceToneMap = ri.Cvar_Get( "r_forceToneMap", "0", CVAR_CHEAT );
r_forceToneMapMin = ri.Cvar_Get( "r_forceToneMapMin", "-3.25", CVAR_CHEAT );
r_forceToneMapAvg = ri.Cvar_Get( "r_forceToneMapAvg", "-1.0", CVAR_CHEAT );
r_forceToneMapMax = ri.Cvar_Get( "r_forceToneMapMax", "1.0", CVAR_CHEAT );
r_forceToneMapMin = ri.Cvar_Get( "r_forceToneMapMin", "-8.0", CVAR_CHEAT );
r_forceToneMapAvg = ri.Cvar_Get( "r_forceToneMapAvg", "-2.0", CVAR_CHEAT );
r_forceToneMapMax = ri.Cvar_Get( "r_forceToneMapMax", "0.0", CVAR_CHEAT );
r_autoExposure = ri.Cvar_Get( "r_autoExposure", "1", CVAR_ARCHIVE );
r_forceAutoExposure = ri.Cvar_Get( "r_forceAutoExposure", "0", CVAR_CHEAT );

View file

@ -441,15 +441,7 @@ int R_LightDirForPoint( vec3_t point, vec3_t lightDir, vec3_t normal, world_t *w
Com_Memset(&ent, 0, sizeof(ent));
VectorCopy( point, ent.e.origin );
R_SetupEntityLightingGrid( &ent, world );
if ((DotProduct(ent.lightDir, ent.lightDir) < 0.9f) || (DotProduct(ent.lightDir, normal) < 0.1f))
{
VectorCopy(normal, lightDir);
}
else
{
VectorCopy(ent.lightDir, lightDir);
}
VectorCopy(ent.lightDir, lightDir);
return qtrue;
}

View file

@ -1711,7 +1711,6 @@ typedef struct {
qboolean framebufferBlit;
qboolean texture_srgb;
qboolean framebuffer_srgb;
qboolean depthClamp;
} glRefConfig_t;

View file

@ -30,4 +30,4 @@ void RB_BokehBlur(float blur);
void RB_GodRays(void);
void RB_GaussianBlur(float blur);
#endif
#endif

View file

@ -1179,7 +1179,7 @@ static void RB_FogPass( void ) {
{
int index = 0;
if (deformGen |= DGEN_NONE)
if (deformGen != DGEN_NONE)
index |= FOGDEF_USE_DEFORM_VERTEXES;
if (glState.vertexAttribsInterpolation)

View file

@ -853,6 +853,9 @@ Downloads are finished
==================
*/
static void SV_DoneDownload_f( client_t *cl ) {
if ( cl->state == CS_ACTIVE )
return;
Com_DPrintf( "clientDownload: %s Done\n", cl->name);
// resend the game state to update any clients that entered during the download
SV_SendClientGameState(cl);
@ -1966,15 +1969,19 @@ void SV_ExecuteClientMessage( client_t *cl, msg_t *msg ) {
}
} while ( 1 );
// read optional voip data
if ( c == clc_voip ) {
#ifdef USE_VOIP
SV_UserVoip( cl, msg );
c = MSG_ReadByte( msg );
#endif
}
// read the usercmd_t
if ( c == clc_move ) {
SV_UserMove( cl, msg, qtrue );
} else if ( c == clc_moveNoDelta ) {
SV_UserMove( cl, msg, qfalse );
} else if ( c == clc_voip ) {
#ifdef USE_VOIP
SV_UserVoip( cl, msg );
#endif
} else if ( c != clc_EOF ) {
Com_Printf( "WARNING: bad command byte for client %i\n", (int) (cl - svs.clients) );
}

View file

@ -9,22 +9,41 @@ BASEDIR=baseq3r
MPACKDIR=missionpack
BIN_OBJ="
build/release-darwin-ppc/q3rally-smp.ppc
build/release-darwin-i386/q3rally-smp.i386
build/release-darwin-x86_64/q3rally.x86_64
build/release-darwin-i386/q3rally.i386
build/release-darwin-ppc/q3rally.ppc
"
BIN_DEDOBJ="
build/release-darwin-ppc/q3rally-server.ppc
build/release-darwin-x86_64/q3rally-server.x86_64
build/release-darwin-i386/q3rally-server.i386
build/release-darwin-ppc/q3rally-server.ppc
"
BASE_OBJ="
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
build/release-darwin-x86_64/$BASEDIR/cgamex86_64.dylib
build/release-darwin-i386/$BASEDIR/cgamei386.dylib
build/release-darwin-ppc/$BASEDIR/uippc.dylib
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
build/release-darwin-x86_64/$BASEDIR/uix86_64.dylib
build/release-darwin-i386/$BASEDIR/uii386.dylib
build/release-darwin-ppc/$BASEDIR/qagameppc.dylib
build/release-darwin-ppc/$BASEDIR/uippc.dylib
build/release-darwin-x86_64/$BASEDIR/qagamex86_64.dylib
build/release-darwin-i386/$BASEDIR/qagamei386.dylib
build/release-darwin-ppc/$BASEDIR/qagameppc.dylib
assets0.pk3
"
RENDER_OBJ="
build/release-darwin-x86_64/renderer_opengl1_smp_x86_64.dylib
build/release-darwin-i386/renderer_opengl1_smp_i386.dylib
build/release-darwin-ppc/renderer_opengl1_smp_ppc.dylib
build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib
build/release-darwin-i386/renderer_opengl1_i386.dylib
build/release-darwin-ppc/renderer_opengl1_ppc.dylib
build/release-darwin-x86_64/renderer_rend2_smp_x86_64.dylib
build/release-darwin-i386/renderer_rend2_smp_i386.dylib
build/release-darwin-ppc/renderer_rend2_smp_ppc.dylib
build/release-darwin-x86_64/renderer_rend2_x86_64.dylib
build/release-darwin-i386/renderer_rend2_i386.dylib
build/release-darwin-ppc/renderer_rend2_ppc.dylib
"
cd `dirname $0`
if [ ! -f Makefile ]; then
@ -38,45 +57,40 @@ Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
# "8" is the Darwin major kernel version.
TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
# we want to use the oldest available SDK for max compatiblity
unset PPC_SDK
unset PPC_CFLAGS
unset PPC_LDFLAGS
# we want to use the oldest available SDK for max compatiblity. However 10.4 and older
# can not build 64bit binaries, making 10.5 the minimum version. This has been tested
# with xcode 3.1 (xcode31_2199_developerdvd.dmg). It contains the 10.5 SDK and a decent
# enough gcc to actually compile ioquake3
# For PPC macs, G4's or better are required to run ioquake3.
unset X86_64_SDK
unset X86_64_CFLAGS
unset X86_64_LDFLAGS
unset X86_SDK
unset X86_CFLAGS
unset X86_LDFLAGS
unset PPC_64_SDK
unset PPC_CFLAGS
unset PPC_LDFLAGS
if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
PPC_SDK=/Developer/SDKs/MacOSX10.5.sdk
PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk \
X86_64_SDK=/Developer/SDKs/MacOSX10.5.sdk
X86_64_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050"
PPC_LDFLAGS=" -mmacosx-version-min=10.5"
X86_64_LDFLAGS=" -mmacosx-version-min=10.5"
X86_SDK=/Developer/SDKs/MacOSX10.5.sdk
X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050"
X86_LDFLAGS=" -mmacosx-version-min=10.5"
PPC_SDK=/Developer/SDKs/MacOSX10.5.sdk
PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050"
PPC_LDFLAGS=" -mmacosx-version-min=10.5"
fi
if [ -d /Developer/SDKs/MacOSX10.4u.sdk ]; then
PPC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1040"
PPC_LDFLAGS=" -mmacosx-version-min=10.4"
X86_SDK=/Developer/SDKs/MacOSX10.4u.sdk
X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1040"
X86_LDFLAGS=" -mmacosx-version-min=10.4"
fi
if [ -d /Developer/SDKs/MacOSX10.3.9.sdk ] && [ $TIGERHOST ]; then
PPC_SDK=/Developer/SDKs/MacOSX10.3.9.sdk
PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.3.9.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1030"
PPC_LDFLAGS=" -mmacosx-version-min=10.3"
fi
if [ -z $PPC_SDK ] || [ -z $X86_SDK ]; then
if [ -z $X86_64_SDK ] || [ -z $X86_SDK ] || [ -z $PPC_SDK ]; then
echo "\
ERROR: This script is for building a Universal Binary. You cannot build
for a different architecture unless you have the proper Mac OS X SDKs
@ -85,17 +99,19 @@ ERROR: This script is for building a Universal Binary. You cannot build
exit 1
fi
echo "Building PPC Client/Dedicated Server against \"$PPC_SDK\""
echo "Building X86_64 Client/Dedicated Server against \"$X86_64_SDK\""
echo "Building X86 Client/Dedicated Server against \"$X86_SDK\""
if [ "$PPC_SDK" != "/Developer/SDKs/MacOSX10.3.9.sdk" ] || \
[ "$X86_SDK" != "/Developer/SDKs/MacOSX10.4u.sdk" ]; then
echo "Building PPC Client/Dedicated Server against \"$PPC_SDK\""
echo
if [ "$X86_64_SDK" != "/Developer/SDKs/MacOSX10.5.sdk" ] || \
[ "$X86_SDK" != "/Developer/SDKs/MacOSX10.5.sdk" ]; then
echo "\
WARNING: in order to build a binary with maximum compatibility you must
build on Mac OS X 10.4 using Xcode 2.3 or 2.5 and have the
MacOSX10.3.9, and MacOSX10.4u SDKs installed from the Xcode
install disk Packages folder."
fi
build on Mac OS X 10.5 using Xcode 3.1 and have the MacOSX10.5
SDKs installed from the Xcode install disk Packages folder."
sleep 3
fi
if [ ! -d $DESTDIR ]; then
mkdir -p $DESTDIR
@ -104,18 +120,30 @@ fi
# For parallel make on multicore boxes...
NCPU=`sysctl -n hw.ncpu`
# ppc client and server
if [ -d build/release-release-ppc ]; then
rm -r build/release-darwin-ppc
# x86_64 client and server
if [ -d build/release-release-x86_64 ]; then
rm -r build/release-darwin-x86_64
fi
(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS LDFLAGS=$PPC_LDFLAGS make -j$NCPU) || exit 1;
(ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS LDFLAGS=$X86_64_LDFLAGS make -j$NCPU) || exit 1;
# intel client and server
echo;echo
# i386 client and server
if [ -d build/release-darwin-i386 ]; then
rm -r build/release-darwin-i386
fi
(ARCH=i386 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1;
echo;echo
# PPC client and server
if [ -d build/release-darwin-ppc ]; then
rm -r build/release-darwin-ppc
fi
(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS LDFLAGS=$PPC_LDFLAGS make -j$NCPU) || exit 1;
echo;echo
echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1;
@ -165,8 +193,11 @@ echo "
</plist>
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
# Make UB's from previous builds of i386, x86_64 and ppc binaries
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ
cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/

View file

@ -1,35 +1,60 @@
#!/bin/sh
#
CC=gcc-4.0
APPBUNDLE=ioquake3.app
BINARY=ioquake3.x86_64
DEDBIN=ioq3ded.x86_64
BINARY=ioquake3.${BUILDARCH}
DEDBIN=ioq3ded.${BUILDARCH}
PKGINFO=APPLIOQ3
ICNS=misc/quake3.icns
DESTDIR=build/release-darwin-x86_64
DESTDIR=build/release-darwin-${BUILDARCH}
BASEDIR=baseq3
MPACKDIR=missionpack
RENDERDIR=build/release-darwin-x86_64
# Lets make the user give us a target build system
if [ $# -ne 1 ]; then
echo "Usage: $0 target_architecture"
echo "Example: $0 i386"
echo "other valid options are x86_64 or ppc"
echo
echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
exit 1
fi
if [ "$1" == "i386" ]; then
BUILDARCH=i386
elif [ "$1" == "x86_64" ]; then
BUILDARCH=x86_64
elif [ "$1" == "ppc" ]; then
BUILDARCH=ppc
else
echo "Invalid architecture: $1"
echo "Valid architectures are i386, x86_64 or ppc"
exit 1
fi
BIN_OBJ="
build/release-darwin-x86_64/ioquake3.x86_64
build/release-darwin-${BUILDARCH}/ioquake3.${BUILDARCH}
"
BIN_DEDOBJ="
build/release-darwin-x86_64/ioq3ded.x86_64
build/release-darwin-${BUILDARCH}/ioq3ded.${BUILDARCH}
"
BASE_OBJ="
build/release-darwin-x86_64/$BASEDIR/cgamex86_64.dylib
build/release-darwin-x86_64/$BASEDIR/uix86_64.dylib
build/release-darwin-x86_64/$BASEDIR/qagamex86_64.dylib
build/release-darwin-${BUILDARCH}/$BASEDIR/cgame${BUILDARCH}.dylib
build/release-darwin-${BUILDARCH}/$BASEDIR/ui${BUILDARCH}.dylib
build/release-darwin-${BUILDARCH}/$BASEDIR/qagame${BUILDARCH}.dylib
"
MPACK_OBJ="
build/release-darwin-x86_64/$MPACKDIR/cgamex86_64.dylib
build/release-darwin-x86_64/$MPACKDIR/uix86_64.dylib
build/release-darwin-x86_64/$MPACKDIR/qagamex86_64.dylib
build/release-darwin-${BUILDARCH}/$MPACKDIR/cgame${BUILDARCH}.dylib
build/release-darwin-${BUILDARCH}/$MPACKDIR/ui${BUILDARCH}.dylib
build/release-darwin-${BUILDARCH}/$MPACKDIR/qagame${BUILDARCH}.dylib
"
RENDER_OBJ="
build/release-darwin-x86_64/renderer_opengl1_smp_x86_64.dylib
build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib
build/release-darwin-${BUILDARCH}/renderer_opengl1_smp_${BUILDARCH}.dylib
build/release-darwin-${BUILDARCH}/renderer_opengl1_${BUILDARCH}.dylib
build/release-darwin-${BUILDARCH}/renderer_rend2_smp_${BUILDARCH}.dylib
build/release-darwin-${BUILDARCH}/renderer_rend2_${BUILDARCH}.dylib
"
cd `dirname $0`
@ -44,19 +69,25 @@ Q3_VERSION=`grep '^VERSION=' Makefile | sed -e 's/.*=\(.*\)/\1/'`
# "8" is the Darwin major kernel version.
TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'`
# we want to use the oldest available SDK for max compatiblity
unset X86_SDK
unset X86_CFLAGS
unset X86_LDFLAGS
# we want to use the oldest available SDK for max compatiblity. However 10.4 and older
# can not build 64bit binaries, making 10.5 the minimum version. This has been tested
# with xcode 3.1 (xcode31_2199_developerdvd.dmg). It contains the 10.5 SDK and a decent
# enough gcc to actually compile ioquake3
# For PPC macs, G4's or better are required to run ioquake3.
unset ARCH_SDK
unset ARCH_CFLAGS
unset ARCH_LDFLAGS
if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
X86_SDK=/Developer/SDKs/MacOSX10.5.sdk
X86_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk \
ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
ARCH_CFLAGS="-arch ${BUILDARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050"
X86_LDFLAGS=" -mmacosx-version-min=10.5"
ARCH_LDFLAGS=" -mmacosx-version-min=10.5"
fi
echo "Building X86 Client/Dedicated Server against \"$X86_SDK\""
echo "Building ${BUILDARCH} Client/Dedicated Server against \"$ARCH_SDK\""
sleep 3
if [ ! -d $DESTDIR ]; then
@ -68,10 +99,10 @@ NCPU=`sysctl -n hw.ncpu`
# intel client and server
if [ -d build/release-darwin-x86_64 ]; then
rm -r build/release-darwin-x86_64
if [ -d build/release-darwin-${BUILDARCH} ]; then
rm -r build/release-darwin-${BUILDARCH}
fi
(ARCH=x86_64 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1;
(ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1;
echo "Creating .app bundle $DESTDIR/$APPBUNDLE"
if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then
@ -122,10 +153,12 @@ echo "
</plist>
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ
cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY
cp $BIN_DEDOBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN
cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/
cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
cp $MPACK_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR/
cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
cp code/libs/macosx/*.dylib $DESTDIR

View file

@ -106,6 +106,7 @@ Section "${GAMENAME} ${VERSION}-${RELEASE} (required)"
File "../../build/release-mingw32-x86/${CLIENT}"
!ifdef USE_RENDERER_DLOPEN
File "../../build/release-mingw32-x86/renderer_opengl1_x86.dll"
File "../../build/release-mingw32-x86/renderer_rend2_x86.dll"
!endif
File "../../COPYING.txt"
@ -188,6 +189,11 @@ Section "Uninstall"
Delete $INSTDIR\${CLIENT}
Delete $INSTDIR\${SERVER}
!ifdef USE_RENDERER_DLOPEN
Delete $INSTDIR\renderer_opengl1_x86.dll
Delete $INSTDIR\renderer_rend2_x86.dll
!endif
Delete $INSTDIR\COPYING.txt
Delete $INSTDIR\README.txt

View file

@ -71,6 +71,8 @@ for arch in "${archs[@]}"; do
mkdir $dst/q3rally
install -m 755 $topdir/build/release-linux-$arch/q3rally.$arch $dst/q3rally.$arch
install -m 755 $topdir/build/release-linux-$arch/q3rally-server.$arch $dst/q3rally-server.$arch
install -m 755 $topdir/build/release-linux-$arch/renderer_opengl1_$arch.so $dst/renderer_opengl1_$arch.so
install -m 755 $topdir/build/release-linux-$arch/renderer_rend2_$arch.so $dst/renderer_rend2_$arch.so
install -m 644 $topdir/build/release-linux-$arch/q3rally/*.so $dst/q3rally
tar --owner=root --group=root -C $dst -cf ./image/q3rally.$arch.tar .