summaryrefslogtreecommitdiffstats
path: root/src/control/PathFind.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/control/PathFind.h')
-rw-r--r--src/control/PathFind.h45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/control/PathFind.h b/src/control/PathFind.h
index c51cb7c7..ea88ade6 100644
--- a/src/control/PathFind.h
+++ b/src/control/PathFind.h
@@ -3,11 +3,7 @@
#include "Treadable.h"
class CVehicle;
-
-class CPedPath {
-public:
- static bool CalcPedRoute(uint8, CVector, CVector, CVector*, int16*, int16);
-};
+class CPtrList;
enum
{
@@ -30,6 +26,33 @@ enum
SWITCH_ON = 1,
};
+enum
+{
+ ROUTE_ADD_BLOCKADE = 0,
+ ROUTE_NO_BLOCKADE = 1
+};
+
+struct CPedPathNode
+{
+ bool bBlockade;
+ uint8 nodeIdX;
+ uint8 nodeIdY;
+ int16 id;
+ CPedPathNode* prev;
+ CPedPathNode* next;
+};
+static_assert(sizeof(CPedPathNode) == 0x10, "CPedPathNode: error");
+
+class CPedPath {
+public:
+ static bool CalcPedRoute(int8 pathType, CVector position, CVector destination, CVector *pointPoses, int16 *pointsFound, int16 maxPoints);
+ static void AddNodeToPathList(CPedPathNode *pNodeToAdd, int16 id, CPedPathNode *pNodeList);
+ static void RemoveNodeFromList(CPedPathNode *pNode);
+ static void AddNodeToList(CPedPathNode *pNode, int16 index, CPedPathNode *pList);
+ static void AddBlockade(CEntity *pEntity, CPedPathNode(*pathNodes)[40], CVector *pPosition);
+ static void AddBlockadeSectorList(CPtrList& list, CPedPathNode(*pathNodes)[40], CVector *pPosition);
+};
+
struct CPathNode
{
CVector pos;
@@ -84,10 +107,8 @@ union CConnectionFlags
struct CCarPathLink
{
- float posX;
- float posY;
- float dirX;
- float dirY;
+ CVector2D pos;
+ CVector2D dir;
int16 pathNodeIndex;
int8 numLeftLanes;
int8 numRightLanes;
@@ -208,7 +229,13 @@ public:
bool TestCoorsCloseness(CVector target, uint8 type, CVector start);
void Save(uint8 *buf, uint32 *size);
void Load(uint8 *buf, uint32 size);
+
+ void DisplayPathData(void);
};
static_assert(sizeof(CPathFind) == 0x49bf4, "CPathFind: error");
extern CPathFind &ThePaths;
+
+extern bool gbShowPedPaths;
+extern bool gbShowCarPaths;
+extern bool gbShowCarPathsLinks;