summaryrefslogtreecommitdiff
path: root/src/event_object_movement.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/event_object_movement.c')
-rw-r--r--src/event_object_movement.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/event_object_movement.c b/src/event_object_movement.c
index cd5a547a9..e509c7738 100644
--- a/src/event_object_movement.c
+++ b/src/event_object_movement.c
@@ -27,6 +27,28 @@
// this file was known as evobjmv.c in Game Freak's original source
+#define movement_type_def(setup, table) \
+static u8 setup##_callback(struct EventObject *, struct Sprite *);\
+void setup(struct Sprite *sprite)\
+{\
+ UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\
+}\
+static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\
+{\
+ return table[sprite->data[1]](eventObject, sprite);\
+}
+
+#define movement_type_empty_callback(setup) \
+static u8 setup##_callback(struct EventObject *, struct Sprite *);\
+void setup(struct Sprite *sprite)\
+{\
+ UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\
+}\
+static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\
+{\
+ return 0;\
+}
+
EWRAM_DATA u8 sCurrentReflectionType = 0;
EWRAM_DATA u16 sCurrentSpecialObjectPaletteTag = 0;
EWRAM_DATA struct LockedAnimEventObjects *gLockedAnimEventObjects = {0};