diff options
author | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-08-12 01:26:29 -0400 |
---|---|---|
committer | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-08-12 01:26:29 -0400 |
commit | 1a8fe435e7deabf06029c8e50201136518e3af73 (patch) | |
tree | 9746f2f4f4901e81496465da485d0f5c8a647586 /src/landmark.c | |
parent | bb0cad7c072703f5a540e8c22c8e137267331f4d (diff) |
split out src/ directory into categorized subdirectories.
Diffstat (limited to 'src/landmark.c')
-rw-r--r-- | src/landmark.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/landmark.c b/src/landmark.c deleted file mode 100644 index 6a53716bb..000000000 --- a/src/landmark.c +++ /dev/null @@ -1,73 +0,0 @@ -#include "global.h" -#include "landmark.h" -#include "event_data.h" - -#define MAPSEC_NONE 0x58 - -struct Landmark -{ - u8 *name; - u16 flag; -}; - -struct LandmarkList -{ - u8 mapSection; - u8 id; - const struct Landmark **landmarks; -}; - -extern const struct LandmarkList gLandmarkLists[]; - -static const struct Landmark **GetLandmarks(u8 mapSection, u8 id); - -u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count) -{ - const struct Landmark **landmarks = GetLandmarks(mapSection, id); - - if (!landmarks) - return NULL; - - while (1) - { - const struct Landmark *landmark = *landmarks; - - if (landmark->flag == 0xFFFF || FlagGet(landmark->flag) == TRUE) - { - if (count == 0) - break; - else - count--; - } - - landmarks++; - if (!*landmarks) - return NULL; - } - - return (*landmarks)->name; -} - -static const struct Landmark **GetLandmarks(u8 mapSection, u8 id) -{ - u16 i = 0; - - for (; gLandmarkLists[i].mapSection != MAPSEC_NONE; i++) - { - if (gLandmarkLists[i].mapSection > mapSection) - return NULL; - if (gLandmarkLists[i].mapSection == mapSection) - break; - } - - if (gLandmarkLists[i].mapSection == MAPSEC_NONE) - return NULL; - - for (; gLandmarkLists[i].mapSection == mapSection; i++) - { - if (gLandmarkLists[i].id == id) - return gLandmarkLists[i].landmarks; - } - - return NULL; -} |