commit a207a93
Devine Lu Linvega
·
2025-12-31 00:58:09 +0000 UTC
parent e2c2b7c
Removed math from tight loop
1 files changed,
+6,
-6
+6,
-6
1@@ -613,12 +613,12 @@ screen_draw_sprite(void)
2 for(i = 0; i <= rML; i++, x += dyx, y += dxy, rA += addr_incr) {
3 const Uint16 xmar2 = x + 16, ymar2 = y + 16, xmar = x + 8;
4 if(xmar2 == xmar + 8 && xmar2 < screen_wmar2 && ymar2 < screen_hmar2) {
5- const Uint8 *sprite = &ram[rA];
6 const Uint16 ymar = y + 8;
7 const int height = ymar2 - ymar;
8 Uint8 *dst = &screen_layers[xmar + ymar * screen_wmar2];
9- for(row = 0, qy = qfy; row < height; row++, dst += screen_wmar2, qy += fy) {
10- const int ch1 = sprite[qy], ch2 = sprite[qy + 8] << 1;
11+ Uint8 *sch1 = &ram[rA + qfy], *sch2 = sch1 + 8;
12+ for(row = 0; row < height; row++, dst += screen_wmar2, sch1 += fy, sch2 += fy) {
13+ const int ch1 = *sch1, ch2 = *sch2 << 1;
14 int qx = qfx;
15 if(opaque)
16 PUT_PIXELS(n, 1, 1, ch1, ch2, qx)
17@@ -632,12 +632,12 @@ screen_draw_sprite(void)
18 for(i = 0; i <= rML; i++, x += dyx, y += dxy, rA += addr_incr) {
19 const Uint16 xmar2 = x + 16, ymar2 = y + 16, xmar = x + 8;
20 if(xmar2 == xmar + 8 && xmar2 < screen_wmar2 && ymar2 < screen_hmar2) {
21- const Uint8 *sprite = &ram[rA];
22 const Uint16 ymar = y + 8;
23 const int height = ymar2 - ymar;
24 Uint8 *dst = &screen_layers[xmar + ymar * screen_wmar2];
25- for(row = 0, qy = qfy; row < height; row++, dst += screen_wmar2, qy += fy) {
26- const int ch1 = sprite[qy];
27+ Uint8 *sch1 = &ram[rA + qfy];
28+ for(row = 0; row < height; row++, dst += screen_wmar2, sch1 += fy) {
29+ const int ch1 = *sch1;
30 int qx = qfx;
31 if(opaque)
32 PUT_PIXELS(n, 1, 0, ch1, 0, qx)