summaryrefslogtreecommitdiffstats
path: root/src/Zones.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-05-15 16:52:37 +0200
committeraap <aap@papnet.eu>2019-05-15 16:52:37 +0200
commit600bf0351476a5a21aabb5429132ddf7f52ac0b9 (patch)
treed8e48b3a581679e33830fb7c98ed69e1e242e2c2 /src/Zones.h
downloadre3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.gz
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.bz2
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.lz
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.xz
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.zst
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.zip
Diffstat (limited to '')
-rw-r--r--src/Zones.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/Zones.h b/src/Zones.h
new file mode 100644
index 00000000..c7745e29
--- /dev/null
+++ b/src/Zones.h
@@ -0,0 +1,107 @@
+#pragma once
+
+#include "Game.h"
+
+enum eZoneType
+{
+ ZONE_AUDIO,
+ ZONE_TYPE1, // this should be NAVIG
+ ZONE_TYPE2, // this should be INFO...but all except MAPINFO get zoneinfo??
+ ZONE_MAPZONE,
+};
+
+class CZone
+{
+public:
+ char name[8];
+ float minx;
+ float miny;
+ float minz;
+ float maxx;
+ float maxy;
+ float maxz;
+ eZoneType type;
+ eLevelName level;
+ int16 zoneinfoDay;
+ int16 zoneinfoNight;
+ CZone *child;
+ CZone *parent;
+ CZone *next;
+};
+
+class CZoneInfo
+{
+public:
+ // Car data
+ uint16 carDensity;
+ uint16 carThreshold[6];
+ uint16 copThreshold;
+ uint16 gangThreshold[9];
+
+ // Ped data
+ uint16 pedDensity;
+ uint16 copDensity;
+ uint16 gangDensity[9];
+ uint16 pedGroup;
+};
+
+
+class CTheZones
+{
+public:
+ static eLevelName &m_CurrLevel;
+ static CZone *&m_pPlayersZone;
+ static int16 &FindIndex;
+
+ static uint16 &NumberOfAudioZones;
+ static int16 *AudioZoneArray; //[NUMAUDIOZONES];
+ static uint16 &TotalNumberOfMapZones;
+ static uint16 &TotalNumberOfZones;
+ static CZone *ZoneArray; //[NUMZONES];
+ static CZone *MapZoneArray; //[NUMMAPZONES];
+ static uint16 &TotalNumberOfZoneInfos;
+ static CZoneInfo *ZoneInfoArray; //[2*NUMZONES];
+
+ static void Init(void);
+ static void Update(void);
+ static void CreateZone(char *name, eZoneType type,
+ float minx, float miny, float minz,
+ float maxx, float maxy, float maxz,
+ eLevelName level);
+ static void CreateMapZone(char *name, eZoneType type,
+ float minx, float miny, float minz,
+ float maxx, float maxy, float maxz,
+ eLevelName level);
+ static CZone *GetZone(uint16 i) { return &ZoneArray[i]; }
+ static void PostZoneCreation(void);
+ static void InsertZoneIntoZoneHierarchy(CZone *zone);
+ static bool InsertZoneIntoZoneHierRecursive(CZone *z1, CZone *z2);
+ static bool ZoneIsEntirelyContainedWithinOtherZone(CZone *z1, CZone *z2);
+ static bool PointLiesWithinZone(const CVector &v, CZone *zone);
+ static eLevelName GetLevelFromPosition(CVector const &v);
+ static CZone *FindSmallestZonePosition(const CVector *v);
+ static CZone *FindSmallestZonePositionType(const CVector *v, eZoneType type);
+ static CZone *FindSmallestZonePositionILN(const CVector *v);
+ static int16 FindZoneByLabelAndReturnIndex(char *name);
+ static CZoneInfo *GetZoneInfo(const CVector *v, uint8 day);
+ static void GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info);
+ static void SetZoneCarInfo(uint16 zoneid, uint8 day, int16 carDensity,
+ int16 gang0Num, int16 gang1Num, int16 gang2Num,
+ int16 gang3Num, int16 gang4Num, int16 gang5Num,
+ int16 gang6Num, int16 gang7Num, int16 gang8Num,
+ int16 copNum,
+ int16 car0Num, int16 car1Num, int16 car2Num,
+ int16 car3Num, int16 car4Num, int16 car5Num);
+ static void SetZonePedInfo(uint16 zoneid, uint8 day, int16 pedDensity,
+ int16 gang0Density, int16 gang1Density, int16 gang2Density, int16 gang3Density,
+ int16 gang4Density, int16 gang5Density, int16 gang6Density, int16 gang7Density,
+ int16 gang8Density, int16 copDensity);
+ static void SetCarDensity(uint16 zoneid, uint8 day, uint16 cardensity);
+ static void SetPedDensity(uint16 zoneid, uint8 day, uint16 peddensity);
+ static void SetPedGroup(uint16 zoneid, uint8 day, uint16 pedgroup);
+ static int16 FindAudioZone(CVector *pos);
+ static eLevelName FindZoneForPoint(const CVector &pos);
+ static CZone *GetPointerForZoneIndex(int32 i) { return i == -1 ? nil : &ZoneArray[i]; }
+ static void AddZoneToAudioZoneArray(CZone *zone);
+ static void InitialiseAudioZoneArray(void);
+};