diff --git a/Makefile b/Makefile index f3ccd86c0b..9a9fb186de 100644 --- a/Makefile +++ b/Makefile @@ -1115,11 +1115,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 diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c index bff44071cb..cbbed53d81 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 /* ================= diff --git a/code/game/ai_main.c b/code/game/ai_main.c index 48958d8af1..b9034b885b 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 ); } diff --git a/code/qcommon/unzip.c b/code/qcommon/unzip.c index 4fb2d3a964..b5043c1927 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 diff --git a/code/renderergl1/tr_animation.c b/code/renderergl1/tr_animation.c index 7bcc5bdf69..b01cf81337 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 74226752e3..53e5ee9951 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; diff --git a/code/renderergl2/tr_extramath.c b/code/renderergl2/tr_extramath.c index da9a94d25d..bded75701c 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; diff --git a/code/renderergl2/tr_image.c b/code/renderergl2/tr_image.c index e0585096ed..768cce3f30 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); } }