commit 4e82f26
Devine Lu Linvega
·
2025-12-30 21:55:24 +0000 UTC
parent 1742132
Optimized sprites
1 files changed,
+8,
-10
+8,
-10
1@@ -601,11 +601,10 @@ screen_draw_sprite(void)
2 if(xmar2 < screen_wmar2 && ymar2 < screen_hmar2) {
3 const Uint8 *sprite = &ram[rA];
4 const Uint16 xmar = x + 8, ymar = y + 8;
5- for(ay = ymar * screen_wmar2, by = ymar2 * screen_wmar2, qy = qfy; ay < by; ay += screen_wmar2, qy += fy) {
6- const int ch1 = sprite[qy], ch2 = sprite[qy + 8] << 1;
7- Uint8 *dst = &screen_layers[xmar + ay];
8- Uint8 *end = &screen_layers[xmar2 + ay];
9- if(end == dst + 8) {
10+ if(xmar2 == xmar + 8) {
11+ for(ay = ymar * screen_wmar2, by = ymar2 * screen_wmar2, qy = qfy; ay < by; ay += screen_wmar2, qy += fy) {
12+ const int ch1 = sprite[qy], ch2 = sprite[qy + 8] << 1;
13+ Uint8 *dst = &screen_layers[xmar + ay];
14 if(opaque) {
15 o2BPP(0) o2BPP(1) o2BPP(2) o2BPP(3) o2BPP(4) o2BPP(5) o2BPP(6) o2BPP(7)
16 } else {
17@@ -622,11 +621,10 @@ screen_draw_sprite(void)
18 if(xmar2 < screen_wmar2 && ymar2 < screen_hmar2) {
19 const Uint8 *sprite = &ram[rA];
20 const Uint16 xmar = x + 8, ymar = y + 8;
21- for(ay = ymar * screen_wmar2, by = ymar2 * screen_wmar2, qy = qfy; ay < by; ay += screen_wmar2, qy += fy) {
22- const int ch1 = sprite[qy];
23- Uint8 *dst = &screen_layers[xmar + ay];
24- Uint8 *end = &screen_layers[xmar2 + ay];
25- if(end == dst + 8) {
26+ if(xmar2 == xmar + 8) {
27+ for(ay = ymar * screen_wmar2, by = ymar2 * screen_wmar2, qy = qfy; ay < by; ay += screen_wmar2, qy += fy) {
28+ const int ch1 = sprite[qy];
29+ Uint8 *dst = &screen_layers[xmar + ay];
30 if(opaque) {
31 o1BPP(0) o1BPP(1) o1BPP(2) o1BPP(3) o1BPP(4) o1BPP(5) o1BPP(6) o1BPP(7)
32 } else {