diff options
author | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-12-05 22:31:01 +0800 |
---|---|---|
committer | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-12-06 10:38:28 +0800 |
commit | f9ff7316d5c7277eb7482e30121388cd65f4ecfc (patch) | |
tree | ee8f4a9c338f880a3585d6e9ed9ed695f27cef3d /src/overworld.c | |
parent | 405f1bb529809b8169364737087189df0fcca1d2 (diff) |
Remove uses of INVALID_ defines, clean up some arrays with constants, and spaces -> tabs
Diffstat (limited to 'src/overworld.c')
-rw-r--r-- | src/overworld.c | 60 |
1 files changed, 48 insertions, 12 deletions
diff --git a/src/overworld.c b/src/overworld.c index 13c36819f..12e02a9b5 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -296,15 +296,51 @@ static const u8 sUnusedData[] = const struct UCoords32 gDirectionToVectors[] = { - { 0, 0}, // DIR_NONE - { 0, 1}, // DIR_SOUTH - { 0, -1}, // DIR_NORTH - {-1, 0}, // DIR_WEST - { 1, 0}, // DIR_EAST - {-1, 1}, // DIR_SOUTHWEST - { 1, 1}, // DIR_SOUTHEAST - {-1, -1}, // DIR_NORTHWEST - { 1, -1}, // DIR_NORTHEAST + [DIR_NONE] = + { + .x = 0, + .y = 0, + }, + [DIR_SOUTH] = + { + .x = 0, + .y = 1, + }, + [DIR_NORTH] = + { + .x = 0, + .y = -1, + }, + [DIR_WEST] = + { + .x = -1, + .y = 0, + }, + [DIR_EAST] = + { + .x = 1, + .y = 0, + }, + [DIR_SOUTHWEST] = + { + .x = -1, + .y = 1, + }, + [DIR_SOUTHEAST] = + { + .x = 1, + .y = 1, + }, + [DIR_NORTHWEST] = + { + .x = -1, + .y = -1, + }, + [DIR_NORTHEAST] = + { + .x = 1, + .y = -1, + }, }; static const struct BgTemplate gUnknown_08339DAC[] = @@ -1110,7 +1146,7 @@ static bool16 IsInflitratedSpaceCenter(struct WarpData *warp) u16 GetLocationMusic(struct WarpData *warp) { if (NoMusicInSotopolisWithLegendaries(warp) == TRUE) - return INVALID_U16; + return 0xFFFF; else if (ShouldLegendaryMusicPlayAtLocation(warp) == TRUE) return MUS_OOAME; else if (IsInflitratedSpaceCenter(warp) == TRUE) @@ -1171,7 +1207,7 @@ void Overworld_PlaySpecialMapMusic(void) { u16 music = GetCurrLocationDefaultMusic(); - if (music != MUS_OOAME && music != INVALID_U16) + if (music != MUS_OOAME && music != 0xFFFF) { if (gSaveBlock1Ptr->savedMusic) music = gSaveBlock1Ptr->savedMusic; @@ -1201,7 +1237,7 @@ static void sub_8085810(void) { u16 newMusic = GetWarpDestinationMusic(); u16 currentMusic = GetCurrentMapMusic(); - if (newMusic != MUS_OOAME && newMusic != INVALID_U16) + if (newMusic != MUS_OOAME && newMusic != 0xFFFF) { if (currentMusic == MUS_DEEPDEEP || currentMusic == MUS_NAMINORI) return; |