shithub: pplay

Download patch

ref: 9dc9a4c9b250bbd2317f46f81ae2e8e42b3f3d2b
parent: d7e430e8ebf3a3e601ff7fec890904908daea16d
author: qwx <[email protected]>
date: Sat Jan 7 19:27:07 EST 2023

saner colors

--- a/draw.c
+++ b/draw.c
@@ -14,6 +14,7 @@
 	Cline,
 	Cloop,
 	Cchunk,
+	Ctext,
 	Ncol,
 };
 static Image *col[Ncol];
@@ -169,7 +170,7 @@
 			th, tm, ts, tμ, dot.to/4);
 	}else
 		seprint(p, s+sizeof s, "∞");
-	string(screen, statp, col[Cline], ZP, font, s);
+	string(screen, statp, col[Ctext], ZP, font, s);
 }
 
 static void
@@ -369,17 +370,18 @@
 }
 
 void
-initdrw(void)
+initdrw(int fuckit)
 {
 	if(initdraw(nil, nil, "pplay") < 0)
 		sysfatal("initdraw: %r");
 	display->locking = 1;
 	unlockdisplay(display);
-	col[Cbg] = eallocimage(Rect(0,0,1,1), 1, DBlack);
-	col[Csamp] = eallocimage(Rect(0,0,1,1), 1, 0x440000FF);
-	col[Cline] = eallocimage(Rect(0,0,1,1), 1, 0x884400FF);
-	col[Cloop] = eallocimage(Rect(0,0,1,1), 1, 0x777777FF);
-	col[Cchunk] = eallocimage(Rect(0,0,1,1), 1, 0xBBBB00FF);
+	col[Cbg] = fuckit ? display->white : display->black;
+	col[Csamp] = eallocimage(Rect(0,0,1,1), 1, fuckit ? 0x555555FF : 0x2A2A2AFF);
+	col[Ctext] = eallocimage(Rect(0,0,1,1), 1, fuckit ? DBlack : 0xBBBBBBFF);
+	col[Cline] = eallocimage(Rect(0,0,1,1), 1, fuckit ? DPaleyellow: 0xEEA000FF);
+	col[Cloop] = eallocimage(Rect(0,0,1,1), 1, fuckit ? DPurpleblue: 0x8888CCFF);
+	col[Cchunk] = eallocimage(Rect(0,0,1,1), 1, 0xEE0000FF);
 	if((drawc = chancreate(sizeof(ulong), 4)) == nil)
 		sysfatal("chancreate: %r");
 	if(proccreate(drawsamps, nil, mainstacksize) < 0)
--- a/fns.h
+++ b/fns.h
@@ -24,7 +24,7 @@
 void	setofs(usize);
 void	setjump(usize);
 void	redraw(int);
-void	initdrw(void);
+void	initdrw(int);
 int	advance(Dot*, usize);
 int	jump(usize);
 Chunk*	p2c(usize, usize*);
--- a/pplay.c
+++ b/pplay.c
@@ -78,7 +78,7 @@
 static void
 usage(void)
 {
-	fprint(2, "usage: %s [-Dcs] [pcm]\n", argv0);
+	fprint(2, "usage: %s [-Dbcs] [pcm]\n", argv0);
 	threadexits("usage");
 }
 
@@ -85,13 +85,15 @@
 void
 threadmain(int argc, char **argv)
 {
-	int fd;
+	int fd, notriob;
 	char *p;
 	Mouse mo;
 	Rune r;
 
+	notriob = 0;
 	ARGBEGIN{
 	case 'D': debug = 1; debugdraw = 1; break;
+	case 'b': notriob = 1; break;
 	case 'c': cat = 1; break;
 	case 's': stereo = 1; break;
 	default: usage();
@@ -103,7 +105,7 @@
 	if(loadin(fd) < 0)
 		sysfatal("inittrack: %r");
 	close(fd);
-	initdrw();
+	initdrw(notriob);
 	if((kc = initkeyboard(nil)) == nil)
 		sysfatal("initkeyboard: %r");
 	if((mc = initmouse(nil, screen)) == nil)