commit af0f2fa

Devine Lu Linvega  ·  2026-01-10 03:03:57 +0000 UTC
parent e4c539f
Shift bit instead of shifting value
1 files changed,  +7, -4
+7, -4
 1@@ -623,10 +623,13 @@ screen_deo_sprite(void)
 2 			int qx = qfx;
 3 			Uint8 *d = dst;
 4 			const Uint8 *d_end = dst + 8;
 5-			for(; d != d_end; d++, qx += qx_step) {
 6-				const int color = ((ch1 >> qx) & 1) | ((ch2 >> qx) & 2);
 7-				const int write = color | opaque_mask;
 8-				if(write) *d = (*d & layer_mask) | table[color];
 9+			Uint8 bit = flipx ? 0x01 : 0x80;
10+			for(; d != d_end; d++) {
11+				const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
12+				if(color | opaque_mask)
13+					*d = (*d & layer_mask) | table[color];
14+				if(flipx) bit <<= 1;
15+				else bit >>= 1;
16 			}
17 		}
18 	}