commit 68e4d82

neauoire  ·  2023-08-16 21:02:01 +0000 UTC
parent 4690a11
Screen debugger forces a full screen redraw
1 files changed,  +6, -6
+6, -6
 1@@ -150,14 +150,16 @@ screen_redraw(Uxn *u)
 2 	Uint8 *fg = uxn_screen.fg, *bg = uxn_screen.bg;
 3 	Uint32 palette[16], *pixels = uxn_screen.pixels;
 4 	int i, x, y, w = uxn_screen.width, h = uxn_screen.height, x1, y1, x2, y2;
 5-	if(u->dev[0x0e]) {
 6-		screen_change(0, 0, w, h);
 7-		screen_debugger(u);
 8-	}
 9 	x1 = uxn_screen.x1;
10 	y1 = uxn_screen.y1;
11 	x2 = uxn_screen.x2 > w ? w : uxn_screen.x2;
12 	y2 = uxn_screen.y2 > h ? h : uxn_screen.y2;
13+	uxn_screen.x1 = uxn_screen.y1 = 0xffff;
14+	uxn_screen.x2 = uxn_screen.y2 = 0;
15+	if(u->dev[0x0e]) {
16+		screen_change(0, 0, w, h);
17+		screen_debugger(u);
18+	}
19 	for(i = 0; i < 16; i++)
20 		palette[i] = uxn_screen.palette[(i >> 2) ? (i >> 2) : (i & 3)];
21 	for(y = y1; y < y2; y++)
22@@ -165,8 +167,6 @@ screen_redraw(Uxn *u)
23 			i = x + y * w;
24 			pixels[i] = palette[fg[i] << 2 | bg[i]];
25 		}
26-	uxn_screen.x1 = uxn_screen.y1 = 0xffff;
27-	uxn_screen.x2 = uxn_screen.y2 = 0;
28 }
29 
30 Uint8