Add NUM_LEVELS

This commit is contained in:
Sergeanur 2020-12-08 07:50:29 +02:00
parent b13b26b5fb
commit 778d1381bb
3 changed files with 7 additions and 6 deletions

View file

@ -5,7 +5,8 @@ enum eLevelName {
LEVEL_GENERIC = 0, LEVEL_GENERIC = 0,
LEVEL_INDUSTRIAL, LEVEL_INDUSTRIAL,
LEVEL_COMMERCIAL, LEVEL_COMMERCIAL,
LEVEL_SUBURBAN LEVEL_SUBURBAN,
NUM_LEVELS
}; };
class CGame class CGame

View file

@ -33,7 +33,7 @@
CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS]; CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS];
CPtrList CWorld::ms_bigBuildingsList[4]; CPtrList CWorld::ms_bigBuildingsList[NUM_LEVELS];
CPtrList CWorld::ms_listMovingEntityPtrs; CPtrList CWorld::ms_listMovingEntityPtrs;
CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X]; CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
uint16 CWorld::ms_nCurrentScanCode; uint16 CWorld::ms_nCurrentScanCode;
@ -1745,13 +1745,13 @@ CWorld::ShutDown(void)
pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush(); pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush();
#endif #endif
} }
for(int32 i = 0; i < 4; i++) { for(int32 i = 0; i < NUM_LEVELS; i++) {
for(CPtrNode *pNode = GetBigBuildingList((eLevelName)i).first; pNode; pNode = pNode->next) { for(CPtrNode *pNode = ms_bigBuildingsList[i].first; pNode; pNode = pNode->next) {
CEntity *pEntity = (CEntity *)pNode->item; CEntity *pEntity = (CEntity *)pNode->item;
// Maybe remove from world here? // Maybe remove from world here?
delete pEntity; delete pEntity;
} }
GetBigBuildingList((eLevelName)i).Flush(); ms_bigBuildingsList[i].Flush();
} }
for(int i = 0; i < NUMSECTORS_X * NUMSECTORS_Y; i++) { for(int i = 0; i < NUMSECTORS_X * NUMSECTORS_Y; i++) {
CSector *pSector = GetSector(i % NUMSECTORS_X, i / NUMSECTORS_Y); CSector *pSector = GetSector(i % NUMSECTORS_X, i / NUMSECTORS_Y);

View file

@ -55,7 +55,7 @@ struct CStoredCollPoly;
class CWorld class CWorld
{ {
static CPtrList ms_bigBuildingsList[4]; static CPtrList ms_bigBuildingsList[NUM_LEVELS];
static CPtrList ms_listMovingEntityPtrs; static CPtrList ms_listMovingEntityPtrs;
static CSector ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X]; static CSector ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
static uint16 ms_nCurrentScanCode; static uint16 ms_nCurrentScanCode;