summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-06-13 18:12:40 -0400
committerGitHub <noreply@github.com>2021-06-13 18:12:40 -0400
commit69fb670955664f9f936f7b85667238546d43fa40 (patch)
tree7c0e86feeda41327badee452bd17a1ac39cae633 /include
parentb0dfaa92be48b4dc88af0c1502689fcad7da99ea (diff)
parentb6b0062bd60eb57d66b6c79fc48bdbb55d8a5bf5 (diff)
Merge pull request #1464 from ExpoSeed/pret/map-header-flags
Change map header flags to use a bitfield
Diffstat (limited to 'include')
-rw-r--r--include/global.fieldmap.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index a3d99ee21..6bafa9747 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -142,19 +142,15 @@ struct MapHeader
/* 0x16 */ u8 weather;
/* 0x17 */ u8 mapType;
/* 0x18 */ u8 filler_18[2];
- /* 0x1A */ u8 flags;
+ // fields correspond to the arguments in the map_header_flags macro
+ /* 0x1A */ bool8 allowCycling:1;
+ bool8 allowEscaping:1; // Escape Rope and Dig
+ bool8 allowRunning:1;
+ bool8 showMapName:5; // the last 4 bits are unused
+ // but the 5 bit sized bitfield is required to match
/* 0x1B */ u8 battleType;
};
-// Flags for gMapHeader.flags, as defined in the map_header_flags macro
-#define MAP_ALLOW_CYCLING (1 << 0)
-#define MAP_ALLOW_ESCAPING (1 << 1) // Escape Rope and Dig
-#define MAP_ALLOW_RUNNING (1 << 2)
-#define MAP_SHOW_MAP_NAME (1 << 3)
-#define UNUSED_MAP_FLAGS (1 << 4 | 1 << 5 | 1 << 6 | 1 << 7)
-
-#define SHOW_MAP_NAME_ENABLED ((gMapHeader.flags & (MAP_SHOW_MAP_NAME | UNUSED_MAP_FLAGS)) == MAP_SHOW_MAP_NAME)
-
struct ObjectEvent
{