Add macros for metatile manipulation

This commit is contained in:
Phlosioneer
2019-02-22 03:08:48 -05:00
committed by huderlem
parent 9ed0f77528
commit 189d387f01
12 changed files with 70 additions and 61 deletions
+6 -6
View File
@@ -887,8 +887,8 @@ static void PetalburgGymFunc(u8 a0, u16 a1)
}
for (i = 0; i < nDoors; i++)
{
MapGridSetMetatileIdAt(x[i] + 7, y[i] + 7, a1 | 0xc00);
MapGridSetMetatileIdAt(x[i] + 7, y[i] + 8, (a1 + 8) | 0xc00);
MapGridSetMetatileIdAt(x[i] + 7, y[i] + 7, a1 | MAP_IMPASSABLE_MASK);
MapGridSetMetatileIdAt(x[i] + 7, y[i] + 8, (a1 + 8) | MAP_IMPASSABLE_MASK);
}
DrawWholeMapView();
}
@@ -1100,7 +1100,7 @@ static void PCTurnOnEffect_1(s16 flag, s8 dx, s8 dy)
tileId = 0x27e;
}
}
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + 7, gSaveBlock1Ptr->pos.y + dy + 7, tileId | 0xc00);
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + 7, gSaveBlock1Ptr->pos.y + dy + 7, tileId | MAP_IMPASSABLE_MASK);
}
void DoPCTurnOffEffect(void)
@@ -1141,7 +1141,7 @@ static void PCTurnOffEffect(void)
{
tileId = 0x259;
}
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + 7, gSaveBlock1Ptr->pos.y + dy + 7, tileId | 0xc00);
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + 7, gSaveBlock1Ptr->pos.y + dy + 7, tileId | MAP_IMPASSABLE_MASK);
DrawWholeMapView();
}
@@ -1892,7 +1892,7 @@ static void sub_8139C80(u8 taskId)
{
for (x = 0; x < 3; x++)
{
MapGridSetMetatileIdAt(x + 8, y + 7, gUnknown_085B2BF4[y][data[0] % 3] | 0xC00);
MapGridSetMetatileIdAt(x + 8, y + 7, gUnknown_085B2BF4[y][data[0] % 3] | MAP_IMPASSABLE_MASK);
}
}
}
@@ -1902,7 +1902,7 @@ static void sub_8139C80(u8 taskId)
{
for (x = 0; x < 3; x++)
{
MapGridSetMetatileIdAt(x + 8, y + 7, gUnknown_085B2C06[y][data[0] % 3] | 0xC00);
MapGridSetMetatileIdAt(x + 8, y + 7, gUnknown_085B2C06[y][data[0] % 3] | MAP_IMPASSABLE_MASK);
}
}
}