summaryrefslogtreecommitdiff
path: root/include/field_map_obj.h
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-05-22 14:46:28 -0400
committerscnorton <scnorton@biociphers.org>2017-05-22 14:46:28 -0400
commit1751ad0b6723c6deb4ec4d7f5d949278c76c8e66 (patch)
treeeba89d52e121d7df3f4228cf858739b8d3769d9f /include/field_map_obj.h
parentbb0c630a77b16b225fec613ba426bec9b9b3a556 (diff)
Fix building. Again.
Diffstat (limited to 'include/field_map_obj.h')
-rw-r--r--include/field_map_obj.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/field_map_obj.h b/include/field_map_obj.h
index 4f9b6f5af..00fda8358 100644
--- a/include/field_map_obj.h
+++ b/include/field_map_obj.h
@@ -3,6 +3,29 @@
#include "sprite.h"
+#define fieldmap_object_cb(setup, callback, table) \
+extern u8 (*const table[])(struct MapObject *, struct Sprite *);\
+static u8 callback(struct MapObject *, struct Sprite *);\
+void setup(struct Sprite *sprite)\
+{\
+ meta_step(&gMapObjects[sprite->data0], sprite, callback);\
+}\
+static u8 callback(struct MapObject *mapObject, struct Sprite *sprite)\
+{\
+ return table[sprite->data1](mapObject, sprite);\
+}
+
+#define fieldmap_object_null_cb(setup, callback) \
+static u8 callback(struct MapObject *, struct Sprite *);\
+void setup(struct Sprite *sprite)\
+{\
+ meta_step(&gMapObjects[sprite->data0], sprite, callback);\
+}\
+static u8 callback(struct MapObject *mapObject, struct Sprite *sprite)\
+{\
+ return 0;\
+}
+
void sub_805C058(struct MapObject *mapObject, s16 a, s16 b);
void FieldObjectSetDirection(struct MapObject *pObject, u8 unk_18);
void MoveCoords(u8 direction, s16 *x, s16 *y);