shithub: qk1

Download patch

ref: b787ae720c33b7618957ca12172319c32a3369e0
parent: 7168fb9ddc3eb22baa1845000812ddd001dbf93f
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sat Dec 16 18:23:03 EST 2023

fix a few warnings

--- a/d_scan.c
+++ b/d_scan.c
@@ -78,8 +78,8 @@
 {
 	int			count;
 	fixed16_t	snext, tnext;
-	double		sdivz, tdivz, zi, z, du, dv, spancountminus1;
-	double		sdivz16stepu, tdivz16stepu, zi16stepu;
+	float		sdivz, tdivz, zi, z, du, dv, spancountminus1;
+	float		sdivz16stepu, tdivz16stepu, zi16stepu;
 
 	r_turb_turb = sintable + ((int)(cl.time*SPEED)&(CYCLE-1));
 
@@ -178,8 +178,8 @@
 	pixel_t		*pbase, *pdest;
 	uzint		*pz;
 	fixed16_t	s, t, snext, tnext, sstep, tstep;
-	double		sdivz, tdivz, zi, z, du, dv, spancountminus1;
-	double		sdivzstepu, tdivzstepu, zistepu;
+	float		sdivz, tdivz, zi, z, du, dv, spancountminus1;
+	float		sdivzstepu, tdivzstepu, zistepu;
 
 	sstep = 0;	// keep compiler happy
 	tstep = 0;	// ditto
@@ -286,8 +286,8 @@
 {
 	int			count, spancount, izi, izistep;
 	uzint		*pz;
-	double		zi, du, dv, spancountminus1;
-	double		zistepu;
+	float		zi, spancountminus1;
+	float		zistepu;
 
 	if((r_drawflags & DRAW_BLEND) != 0)
 		return;
@@ -297,14 +297,8 @@
 
 	do{
 		pz = d_pzbuffer + d_zwidth*pspan->v + pspan->u;
-
 		count = pspan->count;
-
-		// calculate the initial s/z, t/z, 1/z, s, and t and clamp
-		du = pspan->u;
-		dv = pspan->v;
-
-		zi = d_ziorigin + dv*d_zistepv + du*d_zistepu;
+		zi = d_ziorigin + (float)pspan->v*d_zistepv + (float)pspan->u*d_zistepu;
 
 		do{
 			spancount = min(count, 16);
--- a/pr_edict.c
+++ b/pr_edict.c
@@ -836,8 +836,14 @@
 				else if(ent->alpha == 0)
 					ent->alpha = ZERO_ALPHA;
 			}else if(strcmp(keyname, "rendermode") == 0){
-				if((n = atoi(com_token)) == 5)
+				switch(atoi(com_token)){
+				case 5:
 					ent->v.effects = (int)ent->v.effects | EF_ADDITIVE;
+					break;
+				default:
+					/* FIXME(sigrid): support more? */
+					break;
+				}
 			}else{
 				Con_Printf ("ED_ParseEdict: '%s' is not a field\n", keyname);
 			}
--- a/r_fog.c
+++ b/r_fog.c
@@ -65,7 +65,7 @@
 		z = d_pzbuffer + i;
 		for(x = r_refdef.vrect.x; x < r_refdef.vrectright; x++, i++, pix++, z++){
 			if(*z >= 65536){
-				d = 65536.0 / (float)(d_pzbuffer[i] >> 16);
+				d = 65536.0 / (float)(*z >> 16);
 				d = 1.0 - exp2(-r_fog.density * d*d);
 				a = 255 * clamp(d, 0.0, 1.0);
 			}else if(*z < 0){