shithub: sce

Download patch

ref: 57d547f1bbfca33c49e10bcf4d55e6fba2e47067
parent: 60b737872dfc9fe601041d6a225de1072f020067
author: qwx <qwx@sciops.net>
date: Tue Jun 8 22:09:05 EDT 2021

vspr: add -c for sprites without team colors

--- a/utils/vspr.c
+++ b/utils/vspr.c
@@ -19,7 +19,7 @@
 QLock pauselck;
 int Δt = 1000;
 Point pan, center, shadofs;
-int frm, nfrm, rot, nrot, cansz;
+int frm, nfrm, rot, nrot, nspr, cansz;
 char *name;
 Image *canvas, *gridcol, *selcol, *bgcol, **imtab, **shtab;
 
@@ -55,7 +55,7 @@
 		draw(canvas, rectaddpt(us->r, addpt(o, shadofs)), us, us, us->r.min);
 	}
 	r = ui->r;
-	r.max.y = r.min.y + Dy(r) / Nspr;
+	r.max.y = r.min.y + Dy(r) / nspr;
 	draw(canvas, rectaddpt(r, o), ui, ui, ui->r.min);
 	for(n=Nodesz; n<cansz; n+=Nodesz){
 		line(canvas, Pt(n,0), Pt(n,canvas->r.max.y), 0, 0, 0, gridcol, ZP);
@@ -136,7 +136,7 @@
 void
 usage(void)
 {
-	fprint(2, "usage: %s [-rs] name frame..\n", argv0);
+	fprint(2, "usage: %s [-crs] name frame..\n", argv0);
 	threadexits("usage");
 }
 
@@ -150,7 +150,9 @@
 
 	shad = 1;
 	nrot = Nrot;
+	nspr = Nspr;
 	ARGBEGIN{
+	case 'c': nspr = 1; break;
 	case 'r': nrot = 1; break;
 	case 's': shad = 0; break;
 	default: usage();