Fix inconsistent static s/g names

This commit is contained in:
GriffinR
2022-05-17 13:51:54 -04:00
parent ef4d99c87e
commit 593e2c9be0
42 changed files with 528 additions and 534 deletions

View File

@@ -25,10 +25,10 @@ struct ConnectionFlags
u8 east:1;
};
EWRAM_DATA static u16 gBackupMapData[MAX_MAP_DATA_SIZE] = {0};
EWRAM_DATA static u16 sBackupMapData[MAX_MAP_DATA_SIZE] = {0};
EWRAM_DATA struct MapHeader gMapHeader = {0};
EWRAM_DATA struct Camera gCamera = {0};
EWRAM_DATA static struct ConnectionFlags gMapConnectionFlags = {0};
EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0};
EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly
struct BackupMapLayout gBackupMapLayout;
@@ -87,14 +87,14 @@ void InitMapFromSavedGame(void)
void InitBattlePyramidMap(bool8 setPlayerPosition)
{
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData));
GenerateBattlePyramidFloorLayout(gBackupMapData, setPlayerPosition);
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
GenerateBattlePyramidFloorLayout(sBackupMapData, setPlayerPosition);
}
void InitTrainerHillMap(void)
{
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData));
GenerateTrainerHillFloorLayout(gBackupMapData);
CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
GenerateTrainerHillFloorLayout(sBackupMapData);
}
static void InitMapLayoutData(struct MapHeader *mapHeader)
@@ -103,8 +103,8 @@ static void InitMapLayoutData(struct MapHeader *mapHeader)
int width;
int height;
mapLayout = mapHeader->mapLayout;
CpuFastFill16(MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData));
gBackupMapLayout.map = gBackupMapData;
CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData));
gBackupMapLayout.map = sBackupMapData;
width = mapLayout->width + MAP_OFFSET_W;
gBackupMapLayout.width = width;
height = mapLayout->height + MAP_OFFSET_H;
@@ -140,7 +140,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader)
{
count = mapHeader->connections->count;
connection = mapHeader->connections->connections;
gMapConnectionFlags = sDummyConnectionFlags;
sMapConnectionFlags = sDummyConnectionFlags;
for (i = 0; i < count; i++, connection++)
{
struct MapHeader const *cMap = GetMapHeaderFromConnection(connection);
@@ -149,19 +149,19 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader)
{
case CONNECTION_SOUTH:
FillSouthConnection(mapHeader, cMap, offset);
gMapConnectionFlags.south = TRUE;
sMapConnectionFlags.south = TRUE;
break;
case CONNECTION_NORTH:
FillNorthConnection(mapHeader, cMap, offset);
gMapConnectionFlags.north = TRUE;
sMapConnectionFlags.north = TRUE;
break;
case CONNECTION_WEST:
FillWestConnection(mapHeader, cMap, offset);
gMapConnectionFlags.west = TRUE;
sMapConnectionFlags.west = TRUE;
break;
case CONNECTION_EAST:
FillEastConnection(mapHeader, cMap, offset);
gMapConnectionFlags.east = TRUE;
sMapConnectionFlags.east = TRUE;
break;
}
}
@@ -436,7 +436,7 @@ void SaveMapView(void)
for (i = y; i < y + MAP_OFFSET_H; i++)
{
for (j = x; j < x + MAP_OFFSET_W; j++)
*mapView++ = gBackupMapData[width * i + j];
*mapView++ = sBackupMapData[width * i + j];
}
}
@@ -491,8 +491,8 @@ static void LoadSavedMapView(void)
for (j = x; j < x + MAP_OFFSET_W; j++)
{
if (!SkipCopyingMetatileFromSavedMap(&gBackupMapData[j + width * i], width, yMode))
gBackupMapData[j + width * i] = *mapView;
if (!SkipCopyingMetatileFromSavedMap(&sBackupMapData[j + width * i], width, yMode))
sBackupMapData[j + width * i] = *mapView;
mapView++;
}
}
@@ -554,7 +554,7 @@ static void MoveMapViewToBackup(u8 direction)
desti = width * (y + y0);
srci = (y + r8) * MAP_OFFSET_W + r9;
src = &mapView[srci + i];
dest = &gBackupMapData[x0 + desti + j];
dest = &sBackupMapData[x0 + desti + j];
*dest = *src;
i++;
j++;
@@ -570,28 +570,28 @@ int GetMapBorderIdAt(int x, int y)
if (x >= (gBackupMapLayout.width - (MAP_OFFSET + 1)))
{
if (!gMapConnectionFlags.east)
if (!sMapConnectionFlags.east)
return CONNECTION_INVALID;
return CONNECTION_EAST;
}
else if (x < MAP_OFFSET)
{
if (!gMapConnectionFlags.west)
if (!sMapConnectionFlags.west)
return CONNECTION_INVALID;
return CONNECTION_WEST;
}
else if (y >= (gBackupMapLayout.height - MAP_OFFSET))
{
if (!gMapConnectionFlags.south)
if (!sMapConnectionFlags.south)
return CONNECTION_INVALID;
return CONNECTION_SOUTH;
}
else if (y < MAP_OFFSET)
{
if (!gMapConnectionFlags.north)
if (!sMapConnectionFlags.north)
return CONNECTION_INVALID;
return CONNECTION_NORTH;