summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dungeon_ai_items.h2
-rw-r--r--include/dungeon_entity.h2
-rw-r--r--include/dungeon_global_data.h5
-rw-r--r--include/dungeon_pokemon_sprites.h2
-rw-r--r--include/dungeon_range.h9
-rw-r--r--include/map.h23
-rw-r--r--include/position.h16
7 files changed, 40 insertions, 19 deletions
diff --git a/include/dungeon_ai_items.h b/include/dungeon_ai_items.h
index f4effd2..676200a 100644
--- a/include/dungeon_ai_items.h
+++ b/include/dungeon_ai_items.h
@@ -2,7 +2,7 @@
#define GUARD_DUNGEON_AI_ITEMS_H
#include "dungeon_entity.h"
-#include "map.h"
+#include "position.h"
// 0x73658
void DecideUseItem(struct DungeonEntity *pokemon);
diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h
index bf263ae..f4e836c 100644
--- a/include/dungeon_entity.h
+++ b/include/dungeon_entity.h
@@ -3,7 +3,7 @@
#include "constants/move.h"
#include "item.h"
-#include "map.h"
+#include "position.h"
struct DungeonActionContainer
{
diff --git a/include/dungeon_global_data.h b/include/dungeon_global_data.h
index 1d0a971..2e46ef0 100644
--- a/include/dungeon_global_data.h
+++ b/include/dungeon_global_data.h
@@ -5,6 +5,7 @@
#include "dungeon_entity.h"
#include "global.h"
#include "map.h"
+#include "position.h"
#define DUNGEON_MAX_SIZE_X 55
#define DUNGEON_MAX_SIZE_Y 31
@@ -69,7 +70,9 @@ struct DungeonGlobalData
/* 0xE278 */ u8 waterSportTurnsLeft;
u8 fillE279[0xE8C0 - 0xE279];
/* 0xE8C0 */ u32 mapEntityPointers[DUNGEON_MAX_SIZE_X * DUNGEON_MAX_SIZE_Y];
- u8 fill10364[0x10844 - 0x10364];
+ u8 fill10364[0x104C4 - 0x10364];
+ /* 0x104C4 */ struct MapRoom roomData[MAX_ROOM_COUNT];
+ u8 fill10604[0x10844 - 0x10764];
/* 0x10844 */ u16 numRoomExits[MAX_ROOM_COUNT];
u8 fill10874[0x10884 - 0x10874];
/* 0x10884 */ struct Position roomExits[MAX_ROOM_COUNT][32]; // Arrays of room exits for each room.
diff --git a/include/dungeon_pokemon_sprites.h b/include/dungeon_pokemon_sprites.h
index 50595ea..fe934e2 100644
--- a/include/dungeon_pokemon_sprites.h
+++ b/include/dungeon_pokemon_sprites.h
@@ -1,7 +1,7 @@
#ifndef GUARD_DUNGEON_POKEMON_SPRITES_H
#define GUARD_DUNGEON_POKEMON_SPRITES_H
-#include "map.h"
+#include "position.h"
struct DungeonPokemonStatusSprite
{
diff --git a/include/dungeon_range.h b/include/dungeon_range.h
new file mode 100644
index 0000000..3d76011
--- /dev/null
+++ b/include/dungeon_range.h
@@ -0,0 +1,9 @@
+#ifndef GUARD_DUNGEON_RANGE_H
+#define GUARD_DUNGEON_RANGE_H
+
+#include "position.h"
+
+// 0x83294
+bool8 InSameRoom_2(struct Position *pos1, struct Position *pos2);
+
+#endif
diff --git a/include/map.h b/include/map.h
index 7863b46..2989c6c 100644
--- a/include/map.h
+++ b/include/map.h
@@ -2,8 +2,10 @@
#define GUARD_MAP_H
#include "dungeon_entity.h"
+#include "position.h"
#define MAX_ROOM_COUNT 24 // Empirical max, not sure if the code supports any more.
+#define CORRIDOR_ROOM_INDEX 0xFF
struct MapTile
{
@@ -25,25 +27,16 @@ struct MapTile
/* 0x14 */ struct DungeonEntity *mapObject; // Item or trap on the tile.
};
-struct Position
-{
- s16 x;
- s16 y;
-};
-
-struct Position32
-{
- s32 x;
- s32 y;
-};
-
struct MapRoom
{
u8 fill0[0x2 - 0x0];
// All coordinates are inclusive.
- /* 0x2 */ struct Position start;
- /* 0x6 */ struct Position end;
- u8 fillA[0x1C - 0xA];
+ // These are not aligned properly to use the Position struct.
+ /* 0x2 */ s16 startX;
+ /* 0x4 */ s16 startY;
+ /* 0x6 */ s16 endX;
+ /* 0x8 */ s16 endY;
+ u8 fillA[0x1A - 0xA];
};
enum TileType
diff --git a/include/position.h b/include/position.h
new file mode 100644
index 0000000..3a24df4
--- /dev/null
+++ b/include/position.h
@@ -0,0 +1,16 @@
+#ifndef GUARD_POSITION_H
+#define GUARD_POSITION_H
+
+struct Position
+{
+ s16 x;
+ s16 y;
+};
+
+struct Position32
+{
+ s32 x;
+ s32 y;
+};
+
+#endif