commit 3f0e58f
Devine Lu Linvega
·
2026-01-11 19:37:29 +0000 UTC
parent 8a3cf86
Cache value of cell instead of reading it twice
1 files changed,
+2,
-2
+2,
-2
1@@ -623,8 +623,8 @@ screen_deo_sprite(void)
2 const int bit = 1 << row;
3 const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
4 const Uint8 mask = (color | opaque_mask) ? 0xff : 0x00;
5- const Uint8 next = (*d & layer_mask) | table[color];
6- *d = (*d & ~mask) | (next & mask);
7+ const Uint8 cell = *d, next = (cell & layer_mask) | table[color];
8+ *d = (cell & ~mask) | (next & mask);
9 }
10 }
11 }