From 0fc86e9632312e9083141066d98ec260f9bc62e3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 15 Mar 2015 12:34:51 +0000 Subject: [PATCH 1/7] Use pkg-config for a system libjpeg if available: libjpeg-turbo has it Bug: https://github.com/ioquake/ioq3/pull/116 --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d0d20077..b6796f60 100644 --- a/Makefile +++ b/Makefile @@ -1074,11 +1074,10 @@ ifeq ($(USE_INTERNAL_JPEG),1) BASE_CFLAGS += -DUSE_INTERNAL_JPEG BASE_CFLAGS += -I$(JPDIR) else - # libjpeg doesn't have pkg-config yet, but let users override with - # "make JPEG_CFLAGS=-I/opt/jpeg/include JPEG_LIBS='-L/opt/jpeg/lib -ljpeg'" - # if they need to - JPEG_CFLAGS ?= - JPEG_LIBS ?= -ljpeg + # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc; + # we fall back to hard-coded answers if libjpeg.pc is unavailable + JPEG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libjpeg || true) + JPEG_LIBS ?= $(shell pkg-config --silence-errors --libs libjpeg || echo -ljpeg) BASE_CFLAGS += $(JPEG_CFLAGS) RENDERER_LIBS += $(JPEG_LIBS) endif From caf08fdb7b939e72bbb49a15e06c4ce00b214a3c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 18 Mar 2015 17:37:32 +0000 Subject: [PATCH 2/7] unzip: comment why there is no USE_INTERNAL_MINIZIP boolean option Bug: https://github.com/ioquake/ioq3/pull/116 --- code/qcommon/unzip.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/qcommon/unzip.c b/code/qcommon/unzip.c index 4fb2d3a9..b5043c19 100644 --- a/code/qcommon/unzip.c +++ b/code/qcommon/unzip.c @@ -1,4 +1,10 @@ /* unzip.c -- IO for uncompress .zip files using zlib + + Modified for Quake III Arena to use the Z_Malloc() memory pool; + this means a system copy of minizip is not a suitable replacement. + + Based on minizip: + Version 1.01e, February 12th, 2005 Copyright (C) 1998-2005 Gilles Vollant From 1a7628126af102c66b3fbb1e3006b14c7898f5e0 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 24 Mar 2015 03:39:50 -0500 Subject: [PATCH 3/7] OpenGL2: Fix shadow cubemap segfault Changed image size to 512, but 'data' buffer is only 16x16 resulting in libGL segfault. Use NULL instead like other dynamic images. --- code/renderergl2/tr_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/renderergl2/tr_image.c b/code/renderergl2/tr_image.c index e0585096..768cce3f 100644 --- a/code/renderergl2/tr_image.c +++ b/code/renderergl2/tr_image.c @@ -2714,7 +2714,7 @@ void R_CreateBuiltinImages( void ) { { for( x = 0; x < MAX_DLIGHTS; x++) { - tr.shadowCubemaps[x] = R_CreateImage(va("*shadowcubemap%i", x), (byte *)data, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE | IMGFLAG_CUBEMAP, 0); + tr.shadowCubemaps[x] = R_CreateImage(va("*shadowcubemap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE | IMGFLAG_CUBEMAP, 0); } } From c755d75a5eb902582020ea0bb096be3e5e684ef2 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 25 Mar 2015 15:28:54 -0500 Subject: [PATCH 4/7] Fix MDR surface indexes overflow check Also, use the check overflow macro like everywhere else. --- code/renderergl1/tr_animation.c | 2 +- code/renderergl2/tr_animation.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/renderergl1/tr_animation.c b/code/renderergl1/tr_animation.c index 7bcc5bdf..b01cf813 100644 --- a/code/renderergl1/tr_animation.c +++ b/code/renderergl1/tr_animation.c @@ -346,7 +346,7 @@ void RB_MDRSurfaceAnim( mdrSurface_t *surface ) oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + backEnd.currentEntity->e.oldframe * frameSize ); - RB_CheckOverflow( surface->numVerts, surface->numTriangles ); + RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); triangles = (int *) ((byte *)surface + surface->ofsTriangles); indexes = surface->numTriangles * 3; diff --git a/code/renderergl2/tr_animation.c b/code/renderergl2/tr_animation.c index 74226752..53e5ee99 100644 --- a/code/renderergl2/tr_animation.c +++ b/code/renderergl2/tr_animation.c @@ -350,7 +350,7 @@ void RB_MDRSurfaceAnim( mdrSurface_t *surface ) oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + backEnd.currentEntity->e.oldframe * frameSize ); - RB_CheckOverflow( surface->numVerts, surface->numTriangles ); + RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); triangles = (int *) ((byte *)surface + surface->ofsTriangles); indexes = surface->numTriangles * 3; From 3ebc230b287f52d39f605e2cf55c22817e08aa65 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 6 Apr 2015 03:05:28 -0700 Subject: [PATCH 5/7] OpenGL2: Use signed value in case value goes below 0. --- code/renderergl2/tr_extramath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/renderergl2/tr_extramath.c b/code/renderergl2/tr_extramath.c index da9a94d2..bded7570 100644 --- a/code/renderergl2/tr_extramath.c +++ b/code/renderergl2/tr_extramath.c @@ -225,7 +225,7 @@ uint16_t FloatToHalf(float in) f32.f = in; - f16.pack.exponent = CLAMP(f32.pack.exponent - 112, 0, 31); + f16.pack.exponent = CLAMP((int)(f32.pack.exponent) - 112, 0, 31); f16.pack.fraction = f32.pack.fraction >> 13; f16.pack.sign = f32.pack.sign; From 8265af84bed6634fe71cfffe76dc9d3c461d5695 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 31 Mar 2015 04:53:27 -0500 Subject: [PATCH 6/7] Let's not ifdef MISSIONPACK inside of ifdef MISSIONPACK --- code/cgame/cg_servercmds.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c index bff44071..cbbed53d 100644 --- a/code/cgame/cg_servercmds.c +++ b/code/cgame/cg_servercmds.c @@ -820,7 +820,6 @@ CG_PlayVoiceChat ================= */ void CG_PlayVoiceChat( bufferedVoiceChat_t *vchat ) { -#ifdef MISSIONPACK // if we are going into the intermission, don't start any voices if ( cg.intermissionStarted ) { return; @@ -845,7 +844,6 @@ void CG_PlayVoiceChat( bufferedVoiceChat_t *vchat ) { CG_Printf( "%s\n", vchat->message ); } voiceChatBuffer[cg.voiceChatBufferOut].snd = 0; -#endif } /* @@ -854,7 +852,6 @@ CG_PlayBufferedVoieChats ===================== */ void CG_PlayBufferedVoiceChats( void ) { -#ifdef MISSIONPACK if ( cg.voiceChatTime < cg.time ) { if (cg.voiceChatBufferOut != cg.voiceChatBufferIn && voiceChatBuffer[cg.voiceChatBufferOut].snd) { // @@ -864,7 +861,6 @@ void CG_PlayBufferedVoiceChats( void ) { cg.voiceChatTime = cg.time + 1000; } } -#endif } /* @@ -873,7 +869,6 @@ CG_AddBufferedVoiceChat ===================== */ void CG_AddBufferedVoiceChat( bufferedVoiceChat_t *vchat ) { -#ifdef MISSIONPACK // if we are going into the intermission, don't start any voices if ( cg.intermissionStarted ) { return; @@ -885,7 +880,6 @@ void CG_AddBufferedVoiceChat( bufferedVoiceChat_t *vchat ) { CG_PlayVoiceChat( &voiceChatBuffer[cg.voiceChatBufferOut] ); cg.voiceChatBufferOut++; } -#endif } /* @@ -894,7 +888,6 @@ CG_VoiceChatLocal ================= */ void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color, const char *cmd ) { -#ifdef MISSIONPACK char *chat; voiceChatList_t *voiceChatList; clientInfo_t *ci; @@ -934,7 +927,6 @@ void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color, CG_AddBufferedVoiceChat(&vchat); } } -#endif } /* @@ -962,7 +954,7 @@ void CG_VoiceChat( int mode ) { CG_VoiceChatLocal( mode, voiceOnly, clientNum, color, cmd ); } -#endif +#endif // MISSIONPACK /* ================= From 2292bf5bb2e3178674492d4dfd46b63515d0abe1 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Thu, 30 Apr 2015 17:14:29 -0500 Subject: [PATCH 7/7] Save bot accompany distance across map change or restart If a bot is accompanying someone before map change or restart, the bot would continue accompanying them but press up against them and orbit around them. This is caused by the bot's formation distance being 0. Save the formation distance so they maintain proper distance and do not orbit around the player. --- code/game/ai_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/game/ai_main.c b/code/game/ai_main.c index 48958d8a..b9034b88 100644 --- a/code/game/ai_main.c +++ b/code/game/ai_main.c @@ -1100,7 +1100,8 @@ void BotWriteSessionData(bot_state_t *bs) { "%i %i %i %i %i %i %i %i" " %f %f %f" " %f %f %f" - " %f %f %f", + " %f %f %f" + " %f", bs->lastgoal_decisionmaker, bs->lastgoal_ltgtype, bs->lastgoal_teammate, @@ -1117,7 +1118,8 @@ void BotWriteSessionData(bot_state_t *bs) { bs->lastgoal_teamgoal.mins[2], bs->lastgoal_teamgoal.maxs[0], bs->lastgoal_teamgoal.maxs[1], - bs->lastgoal_teamgoal.maxs[2] + bs->lastgoal_teamgoal.maxs[2], + bs->formation_dist ); var = va( "botsession%i", bs->client ); @@ -1141,7 +1143,8 @@ void BotReadSessionData(bot_state_t *bs) { "%i %i %i %i %i %i %i %i" " %f %f %f" " %f %f %f" - " %f %f %f", + " %f %f %f" + " %f", &bs->lastgoal_decisionmaker, &bs->lastgoal_ltgtype, &bs->lastgoal_teammate, @@ -1158,7 +1161,8 @@ void BotReadSessionData(bot_state_t *bs) { &bs->lastgoal_teamgoal.mins[2], &bs->lastgoal_teamgoal.maxs[0], &bs->lastgoal_teamgoal.maxs[1], - &bs->lastgoal_teamgoal.maxs[2] + &bs->lastgoal_teamgoal.maxs[2], + &bs->formation_dist ); }