shithub: libgraphics

Download patch

ref: 32219aaa35b07d6abceb7df9f802c9758b53eb72
parent: c69735e24f7c5926ed63ff8c5292be282aa8b240
author: rodri <rgl@antares-labs.eu>
date: Sun Jun 16 05:58:28 EDT 2024

render: don't overwrite the vertex colors with white. report alien prims.

--- a/render.c
+++ b/render.c
@@ -227,6 +227,7 @@
 				delvattrs(&fsp.v);
 			}
 		break;
+	default: sysfatal("alien primitive detected");
 	}
 }
 
@@ -326,7 +327,6 @@
 			memmove(p, ep, sizeof *p);
 			switch(ep->type){
 			case PPoint:
-				p[0].v[0].c = Pt3(1,1,1,1);
 				p[0].v[0].mtl = ep->mtl;
 				p[0].v[0].attrs = nil;
 				p[0].v[0].nattrs = 0;
@@ -361,7 +361,6 @@
 				break;
 			case PLine:
 				for(i = 0; i < 2; i++){
-					p[0].v[i].c = Pt3(1,1,1,1);
 					p[0].v[i].mtl = ep->mtl;
 					p[0].v[i].attrs = nil;
 					p[0].v[i].nattrs = 0;
@@ -404,7 +403,6 @@
 				break;
 			case PTriangle:
 				for(i = 0; i < 3; i++){
-					p[0].v[i].c = Pt3(1,1,1,1);
 					p[0].v[i].mtl = p->mtl;
 					p[0].v[i].attrs = nil;
 					p[0].v[i].nattrs = 0;
@@ -455,6 +453,7 @@
 					delvattrs(&p[np].v[2]);
 				}
 				break;
+			default: sysfatal("alien primitive detected");
 			}
 		}
 		params->job->times.Tn.t1 = nanosec();