commit a5ea25c

Devine Lu Linvega  ·  2024-11-25 19:40:44 +0000 UTC
parent 43c4e0a
(screen) Cleanup
1 files changed,  +6, -6
+6, -6
 1@@ -31,9 +31,9 @@ static Uint8 blending[4][16] = {
 2 static void
 3 screen_2bpp(Uint8 *layer, Uint8 *addr, Uint16 x1, Uint16 y1, Uint16 blend, int fx, int fy)
 4 {
 5-	int x, y, qx, qy, opaque = (blend % 5), length = MAR2(uxn_screen.width);
 6-	for(y = y1, qy = fy < 0 ? 7 : 0; y < y1 + 8; y++, qy += fy) {
 7-		int ch1 = addr[qy], ch2 = addr[qy + 8] << 1, row = y * length;
 8+	int x, y, qx, qy, opaque = blend % 5, length = MAR2(uxn_screen.width), row = y1 * length;
 9+	for(y = y1, qy = fy < 0 ? 7 : 0; y < y1 + 8; y++, qy += fy, row += length) {
10+		int ch1 = addr[qy], ch2 = addr[qy + 8] << 1;
11 		for(x = x1, qx = fx > 0 ? 7 : 0; x < x1 + 8; x++, qx -= fx) {
12 			int color = ((ch1 >> qx) & 1) | ((ch2 >> qx) & 2);
13 			if(opaque || color)
14@@ -45,9 +45,9 @@ screen_2bpp(Uint8 *layer, Uint8 *addr, Uint16 x1, Uint16 y1, Uint16 blend, int f
15 static void
16 screen_1bpp(Uint8 *layer, Uint8 *addr, Uint16 x1, Uint16 y1, Uint16 blend, int fx, int fy)
17 {
18-	int x, y, qx, qy, opaque = (blend % 5), length = MAR2(uxn_screen.width);
19-	for(y = y1, qy = fy < 0 ? 7 : 0; y < y1 + 8; y++, qy += fy) {
20-		int ch1 = addr[qy], row = y * length;
21+	int x, y, qx, qy, opaque = blend % 5, length = MAR2(uxn_screen.width), row = y1 * length;
22+	for(y = y1, qy = fy < 0 ? 7 : 0; y < y1 + 8; y++, qy += fy, row += length) {
23+		int ch1 = addr[qy];
24 		for(x = x1, qx = fx > 0 ? 7 : 0; x < x1 + 8; x++, qx -= fx) {
25 			int color = (ch1 >> qx) & 1;
26 			if(opaque || color)