shithub: tinyrend

Download patch

ref: 12bb819509f967381e2e3619734a4a4f953cea6d
parent: c6710670bb88c2e72ae0c479477b8c17c05f970d
author: rodri <rgl@antares-labs.eu>
date: Sun Nov 12 15:34:10 EST 2023

remove unnecessary cbuf2 variable.

--- a/main.c
+++ b/main.c
@@ -391,7 +391,7 @@
 	static Point3 light = {0,0,-1,0};	/* global light field */
 	Point tp;				/* texture point */
 	int i;
-	uchar cbuf[4], cbuf2[4];
+	uchar cbuf[4];
 	double z, intensity;
 
 	verts = model->vertdata[OBJVGeometric].verts;
@@ -452,11 +452,8 @@
 					tp.x = (tt.p0.x + tt.p1.x + tt.p2.x)*Dx(modeltex->r);
 					tp.y = Dy(modeltex->r)-(tt.p0.y + tt.p1.y + tt.p2.y)*Dy(modeltex->r);
 
-					unloadmemimage(modeltex, rectaddpt(Rect(0,0,1,1), tp), cbuf2, sizeof cbuf2);
 					cbuf[0] = 0xFF;
-					cbuf[1] = cbuf2[0];
-					cbuf[2] = cbuf2[1];
-					cbuf[3] = cbuf2[2];
+					unloadmemimage(modeltex, rectaddpt(Rect(0,0,1,1), tp), cbuf+1, sizeof cbuf - 1);
 				}else{
 					cbuf[0] = 0xFF;
 					cbuf[1] = 0xFF;