Use metatile layer constants in shop

This commit is contained in:
GriffinR 2022-01-19 10:59:37 -05:00
parent 8200fda14e
commit e3b49604d4

View File

@ -743,7 +743,7 @@ static void BuyMenuDrawMapBg(void)
if (BuyMenuCheckForOverlapWithMenuBg(i, j) == TRUE)
metatileLayerType = MapGridGetMetatileLayerTypeAt(x + i, y + j);
else
metatileLayerType = 1;
metatileLayerType = METATILE_LAYER_TYPE_COVERED;
if (metatile < NUM_METATILES_IN_PRIMARY)
{
@ -764,15 +764,15 @@ static void BuyMenuDrawMapMetatile(s16 x, s16 y, const u16 *src, u8 metatileLaye
switch (metatileLayerType)
{
case 0:
case METATILE_LAYER_TYPE_NORMAL:
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src);
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4);
break;
case 1:
case METATILE_LAYER_TYPE_COVERED:
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src);
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src + 4);
break;
case 2:
case METATILE_LAYER_TYPE_SPLIT:
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src);
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4);
break;
@ -866,7 +866,7 @@ static void BuyMenuDrawObjectEvents(void)
static bool8 BuyMenuCheckIfObjectEventOverlapsMenuBg(s16 *object)
{
if (!BuyMenuCheckForOverlapWithMenuBg(object[X_COORD], object[Y_COORD] + 2) && object[LAYER_TYPE] != MB_SECRET_BASE_WALL)
if (!BuyMenuCheckForOverlapWithMenuBg(object[X_COORD], object[Y_COORD] + 2) && object[LAYER_TYPE] != METATILE_LAYER_TYPE_COVERED)
{
return TRUE;
}