[Reverse-engineering] [th05] Bullets: Pellet delay cloud render list

Making sure that we don't ever have to iterate over the 8×8 pellet part
of the bullet array during rendering… sure, but why not give the same
optimization treatment to the 16×16 bullets?

Part of P0112, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
nmlgc 2020-08-26 23:36:47 +02:00
parent db0adbc58f
commit 6cd11b0a44
3 changed files with 19 additions and 12 deletions

View File

@ -132,6 +132,12 @@ union pellet_render_t {
} bottom;
};
#if (GAME == 5)
// Separate render list for pellets during their delay cloud stage.
extern int pellet_clouds_render_count;
extern bullet_t near *pellet_clouds_render[PELLET_COUNT];
#endif
extern int pellets_render_count;
extern pellet_render_t pellets_render[PELLET_COUNT];

View File

@ -0,0 +1,4 @@
public _pellet_bottom_col, _pellet_clouds_render, _pellet_clouds_render_count
_pellet_bottom_col dw ?
_pellet_clouds_render dw PELLET_COUNT dup(?)
_pellet_clouds_render_count dw ?

View File

@ -6970,9 +6970,9 @@ loc_10171:
; ---------------------------------------------------------------------------
loc_1018A:
mov bx, word_2CDF8
mov bx, _pellet_clouds_render_count
add bx, bx
mov si, [bx-3D50h]
mov si, _pellet_clouds_render[bx]
mov al, [si+bullet_t.spawn_state]
mov ah, 0
mov bx, (BSS_CLOUD_FRAMES / BULLET_CLOUD_CELS)
@ -6990,8 +6990,8 @@ loc_1018A:
call z_super_roll_put_tiny_16x16_raw pascal, di
loc_101BD:
mov ax, word_2CDF8
dec word_2CDF8
mov ax, _pellet_clouds_render_count
dec _pellet_clouds_render_count
or ax, ax
jnz short loc_1018A
mov ah, 0Fh
@ -14469,7 +14469,7 @@ var_2 = word ptr -2
push si
push di
mov [bp+var_2], 0
mov word_2CDF8, 0
mov _pellet_clouds_render_count, 0
mov _pellets_render_count, 0
mov si, offset _bullets[(BULLET_COUNT - 1) * size bullet_t]
cmp _bullet_clear_trigger, 0
@ -14608,10 +14608,10 @@ loc_17D36:
loc_17D3D:
cmp di, BULLET16_COUNT
jl loc_17E74
mov bx, word_2CDF8
mov bx, _pellet_clouds_render_count
add bx, bx
mov [bx-3D50h], si
inc word_2CDF8
mov _pellet_clouds_render[bx], si
inc _pellet_clouds_render_count
jmp loc_17E74
; ---------------------------------------------------------------------------
@ -28266,10 +28266,7 @@ byte_2C99C db ?
include th05/main/lasers_render[bss].asm
include th05/main/bullet/curve[bss].asm
include th04/main/item/splashes[bss].asm
public _pellet_bottom_col
_pellet_bottom_col dw ?
db 360 dup(?)
word_2CDF8 dw ?
include th05/main/bullet/pellet_r[bss].asm
include th04/main/scroll[bss].asm
word_2CE02 dw ?
word_2CE04 dw ?