mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-14 07:33:44 +01:00
Use metatile layer constants in shop
This commit is contained in:
parent
8200fda14e
commit
e3b49604d4
10
src/shop.c
10
src/shop.c
@ -743,7 +743,7 @@ static void BuyMenuDrawMapBg(void)
|
|||||||
if (BuyMenuCheckForOverlapWithMenuBg(i, j) == TRUE)
|
if (BuyMenuCheckForOverlapWithMenuBg(i, j) == TRUE)
|
||||||
metatileLayerType = MapGridGetMetatileLayerTypeAt(x + i, y + j);
|
metatileLayerType = MapGridGetMetatileLayerTypeAt(x + i, y + j);
|
||||||
else
|
else
|
||||||
metatileLayerType = 1;
|
metatileLayerType = METATILE_LAYER_TYPE_COVERED;
|
||||||
|
|
||||||
if (metatile < NUM_METATILES_IN_PRIMARY)
|
if (metatile < NUM_METATILES_IN_PRIMARY)
|
||||||
{
|
{
|
||||||
@ -764,15 +764,15 @@ static void BuyMenuDrawMapMetatile(s16 x, s16 y, const u16 *src, u8 metatileLaye
|
|||||||
|
|
||||||
switch (metatileLayerType)
|
switch (metatileLayerType)
|
||||||
{
|
{
|
||||||
case 0:
|
case METATILE_LAYER_TYPE_NORMAL:
|
||||||
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src);
|
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src);
|
||||||
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4);
|
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case METATILE_LAYER_TYPE_COVERED:
|
||||||
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src);
|
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src);
|
||||||
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src + 4);
|
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src + 4);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case METATILE_LAYER_TYPE_SPLIT:
|
||||||
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src);
|
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src);
|
||||||
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4);
|
BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4);
|
||||||
break;
|
break;
|
||||||
@ -866,7 +866,7 @@ static void BuyMenuDrawObjectEvents(void)
|
|||||||
|
|
||||||
static bool8 BuyMenuCheckIfObjectEventOverlapsMenuBg(s16 *object)
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user