shithub: qk1

Download patch

ref: f048617e06d1be74a3d35f0fabf3a36527a9dfbc
parent: e82aecd0cb9cd7ba4ee1614edf8ffe8a69ad5770
author: Konstantinn Bonnet <[email protected]>
date: Tue Oct 6 02:09:45 EDT 2015

specify implied screen depth and chan

--- a/vid.c
+++ b/vid.c
@@ -132,9 +132,9 @@
 	D_InitCaches(surfcache, scachesz);
 
 	free(framebuf);
-	framebuf = emalloc(Dx(screen->r) * Dy(screen->r) * screen->depth/8 * sizeof *framebuf);
+	framebuf = emalloc(Dx(screen->r) * Dy(screen->r) * 32/8 * sizeof *framebuf);
 	vid.buffer = framebuf;
-	vid.rowbytes = Dx(screen->r) * screen->depth/8;
+	vid.rowbytes = Dx(screen->r) * 32/8;
 	vid.aspect = (float)vid.height / (float)vid.width * (320.0/240.0);
 	vid.conbuffer = vid.buffer;
 	vid.conrowbytes = vid.rowbytes;
@@ -142,7 +142,7 @@
 	vid.conheight = vid.height;
 	center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2));
 	freeimage(fbim);
-	if((fbim = allocimage(display, Rect(0, 0, vid.width, vid.height), screen->chan, 1, DNofill)) == nil)
+	if((fbim = allocimage(display, Rect(0, 0, vid.width, vid.height), XRGB32, 1, DNofill)) == nil)
 		sysfatal("resetfb:allocimage: %r");
 }