commit 80f3b51

Devine Lu Linvega  ·  2025-08-13 23:27:26 +0000 UTC
parent 369c996
Changed direction of blending table
1 files changed,  +21, -7
+21, -7
 1@@ -422,11 +422,25 @@ typedef struct UxnScreen {
 2 
 3 static unsigned int screen_vector;
 4 static UxnScreen uxn_screen;
 5-static const Uint8 blending[4][16] = {
 6-	{0, 0, 0, 0, 1, 0, 1, 1, 2, 2, 0, 2, 3, 3, 3, 0},
 7-	{0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3},
 8-	{1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 1},
 9-	{2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2}};
10+
11+static const Uint8 blending[16][4] = {
12+	{0, 0, 1, 2},
13+	{0, 1, 2, 3},
14+	{0, 2, 3, 1},
15+	{0, 3, 1, 2},
16+	{1, 0, 1, 2},
17+	{0, 1, 2, 3},
18+	{1, 2, 3, 1},
19+	{1, 3, 1, 2},
20+	{2, 0, 1, 2},
21+	{2, 1, 2, 3},
22+	{0, 2, 3, 1},
23+	{2, 3, 1, 2},
24+	{3, 0, 1, 2},
25+	{3, 1, 2, 3},
26+	{3, 2, 3, 1},
27+	{0, 3, 1, 2},
28+};
29 
30 void emu_resize(void);
31 
32@@ -571,7 +585,7 @@ screen_draw_sprite(void)
33 						const int color = ((ch1 >> qx) & 1) | ((ch2 >> qx) & 2);
34 						if(opaque || color) {
35 							const int src = uxn_screen.bg[ax];
36-							const int clr = blending[color][blend];
37+							const int clr = blending[blend][color];
38 							uxn_screen.bg[ax] = above ? (src & 0x3) | clr << 2 : (src & 0xc) | clr;
39 						}
40 					}
41@@ -592,7 +606,7 @@ screen_draw_sprite(void)
42 						const int color = (ch1 >> qx) & 1;
43 						if(opaque || color) {
44 							const int src = uxn_screen.bg[ax];
45-							const int clr = blending[color][blend];
46+							const int clr = blending[blend][color];
47 							uxn_screen.bg[ax] = above ? (src & 0x3) | clr << 2 : (src & 0xc) | clr;
48 						}
49 					}