summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-07-13 17:43:09 +0300
committerSergeanur <s.anureev@yandex.ua>2020-07-13 17:43:09 +0300
commit841fa5155c17b6edf4774deaa311a4e5935be4d6 (patch)
tree7fae91d0edd59cdb4c340d9cf590e0cd07a75310 /src/core
parent6eb8f6ae5a87fe32c93388e67559da988f48fb7f (diff)
Rename LEVEL_NONE to LEVEL_GENERIC
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Collision.cpp32
-rw-r--r--src/core/Game.cpp4
-rw-r--r--src/core/Game.h2
-rw-r--r--src/core/PlayerInfo.cpp2
-rw-r--r--src/core/TempColModels.cpp6
-rw-r--r--src/core/World.cpp2
-rw-r--r--src/core/Zones.cpp8
7 files changed, 28 insertions, 28 deletions
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index cb8b4189..3244d0b9 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -38,7 +38,7 @@ void
CCollision::Init(void)
{
ms_colModelCache.Init(NUMCOLCACHELINKS);
- ms_collisionInMemory = LEVEL_NONE;
+ ms_collisionInMemory = LEVEL_GENERIC;
}
void
@@ -59,7 +59,7 @@ CCollision::Update(void)
return;
// hardcode a level if there are no zones
- if(level == LEVEL_NONE){
+ if(level == LEVEL_GENERIC){
if(CGame::currLevel == LEVEL_INDUSTRIAL &&
playerCoors.x < 400.0f){
level = LEVEL_COMMERCIAL;
@@ -78,7 +78,7 @@ CCollision::Update(void)
}
}
}
- if(level != LEVEL_NONE && level != CGame::currLevel)
+ if(level != LEVEL_GENERIC && level != CGame::currLevel)
CGame::currLevel = level;
if(ms_collisionInMemory != CGame::currLevel)
LoadCollisionWhenINeedIt(forceLevelChange);
@@ -95,10 +95,10 @@ GetCollisionInSectorList(CPtrList &list)
for(node = list.first; node; node = node->next){
e = (CEntity*)node->item;
level = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel()->level;
- if(level != LEVEL_NONE)
+ if(level != LEVEL_GENERIC)
return (eLevelName)level;
}
- return LEVEL_NONE;
+ return LEVEL_GENERIC;
}
// Get a level this sector is in based on collision models
@@ -108,15 +108,15 @@ GetCollisionInSector(CSector &sect)
int level;
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS_OVERLAP]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS_OVERLAP]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES]);
- if(level == LEVEL_NONE)
+ if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES_OVERLAP]);
return (eLevelName)level;
}
@@ -133,7 +133,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
int xmin, xmax, ymin, ymax;
int x, y;
- level = LEVEL_NONE;
+ level = LEVEL_GENERIC;
playerCoors = FindPlayerCoors();
sx = CWorld::GetSectorIndexX(playerCoors.x);
@@ -161,8 +161,8 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
for(x = xmin; x <= xmax; x++)
for(y = ymin; y <= ymax; y++){
l = GetCollisionInSector(*CWorld::GetSector(x, y));
- if(l != LEVEL_NONE){
- if(level == LEVEL_NONE)
+ if(l != LEVEL_GENERIC){
+ if(level == LEVEL_GENERIC)
level = l;
if(level != l)
multipleLevels = true;
@@ -173,7 +173,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
if(multipleLevels && veh && veh->IsBoat())
for(ei = veh->m_entryInfoList.first; ei; ei = ei->next){
level = GetCollisionInSector(*ei->sector);
- if(level != LEVEL_NONE)
+ if(level != LEVEL_GENERIC)
break;
}
}
@@ -205,7 +205,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
ms_collisionInMemory = CGame::currLevel;
CReplay::EmptyReplayBuffer();
#ifndef NO_ISLAND_LOADING
- if(CGame::currLevel != LEVEL_NONE)
+ if(CGame::currLevel != LEVEL_GENERIC)
LoadSplash(GetLevelSplashScreen(CGame::currLevel));
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
@@ -232,7 +232,7 @@ CCollision::SortOutCollisionAfterLoad(void)
#ifndef NO_ISLAND_LOADING
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
#endif
- if (CGame::currLevel != LEVEL_NONE) {
+ if (CGame::currLevel != LEVEL_GENERIC) {
#ifdef NO_ISLAND_LOADING
static bool bAlreadyLoaded = false;
if (bAlreadyLoaded) {
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 4c8aaa72..fe073d29 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -357,7 +357,7 @@ bool CGame::Initialise(const char* datFile)
CStreaming::Init();
CStreaming::LoadInitialVehicles();
CStreaming::LoadInitialPeds();
- CStreaming::RequestBigBuildings(LEVEL_NONE);
+ CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false);
printf("Streaming uses %dK of its memory", CStreaming::ms_memoryUsed / 1024);
LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen());
@@ -511,7 +511,7 @@ void CGame::ReInitGameObjectVariables(void)
CTimeCycle::Initialise();
CDraw::SetFOV(120.0f);
CDraw::ms_fLODDistance = 500.0f;
- CStreaming::RequestBigBuildings(LEVEL_NONE);
+ CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false);
CPed::Initialise();
CEventList::Initialise();
diff --git a/src/core/Game.h b/src/core/Game.h
index 48f31abc..46e8fc68 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -2,7 +2,7 @@
enum eLevelName {
LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel
- LEVEL_NONE = 0,
+ LEVEL_GENERIC = 0,
LEVEL_INDUSTRIAL,
LEVEL_COMMERCIAL,
LEVEL_SUBURBAN
diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index 69c1fe49..09b3a499 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -553,7 +553,7 @@ CPlayerInfo::Process(void)
veh->m_nZoneLevel = LEVEL_IGNORE;
for (int i = 0; i < ARRAY_SIZE(veh->pPassengers); i++) {
if (veh->pPassengers[i])
- veh->pPassengers[i]->m_nZoneLevel = LEVEL_NONE;
+ veh->pPassengers[i]->m_nZoneLevel = LEVEL_GENERIC;
}
CStats::DistanceTravelledInVehicle += veh->m_fDistanceTravelled;
} else {
diff --git a/src/core/TempColModels.cpp b/src/core/TempColModels.cpp
index 1252e2c7..ab73631d 100644
--- a/src/core/TempColModels.cpp
+++ b/src/core/TempColModels.cpp
@@ -36,19 +36,19 @@ CTempColModels::Initialise(void)
#define SET_COLMODEL_SPHERES(colmodel, sphrs)\
colmodel.numSpheres = ARRAY_SIZE(sphrs);\
colmodel.spheres = sphrs;\
- colmodel.level = LEVEL_NONE;\
+ colmodel.level = LEVEL_GENERIC;\
colmodel.ownsCollisionVolumes = false;\
int i;
ms_colModelBBox.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
ms_colModelBBox.boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
- ms_colModelBBox.level = LEVEL_NONE;
+ ms_colModelBBox.level = LEVEL_GENERIC;
for (i = 0; i < ARRAY_SIZE(ms_colModelCutObj); i++) {
ms_colModelCutObj[i].boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
ms_colModelCutObj[i].boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
- ms_colModelCutObj[i].level = LEVEL_NONE;
+ ms_colModelCutObj[i].level = LEVEL_GENERIC;
}
// Ped Spheres
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 8bcce8e7..9f384048 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -1797,7 +1797,7 @@ CWorld::ClearForRestart(void)
CWorld::Remove(pEntity);
delete pEntity;
}
- for(CPtrNode *pNode = GetBigBuildingList(LEVEL_NONE).first; pNode; pNode = pNode->next) {
+ for(CPtrNode *pNode = GetBigBuildingList(LEVEL_GENERIC).first; pNode; pNode = pNode->next) {
CVehicle *pVehicle = (CVehicle *)pNode->item;
if(pVehicle && pVehicle->IsVehicle() && pVehicle->IsPlane()) {
CWorld::Remove(pVehicle);
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index 4f491a49..1556731b 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -90,7 +90,7 @@ CTheZones::Init(void)
TotalNumberOfZoneInfos = 1; // why 1?
TotalNumberOfZones = 1;
- m_CurrLevel = LEVEL_NONE;
+ m_CurrLevel = LEVEL_GENERIC;
m_pPlayersZone = &ZoneArray[0];
strcpy(ZoneArray[0].name, "CITYZON");
@@ -100,7 +100,7 @@ CTheZones::Init(void)
ZoneArray[0].maxx = 4000.0f;
ZoneArray[0].maxy = 4000.0f;
ZoneArray[0].maxz = 500.0f;
- ZoneArray[0].level = LEVEL_NONE;
+ ZoneArray[0].level = LEVEL_GENERIC;
for(i = 0; i < NUMMAPZONES; i++){
memset(&MapZoneArray[i], 0, sizeof(CZone));
@@ -116,7 +116,7 @@ CTheZones::Init(void)
MapZoneArray[0].maxx = 4000.0f;
MapZoneArray[0].maxy = 4000.0f;
MapZoneArray[0].maxz = 500.0f;
- MapZoneArray[0].level = LEVEL_NONE;
+ MapZoneArray[0].level = LEVEL_GENERIC;
}
void
@@ -577,7 +577,7 @@ CTheZones::FindZoneForPoint(const CVector &pos)
return LEVEL_COMMERCIAL;
if(PointLiesWithinZone(&pos, GetZone(FindZoneByLabelAndReturnIndex("SUB_ZON"))))
return LEVEL_SUBURBAN;
- return LEVEL_NONE;
+ return LEVEL_GENERIC;
}
void