From: Lukas Krickl Date: Sun, 26 Jan 2025 18:29:50 +0000 (+0100) Subject: animation: reduced walk animation call to a single function instead of 4 X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=7055d722c4fdd961ab0465a67bb603154c2423b5;p=gbrg%2F.git animation: reduced walk animation call to a single function instead of 4 --- diff --git a/src/animation.s b/src/animation.s index 6f482b7..9df3eb3 100644 --- a/src/animation.s +++ b/src/animation.s @@ -8,30 +8,19 @@ ; bc: current animation ptr animation_table: dw anim_nop - dw anim_walk_up - dw anim_walk_down - dw anim_walk_left - dw anim_walk_right + dw anim_walk_simple ; empty animation used as default value anim_nop: ret - ; anim walk_ + ; anim walk_simple ; inputs: ; anim_p0/p1: ptr to y/x position + ; anim_p2: direction -anim_walk_up: - ret - -anim_walk_right: - ret - -anim_walk_left: - ret - -anim_walk_down: +anim_walk_simple: ret diff --git a/src/defs.s b/src/defs.s index 2285aed..73d0336 100644 --- a/src/defs.s +++ b/src/defs.s @@ -203,10 +203,7 @@ ; animation table entries .se 0 .de ANIM_TNOP, 1 -.de ANIM_TWALK_UP, 1 -.de ANIM_TWALK_DOWN, 1 -.de ANIM_TWALK_LEFT, 1 -.de ANIM_TWALK_RIGHT, 1 +.de ANIM_TWALK_SIMPLE, 1 ; anim entry struct .se 0