[ioquake3] 01/04: Imported Upstream version 1.36+u20150412+dfsg1

Simon McVittie smcv at debian.org
Sun May 3 20:54:17 UTC 2015


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository ioquake3.

commit fe3418c6f3652ad91cea5231c59426d771f9206a
Author: Simon McVittie <smcv at debian.org>
Date:   Wed Apr 29 09:30:26 2015 +0100

    Imported Upstream version 1.36+u20150412+dfsg1
---
 Makefile                        |  9 ++++-----
 code/cgame/cg_draw.c            | 21 +++++++++++----------
 code/game/ai_dmq3.c             |  1 +
 code/qcommon/common.c           |  2 +-
 code/qcommon/unzip.c            |  6 ++++++
 code/qcommon/vm_x86.c           |  7 ++++---
 code/renderergl1/tr_animation.c |  2 +-
 code/renderergl2/tr_animation.c |  2 +-
 code/renderergl2/tr_backend.c   | 17 ++---------------
 code/renderergl2/tr_extramath.c |  2 +-
 code/renderergl2/tr_image.c     |  2 +-
 code/renderergl2/tr_shade.c     | 30 +++++++++++++++++++-----------
 12 files changed, 52 insertions(+), 49 deletions(-)

diff --git a/Makefile b/Makefile
index d0d2007..b6796f6 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
diff --git a/code/cgame/cg_draw.c b/code/cgame/cg_draw.c
index e9c7d4d..cb914c9 100644
--- a/code/cgame/cg_draw.c
+++ b/code/cgame/cg_draw.c
@@ -679,6 +679,11 @@ static float CG_DrawAttacker( float y ) {
 		return y;
 	}
 
+	if ( !cgs.clientinfo[clientNum].infoValid ) {
+		cg.attackerTime = 0;
+		return y;
+	}
+
 	t = cg.time - cg.attackerTime;
 	if ( t > ATTACKER_HEAD_TIME ) {
 		cg.attackerTime = 0;
@@ -1899,6 +1904,8 @@ static void CG_DrawCrosshair(void)
 	trap_R_DrawStretchPic( x + cg.refdef.x + 0.5 * (cg.refdef.width - w), 
 		y + cg.refdef.y + 0.5 * (cg.refdef.height - h), 
 		w, h, 0, 0, 1, 1, hShader );
+
+	trap_R_SetColor( NULL );
 }
 
 /*
@@ -2298,8 +2305,7 @@ static void CG_DrawProxWarning( void ) {
 	char s [32];
 	int			w;
   static int proxTime;
-  static int proxCounter;
-  static int proxTick;
+  int proxTick;
 
 	if( !(cg.snap->ps.eFlags & EF_TICKING ) ) {
     proxTime = 0;
@@ -2307,17 +2313,12 @@ static void CG_DrawProxWarning( void ) {
 	}
 
   if (proxTime == 0) {
-    proxTime = cg.time + 5000;
-    proxCounter = 5;
-    proxTick = 0;
+    proxTime = cg.time;
   }
 
-  if (cg.time > proxTime) {
-    proxTick = proxCounter--;
-    proxTime = cg.time + 1000;
-  }
+  proxTick = 10 - ((cg.time - proxTime) / 1000);
 
-  if (proxTick != 0) {
+  if (proxTick > 0 && proxTick <= 5) {
     Com_sprintf(s, sizeof(s), "INTERNAL COMBUSTION IN: %i", proxTick);
   } else {
     Com_sprintf(s, sizeof(s), "YOU HAVE BEEN MINED");
diff --git a/code/game/ai_dmq3.c b/code/game/ai_dmq3.c
index 7248645..7574922 100644
--- a/code/game/ai_dmq3.c
+++ b/code/game/ai_dmq3.c
@@ -2876,6 +2876,7 @@ float BotEntityVisible(int viewer, vec3_t eye, vec3_t viewangles, float fov, int
 		BotAI_Trace(&trace, start, NULL, NULL, end, passent, contents_mask);
 		//if water was hit
 		waterfactor = 1.0;
+		//note: trace.contents is always 0, see BotAI_Trace
 		if (trace.contents & (CONTENTS_LAVA|CONTENTS_SLIME|CONTENTS_WATER)) {
 			//if the water surface is translucent
 			if (1) {
diff --git a/code/qcommon/common.c b/code/qcommon/common.c
index 3f06c75..c72ae37 100644
--- a/code/qcommon/common.c
+++ b/code/qcommon/common.c
@@ -3552,7 +3552,7 @@ void Com_RandomBytes( byte *string, int len )
 
 	Com_Printf( "Com_RandomBytes: using weak randomization\n" );
 	for( i = 0; i < len; i++ )
-		string[i] = (unsigned char)( rand() % 255 );
+		string[i] = (unsigned char)( rand() % 256 );
 }
 
 
diff --git a/code/qcommon/unzip.c b/code/qcommon/unzip.c
index 4fb2d3a..b5043c1 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/qcommon/vm_x86.c b/code/qcommon/vm_x86.c
index 77aba05..3ec42ee 100644
--- a/code/qcommon/vm_x86.c
+++ b/code/qcommon/vm_x86.c
@@ -412,23 +412,24 @@ static void DoSyscall(void)
 
 	if(vm_syscallNum < 0)
 	{
-		int *data;
+		int *data, *ret;
 #if idx64
 		int index;
 		intptr_t args[MAX_VMSYSCALL_ARGS];
 #endif
 		
 		data = (int *) (savedVM->dataBase + vm_programStack + 4);
+		ret = &vm_opStackBase[vm_opStackOfs + 1];
 
 #if idx64
 		args[0] = ~vm_syscallNum;
 		for(index = 1; index < ARRAY_LEN(args); index++)
 			args[index] = data[index];
 			
-		vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall(args);
+		*ret = savedVM->systemCall(args);
 #else
 		data[0] = ~vm_syscallNum;
-		vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall((intptr_t *) data);
+		*ret = savedVM->systemCall((intptr_t *) data);
 #endif
 	}
 	else
diff --git a/code/renderergl1/tr_animation.c b/code/renderergl1/tr_animation.c
index 7bcc5bd..b01cf81 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 7422675..53e5ee9 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_backend.c b/code/renderergl2/tr_backend.c
index e74f8f2..c8c7200 100644
--- a/code/renderergl2/tr_backend.c
+++ b/code/renderergl2/tr_backend.c
@@ -127,25 +127,12 @@ void GL_Cull( int cullType ) {
 	} 
 	else 
 	{
-		qboolean cullFront;
+		qboolean cullFront = (cullType == CT_FRONT_SIDED);
 
 		if ( glState.faceCulling == CT_TWO_SIDED )
-		{
 			qglEnable( GL_CULL_FACE );
-		}
-
-		cullFront = (cullType == CT_FRONT_SIDED);
-		if ( backEnd.viewParms.isMirror )
-		{
-			cullFront = !cullFront;
-		}
-
-		if ( backEnd.currentEntity && backEnd.currentEntity->mirrored )
-		{
-			cullFront = !cullFront;
-		}
 
-		if (glState.faceCullFront != cullFront)
+		if ( glState.faceCullFront != cullFront )
 			qglCullFace( cullFront ? GL_FRONT : GL_BACK );
 
 		glState.faceCullFront = cullFront;
diff --git a/code/renderergl2/tr_extramath.c b/code/renderergl2/tr_extramath.c
index da9a94d..bded757 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 e95b559..768cce3 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, DEFAULT_SIZE, DEFAULT_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);
 		}
 	}
 
diff --git a/code/renderergl2/tr_shade.c b/code/renderergl2/tr_shade.c
index 70b4353..0a652fb 100644
--- a/code/renderergl2/tr_shade.c
+++ b/code/renderergl2/tr_shade.c
@@ -1505,20 +1505,28 @@ void RB_StageIteratorGeneric( void )
 	//
 	// set face culling appropriately
 	//
-	if ((backEnd.viewParms.flags & VPF_DEPTHSHADOW))
+	if (input->shader->cullType == CT_TWO_SIDED)
 	{
-		//GL_Cull( CT_TWO_SIDED );
-		
-		if (input->shader->cullType == CT_TWO_SIDED)
-			GL_Cull( CT_TWO_SIDED );
-		else if (input->shader->cullType == CT_FRONT_SIDED)
-			GL_Cull( CT_BACK_SIDED );
-		else
-			GL_Cull( CT_FRONT_SIDED );
-		
+		GL_Cull( CT_TWO_SIDED );
 	}
 	else
-		GL_Cull( input->shader->cullType );
+	{
+		qboolean cullFront = (input->shader->cullType == CT_FRONT_SIDED);
+
+		if ( backEnd.viewParms.flags & VPF_DEPTHSHADOW )
+			cullFront = !cullFront;
+
+		if ( backEnd.viewParms.isMirror )
+			cullFront = !cullFront;
+
+		if ( backEnd.currentEntity && backEnd.currentEntity->mirrored )
+			cullFront = !cullFront;
+
+		if (cullFront)
+			GL_Cull( CT_FRONT_SIDED );
+		else
+			GL_Cull( CT_BACK_SIDED );
+	}
 
 	// set polygon offset if necessary
 	if ( input->shader->polygonOffset )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list