summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-07-11 09:45:06 -0500
committerMarcus Huderle <huderlem@gmail.com>2018-07-11 09:45:06 -0500
commit4fbad04ec2de7ca2529620f292356f1916b4d59d (patch)
tree5b625fd6c86d633d87e7a2363fac690aa12365d2 /include
parentf96749deb674a2ae784708ee95c778585330b6ce (diff)
Use bg event type constants and remove unneeded bg_event argument
Diffstat (limited to 'include')
-rwxr-xr-xinclude/constants/bg_event_constants.h13
-rw-r--r--include/macros/map.inc10
2 files changed, 18 insertions, 5 deletions
diff --git a/include/constants/bg_event_constants.h b/include/constants/bg_event_constants.h
new file mode 100755
index 000000000..a915bc509
--- /dev/null
+++ b/include/constants/bg_event_constants.h
@@ -0,0 +1,13 @@
+#ifndef GUARD_CONSTANTS_BG_EVENT_H
+#define GUARD_CONSTANTS_BG_EVENT_H
+
+#define BG_EVENT_PLAYER_FACING_ANY 0
+#define BG_EVENT_PLAYER_FACING_NORTH 1
+#define BG_EVENT_PLAYER_FACING_SOUTH 2
+#define BG_EVENT_PLAYER_FACING_EAST 3
+#define BG_EVENT_PLAYER_FACING_WEST 4
+
+#define BG_EVENT_HIDDEN_ITEM 7
+#define BG_EVENT_SECRET_BASE 8
+
+#endif // GUARD_CONSTANTS_BG_EVENT_H
diff --git a/include/macros/map.inc b/include/macros/map.inc
index bc54271d4..5a4b550b0 100644
--- a/include/macros/map.inc
+++ b/include/macros/map.inc
@@ -46,10 +46,10 @@
coord_event \x, \y, \height, 0, \weather, 0, 0, 0x0
.endm
- .macro bg_event x, y, byte, kind, word, arg6, arg7, arg8
+ .macro bg_event x, y, elevation, kind, arg6, arg7, arg8
.2byte \x, \y
- .byte \byte, \kind
- .2byte \word
+ .byte \elevation, \kind
+ .2byte 0
.if \kind < 5
.4byte \arg6
.else
@@ -60,11 +60,11 @@
.endm
.macro bg_hidden_item_event x, y, height, item, flag
- bg_event \x, \y, \height, 7, 0, \item, ((\flag) - FLAG_HIDDEN_ITEMS_START), 0
+ bg_event \x, \y, \height, 7, \item, ((\flag) - FLAG_HIDDEN_ITEMS_START), 0
.endm
.macro bg_secret_base_event x, y, height, secret_base_id
- bg_event \x, \y, \height, 8, 0, \secret_base_id, 0, 0
+ bg_event \x, \y, \height, 8, \secret_base_id, 0, 0
.endm
.macro map_events npcs, warps, traps, signs