projects
/
gbrg
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6afb58d
)
animation: reduced walk animation call to a single function instead of 4
author
Lukas Krickl
<lukas@krickl.dev>
Sun, 26 Jan 2025 18:29:50 +0000
(19:29 +0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Sun, 26 Jan 2025 18:29:50 +0000
(19:29 +0100)
src/animation.s
patch
|
blob
|
history
src/defs.s
patch
|
blob
|
history
diff --git
a/src/animation.s
b/src/animation.s
index 6f482b7e16c9d26932d57b6eec5a6e3ebc8b3939..9df3eb3e9da9343eacf59932e67131b8633195a1 100644
(file)
--- 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_
<direction>
+ ; 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 2285aed5fe19ef18a9fb4eee7df87dadf7ca1ef5..73d0336380a26544c217ae550c6028b8dc3ecd68 100644
(file)
--- 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