- removed some unused parts from Blood's map loader.

This commit is contained in:
Christoph Oelckers 2020-10-11 18:34:58 +02:00
parent fd31da3115
commit e6bd5989c2
2 changed files with 0 additions and 160 deletions

View file

@ -314,14 +314,6 @@ unsigned short dbInsertXWall(int nWall)
return nXWall;
}
void dbDeleteXWall(int nXWall)
{
assert(xwall[nXWall].reference >= 0);
InsertFree(nextXWall, nXWall);
wall[xwall[nXWall].reference].extra = -1;
xwall[nXWall].reference = -1;
}
unsigned short dbInsertXSector(int nSector)
{
int nXSector = nextXSector[0];
@ -336,153 +328,6 @@ unsigned short dbInsertXSector(int nSector)
return nXSector;
}
void dbDeleteXSector(int nXSector)
{
assert(xsector[nXSector].reference >= 0);
InsertFree(nextXSector, nXSector);
sector[xsector[nXSector].reference].extra = -1;
xsector[nXSector].reference = -1;
}
void dbXSpriteClean(void)
{
for (int i = 0; i < kMaxSprites; i++)
{
int nXSprite = sprite[i].extra;
if (nXSprite == 0)
{
sprite[i].extra = -1;
}
if (sprite[i].statnum < kMaxStatus && nXSprite > 0)
{
assert(nXSprite < kMaxXSprites);
if (xsprite[nXSprite].reference != i)
{
int nXSprite2 = dbInsertXSprite(i);
memcpy(&xsprite[nXSprite2], &xsprite[nXSprite], sizeof(XSPRITE));
xsprite[nXSprite2].reference = i;
}
}
}
for (int i = 1; i < kMaxXSprites; i++)
{
int nSprite = xsprite[i].reference;
if (nSprite >= 0)
{
assert(nSprite < kMaxSprites);
if (sprite[nSprite].statnum >= kMaxStatus || sprite[nSprite].extra != i)
{
InsertFree(nextXSprite, i);
xsprite[i].reference = -1;
}
}
}
}
void dbXWallClean(void)
{
for (int i = 0; i < numwalls; i++)
{
int nXWall = wall[i].extra;
if (nXWall == 0)
{
wall[i].extra = -1;
}
if (nXWall > 0)
{
assert(nXWall < kMaxXWalls);
if (xwall[nXWall].reference == -1)
{
wall[i].extra = -1;
}
else
{
xwall[nXWall].reference = i;
}
}
}
for (int i = 0; i < numwalls; i++)
{
int nXWall = wall[i].extra;
if (nXWall > 0)
{
assert(nXWall < kMaxXWalls);
if (xwall[nXWall].reference != i)
{
int nXWall2 = dbInsertXWall(i);
memcpy(&xwall[nXWall2], &xwall[nXWall], sizeof(XWALL));
xwall[nXWall2].reference = i;
}
}
}
for (int i = 1; i < kMaxXWalls; i++)
{
int nWall = xwall[i].reference;
if (nWall >= 0)
{
assert(nWall < kMaxWalls);
if (nWall >= numwalls || wall[nWall].extra != i)
{
InsertFree(nextXWall, i);
xwall[i].reference = -1;
}
}
}
}
void dbXSectorClean(void)
{
for (int i = 0; i < numsectors; i++)
{
int nXSector = sector[i].extra;
if (nXSector == 0)
{
sector[i].extra = -1;
}
if (nXSector > 0)
{
assert(nXSector < kMaxXSectors);
if (xsector[nXSector].reference == -1)
{
sector[i].extra = -1;
}
else
{
xsector[nXSector].reference = i;
}
}
}
for (int i = 0; i < numsectors; i++)
{
int nXSector = sector[i].extra;
if (nXSector > 0)
{
assert(nXSector < kMaxXSectors);
if (xsector[nXSector].reference != i)
{
int nXSector2 = dbInsertXSector(i);
memcpy(&xsector[nXSector2], &xsector[nXSector], sizeof(XSECTOR));
xsector[nXSector2].reference = i;
}
}
}
for (int i = 1; i < kMaxXSectors; i++)
{
int nSector = xsector[i].reference;
if (nSector >= 0)
{
assert(nSector < kMaxSectors);
if (nSector >= numsectors || sector[nSector].extra != i)
{
InsertFree(nextXSector, i);
xsector[i].reference = -1;
}
}
}
}
void dbInit(void)
{
InitFreeList(nextXSprite, kMaxXSprites);

View file

@ -352,12 +352,7 @@ void InsertFree(unsigned short *pList, int nIndex);
unsigned short dbInsertXSprite(int nSprite);
void dbDeleteXSprite(int nXSprite);
unsigned short dbInsertXWall(int nWall);
void dbDeleteXWall(int nXWall);
unsigned short dbInsertXSector(int nSector);
void dbDeleteXSector(int nXSector);
void dbXSpriteClean(void);
void dbXWallClean(void);
void dbXSectorClean(void);
void dbInit(void);
void PropagateMarkerReferences(void);
unsigned int dbReadMapCRC(const char *pPath);