summaryrefslogtreecommitdiff
path: root/src/landmark.c
diff options
context:
space:
mode:
authorCameron Hall <camthesaxman@users.noreply.github.com>2016-11-06 23:02:20 -0600
committerYamaArashi <YamaArashi@users.noreply.github.com>2016-11-06 21:02:20 -0800
commit7b1e836e9b48fd54a227931942d231f1c0823626 (patch)
tree7a987a7be6724b10704ac106d522ba6366671b07 /src/landmark.c
parent7f5332c12025c36c90c647184a5a4b1a3433d200 (diff)
cleanup (#93)
* cleanup * cleanup
Diffstat (limited to 'src/landmark.c')
-rw-r--r--src/landmark.c49
1 files changed, 16 insertions, 33 deletions
diff --git a/src/landmark.c b/src/landmark.c
index a343cecac..0ccadfa61 100644
--- a/src/landmark.c
+++ b/src/landmark.c
@@ -1,4 +1,7 @@
#include "global.h"
+#include "flag.h"
+
+#define MAPSEC_NONE 0x58
struct Landmark
{
@@ -8,21 +11,21 @@ struct Landmark
struct LandmarkList
{
- u8 field_0;
+ u8 mapSection;
u8 field_1;
u16 field_2;
- struct Landmark **landmark_list;
+ struct Landmark **landmarks;
};
extern const struct LandmarkList gLandmarkLists[];
-const struct Landmark **GetLandmarkList(u8 arg_0, u8 arg_1);
+static const struct Landmark **GetLandmarks(u8 arg_0, u8 arg_1);
u8 *GetLandmarkName(u8 arg_0, u8 arg_1, u8 count)
{
register struct Landmark **landmark_list asm("r4")
- = GetLandmarkList(arg_0, arg_1);
+ = GetLandmarks(arg_0, arg_1);
if (landmark_list == NULL)
{
@@ -84,44 +87,24 @@ u8 *GetLandmarkName(u8 arg_0, u8 arg_1, u8 count)
}
-
-const struct Landmark **GetLandmarkList(u8 arg_0, u8 arg_1)
+static const struct Landmark **GetLandmarks(u8 arg_0, u8 arg_1)
{
- u16 i;
-
- i = 0;
-
- if (gLandmarkLists[0].field_0 == 0x58)
- {
- return NULL;
- }
-
+ u16 i = 0;
- for (; gLandmarkLists[i].field_0 != 0x58; i++)
+ for (; gLandmarkLists[i].mapSection != MAPSEC_NONE; i++)
{
- if (gLandmarkLists[i].field_0 > arg_0)
- {
+ if (gLandmarkLists[i].mapSection > arg_0)
return NULL;
- }
- if (gLandmarkLists[i].field_0 == arg_0)
- {
+ if (gLandmarkLists[i].mapSection == arg_0)
break;
- }
}
-
- if (gLandmarkLists[i].field_0 == 0x58)
- {
+ if (gLandmarkLists[i].mapSection == MAPSEC_NONE)
return NULL;
- }
- for (; gLandmarkLists[i].field_0 == arg_0; i++)
+ for (; gLandmarkLists[i].mapSection == arg_0; i++)
{
if (gLandmarkLists[i].field_1 == arg_1)
- {
- return gLandmarkLists[i].landmark_list;
- }
+ return gLandmarkLists[i].landmarks;
}
-
- return 0;
+ return NULL;
}
-