commit 481f1f2

Devine Lu Linvega  ·  2026-01-10 03:09:06 +0000 UTC
parent af0f2fa
Unrolled flipx
1 files changed,  +12, -8
+12, -8
 1@@ -622,15 +622,19 @@ screen_deo_sprite(void)
 2 			const int ch1 = *src, ch2 = is_2bpp ? (src[8] << 1) : 0;
 3 			int qx = qfx;
 4 			Uint8 *d = dst;
 5-			const Uint8 *d_end = dst + 8;
 6 			Uint8 bit = flipx ? 0x01 : 0x80;
 7-			for(; d != d_end; d++) {
 8-				const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
 9-				if(color | opaque_mask)
10-					*d = (*d & layer_mask) | table[color];
11-				if(flipx) bit <<= 1;
12-				else bit >>= 1;
13-			}
14+			if(flipx)
15+				for(int px = 0; px < 8; px++, d++) {
16+					const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
17+					if(color | opaque_mask) *d = (*d & layer_mask) | table[color];
18+					bit <<= 1;
19+				}
20+			else
21+				for(int px = 0; px < 8; px++, d++) {
22+					const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
23+					if(color | opaque_mask) *d = (*d & layer_mask) | table[color];
24+					bit >>= 1;
25+				}
26 		}
27 	}
28 	if(!screen_reqdraw) {