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
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
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
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
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