shithub: patch

ref: 25c260fde5a5ee9ca01bd805e88e89f0f508f803
dir: /doom-naivescaleup/

View raw version
ups max scale in an idiotic way

diff -r 7ee51d8d1eb9 sys/src/games/doom/i_video.c
--- a/sys/src/games/doom/i_video.c	Thu May 11 19:34:54 2017 +0000
+++ b/sys/src/games/doom/i_video.c	Mon May 15 14:46:26 2017 +0200
@@ -91,7 +91,7 @@
 	Rectangle r;
 	int y, scale;
 	uchar *s, *e, *d, *m;
-	uchar buf[SCREENWIDTH*3*4];
+	uchar buf[SCREENWIDTH*3*12];
 
 	if(resized){
 		resized = 0;
@@ -108,8 +108,8 @@
 	scale = Dx(screen->r)/SCREENWIDTH;
 	if(scale <= 0)
 		scale = 1;
-	else if(scale > 4)
-		scale = 4;
+	else if(scale > 12)
+		scale = 12;
 
 	/* where to draw the scaled row */
 	r = rectsubpt(rectaddpt(Rect(0, 0, scale*SCREENWIDTH, scale), center),
@@ -127,6 +127,38 @@
 		for(; s < e; s++){
 			m = &cmap[*s * 3];
 			switch(scale){
+			case 12:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
+			case 11:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
+			case 10:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
+			case 9:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
+			case 8:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
+			case 7:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
+			case 6:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
+			case 5:
+				*d++ = m[2];
+				*d++ = m[1];
+				*d++ = m[0];
 			case 4:
 				*d++ = m[2];
 				*d++ = m[1];