- refactored most wall[] references.

What's left is in either setup code or the mirror setup.
This commit is contained in:
Christoph Oelckers 2021-11-23 23:39:10 +01:00
parent dd1e7dd94f
commit a7fc5d2193
4 changed files with 15 additions and 14 deletions

View file

@ -401,7 +401,7 @@ static void fakeMoveDude(spritetype *pSprite)
case kHitSprite:
{
int nHitWall = predict.at75.hit.index;
walltype *pHitWall = &wall[nHitWall];
walltype *pHitWall = &wall [nHitWall];
if (pHitWall->twoSided())
{
sectortype *pHitSector = &pHitWall->nextSector();

View file

@ -246,18 +246,18 @@ void PreloadCache()
if (!r_precache) return;
int skyTile = -1;
// Fonts
for (int i = 0; i < numsectors; i++)
for(auto& sect : sectors())
{
tilePrecacheTile(sector[i].floorpicnum, 0, sector[i].floorpal);
tilePrecacheTile(sector[i].ceilingpicnum, 0, sector[i].ceilingpal);
if ((sector[i].ceilingstat&1) != 0 && skyTile == -1)
skyTile = sector[i].ceilingpicnum;
tilePrecacheTile(sect.floorpicnum, 0, sect.floorpal);
tilePrecacheTile(sect.ceilingpicnum, 0, sect.ceilingpal);
if ((sect.ceilingstat&1) != 0 && skyTile == -1)
skyTile = sect.ceilingpicnum;
}
for (int i = 0; i < numwalls; i++)
for(auto& wal : walls())
{
tilePrecacheTile(wall[i].picnum, 0, wall[i].pal);
if (wall[i].overpicnum >= 0)
tilePrecacheTile(wall[i].overpicnum, 0, wall[i].pal);
tilePrecacheTile(wal.picnum, 0, wal.pal);
if (wal.overpicnum >= 0)
tilePrecacheTile(wal.overpicnum, 0, wal.pal);
}
BloodSpriteIterator it;
while (auto actor = it.Next())

View file

@ -82,9 +82,9 @@ int tileGetSurfType(Collision& hit)
default:
return 0;
case kHitSector:
return surfType[sector[hit.index].floorpicnum];
return surfType[hit.sector()->floorpicnum];
case kHitWall:
return surfType[wall[hit.index].picnum];
return surfType[hit.wall()->picnum];
case kHitSprite:
return surfType[hit.actor->s().picnum];
}

View file

@ -1996,10 +1996,11 @@ void InitGenerator(DBloodActor*);
void trInit(void)
{
gBusyCount = 0;
for(auto& wal : walls())
for (int i = 0; i < numwalls; i++)
{
wall[i].baseWall.x = wall[i].x;
wall[i].baseWall.y = wall[i].y;
wal.baseWall.x = wal.x;
wal.baseWall.y = wal.y;
}
BloodLinearSpriteIterator it;
while (auto actor = it.Next())