diff --git a/include/fieldmap.h b/include/fieldmap.h index a23b6c428..639e329a9 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -12,6 +12,8 @@ #define MAX_MAP_DATA_SIZE 0x2800 #define VIRTUAL_MAP_SIZE (MAX_MAP_DATA_SIZE) +#define NUM_TILES_PER_METATILE 8 + // Map coordinates are offset by 7 when using the map // buffer because it needs to load sufficient border // metatiles to fill the player's view (the player has diff --git a/src/field_camera.c b/src/field_camera.c index e8d401907..88f94bff0 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -236,7 +236,7 @@ static void DrawMetatileAt(const struct MapLayout *mapLayout, u16 offset, int x, metatiles = mapLayout->secondaryTileset->metatiles; metatileId -= NUM_METATILES_IN_PRIMARY; } - DrawMetatile(MapGridGetMetatileLayerTypeAt(x, y), metatiles + metatileId * 8, offset); + DrawMetatile(MapGridGetMetatileLayerTypeAt(x, y), metatiles + metatileId * NUM_TILES_PER_METATILE, offset); } static void DrawMetatile(s32 metatileLayerType, const u16 *tiles, u16 offset) diff --git a/src/shop.c b/src/shop.c index 9f035a5ff..3d6b1cde4 100644 --- a/src/shop.c +++ b/src/shop.c @@ -740,9 +740,9 @@ static void BuyMenuDrawMapBg(void) metatileLayerType = MapGridGetMetatileLayerTypeAt(x + i, y + j); if (metatile < NUM_METATILES_IN_PRIMARY) - BuyMenuDrawMapMetatile(i, j, mapLayout->primaryTileset->metatiles + metatile * 8, metatileLayerType); + BuyMenuDrawMapMetatile(i, j, mapLayout->primaryTileset->metatiles + metatile * NUM_TILES_PER_METATILE, metatileLayerType); else - BuyMenuDrawMapMetatile(i, j, mapLayout->secondaryTileset->metatiles + ((metatile - NUM_METATILES_IN_PRIMARY) * 8), metatileLayerType); + BuyMenuDrawMapMetatile(i, j, mapLayout->secondaryTileset->metatiles + ((metatile - NUM_METATILES_IN_PRIMARY) * NUM_TILES_PER_METATILE), metatileLayerType); } } }