mirror of
https://github.com/halpz/re3.git
synced 2025-07-13 19:28:15 +00:00
Pool fixes from master
This commit is contained in:
@ -35,7 +35,7 @@
|
||||
|
||||
CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS];
|
||||
|
||||
CPtrList CWorld::ms_bigBuildingsList[4];
|
||||
CPtrList CWorld::ms_bigBuildingsList[NUM_LEVELS];
|
||||
CPtrList CWorld::ms_listMovingEntityPtrs;
|
||||
CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
|
||||
uint16 CWorld::ms_nCurrentScanCode;
|
||||
@ -1781,21 +1781,29 @@ CWorld::ShutDown(void)
|
||||
CWorld::Remove(pEntity);
|
||||
delete pEntity;
|
||||
}
|
||||
#ifndef FIX_BUGS
|
||||
pSector->m_lists[ENTITYLIST_BUILDINGS].Flush();
|
||||
pSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP].Flush();
|
||||
pSector->m_lists[ENTITYLIST_DUMMIES].Flush();
|
||||
pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush();
|
||||
#endif
|
||||
}
|
||||
for(int32 i = 0; i < 4; i++) {
|
||||
for(CPtrNode *pNode = GetBigBuildingList((eLevelName)i).first; pNode; pNode = pNode->next) {
|
||||
for(int32 i = 0; i < NUM_LEVELS; i++) {
|
||||
for(CPtrNode *pNode = ms_bigBuildingsList[i].first; pNode; pNode = pNode->next) {
|
||||
CEntity *pEntity = (CEntity *)pNode->item;
|
||||
// Maybe remove from world here?
|
||||
delete pEntity;
|
||||
}
|
||||
GetBigBuildingList((eLevelName)i).Flush();
|
||||
ms_bigBuildingsList[i].Flush();
|
||||
}
|
||||
for(int i = 0; i < NUMSECTORS_X * NUMSECTORS_Y; i++) {
|
||||
CSector *pSector = GetSector(i % NUMSECTORS_X, i / NUMSECTORS_Y);
|
||||
#ifdef FIX_BUGS
|
||||
pSector->m_lists[ENTITYLIST_BUILDINGS].Flush();
|
||||
pSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP].Flush();
|
||||
pSector->m_lists[ENTITYLIST_DUMMIES].Flush();
|
||||
pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush();
|
||||
#endif
|
||||
if(pSector->m_lists[ENTITYLIST_BUILDINGS].first) {
|
||||
sprintf(gString, "Building list %d,%d not empty\n", i % NUMSECTORS_X, i / NUMSECTORS_Y);
|
||||
pSector->m_lists[ENTITYLIST_BUILDINGS].Flush();
|
||||
|
@ -55,7 +55,7 @@ struct CStoredCollPoly;
|
||||
|
||||
class CWorld
|
||||
{
|
||||
static CPtrList ms_bigBuildingsList[4];
|
||||
static CPtrList ms_bigBuildingsList[NUM_LEVELS];
|
||||
static CPtrList ms_listMovingEntityPtrs;
|
||||
static CSector ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
|
||||
static uint16 ms_nCurrentScanCode;
|
||||
|
@ -124,12 +124,18 @@ public:
|
||||
(T*)&m_entries[handle >> 8] : nil;
|
||||
}
|
||||
int GetIndex(T *entry){
|
||||
int i = GetJustIndex(entry);
|
||||
int i = GetJustIndex_NoFreeAssert(entry);
|
||||
return m_flags[i].u + (i<<8);
|
||||
}
|
||||
int GetJustIndex(T *entry){
|
||||
// TODO: the cast is unsafe
|
||||
return (int)((U*)entry - m_entries);
|
||||
int index = GetJustIndex_NoFreeAssert(entry);
|
||||
assert(!IsFreeSlot(index));
|
||||
return index;
|
||||
}
|
||||
int GetJustIndex_NoFreeAssert(T* entry){
|
||||
int index = ((U*)entry - m_entries);
|
||||
assert((U*)entry == (U*)&m_entries[index]); // cast is unsafe - check required
|
||||
return index;
|
||||
}
|
||||
int GetNoOfUsedSpaces(void) const {
|
||||
int i;
|
||||
|
Reference in New Issue
Block a user