shithub: qk1

Download patch

ref: 16480f3c04c72437f81e807ab14d4c41119137ef
parent: 514a8b2f0585cd37d2ad9000dca4827ee4fa462d
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sat Oct 14 16:56:04 EDT 2023

yes, use locals

--- a/r_surf.c
+++ b/r_surf.c
@@ -6,9 +6,9 @@
 
 drawsurf_t	r_drawsurf;
 
-int				lightleft, sourcesstep, blocksize, sourcetstep;
+int				sourcesstep, blocksize, sourcetstep;
 int				lightdelta, lightdeltastep;
-int				lightright, lightleftstep, lightrightstep, blockdivshift;
+int				lightleftstep, lightrightstep, blockdivshift;
 unsigned		blockdivmask;
 void			*prowdestbase;
 unsigned char	*pbasesource;
@@ -31,8 +31,6 @@
 	R_DrawSurfaceBlock8_mip3
 };
 
-
-
 unsigned		blocklights[18*18];
 
 /*
@@ -295,7 +293,7 @@
 */
 void R_DrawSurfaceBlock8_mip0 (void)
 {
-	int				v, i, lightstep, lighttemp, light;
+	int				v, i, lightstep, lighttemp, light, lightleft, lightright;
 	unsigned char	*psource, *prowdest;
 
 	psource = pbasesource;
@@ -303,7 +301,6 @@
 
 	for (v=0 ; v<r_numvblocks ; v++)
 	{
-	// FIXME: make these locals?
 	// FIXME: use delta rather than both right and left, like ASM?
 		lightleft = r_lightptr[0];
 		lightright = r_lightptr[1];
@@ -354,7 +351,7 @@
 */
 void R_DrawSurfaceBlock8_mip1 (void)
 {
-	int				v, i, b, lightstep, lighttemp, light;
+	int				v, i, b, lightstep, lighttemp, light, lightleft, lightright;
 	unsigned char	pix, *psource, *prowdest;
 
 	psource = pbasesource;
@@ -362,7 +359,6 @@
 
 	for (v=0 ; v<r_numvblocks ; v++)
 	{
-	// FIXME: make these locals?
 	// FIXME: use delta rather than both right and left, like ASM?
 		lightleft = r_lightptr[0];
 		lightright = r_lightptr[1];
@@ -404,7 +400,7 @@
 */
 void R_DrawSurfaceBlock8_mip2 (void)
 {
-	int				v, i, b, lightstep, lighttemp, light;
+	int				v, i, b, lightstep, lighttemp, light, lightleft, lightright;
 	unsigned char	pix, *psource, *prowdest;
 
 	psource = pbasesource;
@@ -412,7 +408,6 @@
 
 	for (v=0 ; v<r_numvblocks ; v++)
 	{
-	// FIXME: make these locals?
 	// FIXME: use delta rather than both right and left, like ASM?
 		lightleft = r_lightptr[0];
 		lightright = r_lightptr[1];
@@ -454,7 +449,7 @@
 */
 void R_DrawSurfaceBlock8_mip3 (void)
 {
-	int				v, i, b, lightstep, lighttemp, light;
+	int				v, i, b, lightstep, lighttemp, light, lightleft, lightright;
 	unsigned char	pix, *psource, *prowdest;
 
 	psource = pbasesource;
@@ -462,7 +457,6 @@
 
 	for (v=0 ; v<r_numvblocks ; v++)
 	{
-	// FIXME: make these locals?
 	// FIXME: use delta rather than both right and left, like ASM?
 		lightleft = r_lightptr[0];
 		lightright = r_lightptr[1];