From 91ae73260912b512e17609ae0f949f594efe3a74 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 12 Aug 2025 17:14:05 +0200 Subject: [PATCH] objanim: renamed door open animation to allow room for more animations in different directions --- src/objanim.s | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/objanim.s b/src/objanim.s index 5057a20..34bb5ab 100644 --- a/src/objanim.s +++ b/src/objanim.s @@ -20,7 +20,7 @@ objanim_init: objanim_door_open: push de push bc - ld de, st_objanim_door_open + ld de, st_objanim_door_open_down ld hl, objanim ld bc, st_size call memcpy @@ -61,9 +61,10 @@ objanim_door_open: ret ; state function for door opening animation + ; down ; inputs: ; de: objanim -objanim_door_open_fn: +objanim_door_open_down_fn: #define TMP_Y, scratch #define TMP_X, scratch+1 @@ -94,11 +95,6 @@ objanim_door_open_fn: xor a, a ld [hl+], a ; no flags - ld de, objanim+obja_timer - ld a, [de] - dec a - ld [de], a ; timer-- - jr z, @timer_done REL ; set up second object call load_unit_obj @@ -120,11 +116,22 @@ objanim_door_open_fn: xor a, a ld [hl], a + ; check if we are done + ld de, objanim+obja_timer + ld a, [de] + dec a + ld [de], a ; timer-- + jr z, @timer_done REL ldnull bc ret @timer_done: + call door_open_done +#undefine TMP_X +#undefine TMP_Y + ; completes the door opening animation +door_open_done: ; unset pause object update ld a, [gameplay_flags] and a, ~GPF_PAUSE_UPDATE & 0xFF @@ -132,8 +139,6 @@ objanim_door_open_fn: ld bc, st_null ret -#undefine TMP_X -#undefine TMP_Y -st_objanim_door_open: - st_def 0x00, objanim_door_open_fn, st_objanim_door_open +st_objanim_door_open_down: + st_def 0x00, objanim_door_open_down_fn, st_objanim_door_open_down -- 2.30.2