Merge pull request #1762 from GriffinRichards/sync-fieldmap
Sync fieldmap
This commit is contained in:
@@ -87,13 +87,13 @@ void InitMapFromSavedGame(void)
|
||||
|
||||
void InitBattlePyramidMap(bool8 setPlayerPosition)
|
||||
{
|
||||
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
|
||||
CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
|
||||
GenerateBattlePyramidFloorLayout(sBackupMapData, setPlayerPosition);
|
||||
}
|
||||
|
||||
void InitTrainerHillMap(void)
|
||||
{
|
||||
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
|
||||
CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
|
||||
GenerateTrainerHillFloorLayout(sBackupMapData);
|
||||
}
|
||||
|
||||
@@ -753,7 +753,7 @@ static int IsPosInConnectingMap(struct MapConnection *connection, int x, int y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
struct MapConnection *GetConnectionAtCoords(s16 x, s16 y)
|
||||
struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y)
|
||||
{
|
||||
int count;
|
||||
struct MapConnection *connection;
|
||||
@@ -860,12 +860,13 @@ static void CopyTilesetToVramUsingHeap(struct Tileset const *tileset, u16 numTil
|
||||
}
|
||||
}
|
||||
|
||||
static void FieldmapPaletteDummy(u16 offset, u16 size)
|
||||
// Below two are dummied functions from FRLG, used to tint the overworld palettes for the Quest Log
|
||||
static void ApplyGlobalTintToPaletteEntries(u16 offset, u16 size)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void FieldmapUnkDummy(void)
|
||||
static void ApplyGlobalTintToPaletteSlot(u8 slot, u8 count)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -880,17 +881,17 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size)
|
||||
{
|
||||
LoadPalette(&black, destOffset, 2);
|
||||
LoadPalette(((u16 *)tileset->palettes) + 1, destOffset + 1, size - 2);
|
||||
FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1);
|
||||
ApplyGlobalTintToPaletteEntries(destOffset + 1, (size - 2) >> 1);
|
||||
}
|
||||
else if (tileset->isSecondary == TRUE)
|
||||
{
|
||||
LoadPalette(((u16 *)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size);
|
||||
FieldmapPaletteDummy(destOffset, size >> 1);
|
||||
ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadCompressedPalette((u32 *)tileset->palettes, destOffset, size);
|
||||
FieldmapPaletteDummy(destOffset, size >> 1);
|
||||
ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ static void CheckForHiddenItemsInMapConnection(u8 taskId)
|
||||
|| var2 > y
|
||||
|| y >= height)
|
||||
{
|
||||
struct MapConnection *conn = GetConnectionAtCoords(x, y);
|
||||
struct MapConnection *conn = GetMapConnectionAtPos(x, y);
|
||||
if (conn && IsHiddenItemPresentInConnection(conn, x, y) == TRUE)
|
||||
SetDistanceOfClosestHiddenItem(taskId, x - playerX, y - playerY);
|
||||
}
|
||||
|
||||
@@ -2038,15 +2038,15 @@ bool8 ScrCmd_setmetatile(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 tileId = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 isImpassable = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 metatileId = VarGet(ScriptReadHalfword(ctx));
|
||||
bool16 isImpassable = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
if (!isImpassable)
|
||||
MapGridSetMetatileIdAt(x, y, tileId);
|
||||
MapGridSetMetatileIdAt(x, y, metatileId);
|
||||
else
|
||||
MapGridSetMetatileIdAt(x, y, tileId | MAPGRID_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(x, y, metatileId | MAPGRID_COLLISION_MASK);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user