shithub: pplay

Download patch

ref: b4ff7edab93074c22d578cae30e8759278aeed09
parent: b2aa6ca19cc28e5e0f9811b3692cd556159b8c6e
author: qwx <[email protected]>
date: Thu Nov 17 07:26:43 EST 2022

add a configurable background

--- a/draw.c
+++ b/draw.c
@@ -6,6 +6,7 @@
 #include "fns.h"
 
 enum{
+	Cbg,
 	Csamp,
 	Cline,
 	Cloop,
@@ -77,7 +78,7 @@
 			sbufsz = T;
 		}
 		lockdisplay(display);
-		draw(viewbg, viewbg->r, display->black, nil, ZP);
+		draw(viewbg, viewbg->r, col[Cbg], nil, ZP);
 		unlockdisplay(display);
 		d.pos = views;
 		m = viewe - views;
@@ -332,10 +333,11 @@
 		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, 0x777700FF);
+	col[Cchunk] = eallocimage(Rect(0,0,1,1), 1, 0xBBBB00FF);
 	if((drawc = chancreate(sizeof(ulong), 4)) == nil)
 		sysfatal("chancreate: %r");
 	if(proccreate(drawsamps, nil, mainstacksize) < 0)