Label used metatile attributes
This commit is contained in:
+21
-21
@@ -36,26 +36,26 @@ EWRAM_DATA u8 gUnknown_2036E28 = 0;
|
||||
|
||||
static const struct ConnectionFlags sDummyConnectionFlags = {};
|
||||
|
||||
static const u32 sMetatileAttrMasks[] = {
|
||||
0x000001ff,
|
||||
0x00003e00,
|
||||
0x0003c000,
|
||||
0x00fc0000,
|
||||
0x07000000,
|
||||
0x18000000,
|
||||
0x60000000,
|
||||
0x80000000
|
||||
static const u32 sMetatileAttrMasks[METATILE_ATTRIBUTE_COUNT] = {
|
||||
[METATILE_ATTRIBUTE_BEHAVIOR] = 0x000001ff,
|
||||
[METATILE_ATTRIBUTE_TERRAIN] = 0x00003e00,
|
||||
[METATILE_ATTRIBUTE_2] = 0x0003c000,
|
||||
[METATILE_ATTRIBUTE_3] = 0x00fc0000,
|
||||
[METATILE_ATTRIBUTE_ENCOUNTER_TYPE] = 0x07000000,
|
||||
[METATILE_ATTRIBUTE_5] = 0x18000000,
|
||||
[METATILE_ATTRIBUTE_LAYER_TYPE] = 0x60000000,
|
||||
[METATILE_ATTRIBUTE_7] = 0x80000000
|
||||
};
|
||||
|
||||
static const u8 sMetatileAttrShifts[] = {
|
||||
0,
|
||||
9,
|
||||
14,
|
||||
18,
|
||||
24,
|
||||
27,
|
||||
29,
|
||||
31
|
||||
static const u8 sMetatileAttrShifts[METATILE_ATTRIBUTE_COUNT] = {
|
||||
[METATILE_ATTRIBUTE_BEHAVIOR] = 0,
|
||||
[METATILE_ATTRIBUTE_TERRAIN] = 9,
|
||||
[METATILE_ATTRIBUTE_2] = 14,
|
||||
[METATILE_ATTRIBUTE_3] = 18,
|
||||
[METATILE_ATTRIBUTE_ENCOUNTER_TYPE] = 24,
|
||||
[METATILE_ATTRIBUTE_5] = 27,
|
||||
[METATILE_ATTRIBUTE_LAYER_TYPE] = 29,
|
||||
[METATILE_ATTRIBUTE_7] = 31
|
||||
};
|
||||
|
||||
const struct MapHeader * mapconnection_get_mapheader(struct MapConnection * connection)
|
||||
@@ -425,7 +425,7 @@ u32 MapGridGetMetatileIdAt(s32 x, s32 y)
|
||||
|
||||
u32 GetMetatileAttributeFromRawMetatileBehavior(u32 original, u8 bit)
|
||||
{
|
||||
if (bit >= 8)
|
||||
if (bit >= METATILE_ATTRIBUTE_COUNT)
|
||||
return original;
|
||||
|
||||
return (original & sMetatileAttrMasks[bit]) >> sMetatileAttrShifts[bit];
|
||||
@@ -439,12 +439,12 @@ u32 MapGridGetMetatileAttributeAt(s16 x, s16 y, u8 attr)
|
||||
|
||||
u32 MapGridGetMetatileBehaviorAt(s16 x, s16 y)
|
||||
{
|
||||
return MapGridGetMetatileAttributeAt(x, y, 0);
|
||||
return MapGridGetMetatileAttributeAt(x, y, METATILE_ATTRIBUTE_BEHAVIOR);
|
||||
}
|
||||
|
||||
u8 MapGridGetMetatileLayerTypeAt(s16 x, s16 y)
|
||||
{
|
||||
return MapGridGetMetatileAttributeAt(x, y, 6);
|
||||
return MapGridGetMetatileAttributeAt(x, y, METATILE_ATTRIBUTE_LAYER_TYPE);
|
||||
}
|
||||
|
||||
void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatile)
|
||||
|
||||
Reference in New Issue
Block a user