summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-17 10:30:02 +0200
committeraap <aap@papnet.eu>2019-06-17 22:40:15 +0200
commitb5fba778c4a307f0a5721c9b3b0efb38be96634b (patch)
tree9fe0738d1d6dcf4677aac12e1efadff18887f7b4 /src/control
parentMerge pull request #20 from gennariarmando/master (diff)
downloadre3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar
re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.gz
re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.bz2
re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.lz
re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.xz
re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.tar.zst
re3-b5fba778c4a307f0a5721c9b3b0efb38be96634b.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarCtrl.cpp3
-rw-r--r--src/control/CarCtrl.h1
-rw-r--r--src/control/Garages.cpp1
-rw-r--r--src/control/HandlingDataMgr.cpp7
-rw-r--r--src/control/HandlingDataMgr.h8
-rw-r--r--src/control/PathFind.cpp35
-rw-r--r--src/control/PathFind.h4
-rw-r--r--src/control/PedStats.cpp5
-rw-r--r--src/control/PedStats.h23
-rw-r--r--src/control/PedType.cpp5
-rw-r--r--src/control/PedType.h7
11 files changed, 95 insertions, 4 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 54491cd2..d59ae2d0 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2,4 +2,5 @@
#include "patcher.h"
#include "CarCtrl.h"
-WRAPPER void CCarCtrl::SwitchVehicleToRealPhysics(CVehicle*) { EAXJMP(0x41F7F0); } \ No newline at end of file
+WRAPPER void CCarCtrl::SwitchVehicleToRealPhysics(CVehicle*) { EAXJMP(0x41F7F0); }
+WRAPPER void CCarCtrl::AddToCarArray(int id, int vehclass) { EAXJMP(0x4182F0); }
diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h
index fbe36f28..1f468475 100644
--- a/src/control/CarCtrl.h
+++ b/src/control/CarCtrl.h
@@ -6,4 +6,5 @@ class CCarCtrl
{
public:
static void SwitchVehicleToRealPhysics(CVehicle*);
+ static void AddToCarArray(int id, int vehclass);
};
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index 2994eb49..b8469e5f 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -1,5 +1,6 @@
#include "common.h"
#include "patcher.h"
+#include "main.h"
#include "ModelIndices.h"
#include "Garages.h"
#include "Timer.h"
diff --git a/src/control/HandlingDataMgr.cpp b/src/control/HandlingDataMgr.cpp
new file mode 100644
index 00000000..94824358
--- /dev/null
+++ b/src/control/HandlingDataMgr.cpp
@@ -0,0 +1,7 @@
+#include "common.h"
+#include "patcher.h"
+#include "HandlingDatamgr.h"
+
+cHandlingDataMgr &mod_HandlingManager = *(cHandlingDataMgr*)0x728060;
+
+WRAPPER int32 cHandlingDataMgr::GetHandlingId(const char *name){ EAXJMP(0x546B70); }
diff --git a/src/control/HandlingDataMgr.h b/src/control/HandlingDataMgr.h
new file mode 100644
index 00000000..00e62b59
--- /dev/null
+++ b/src/control/HandlingDataMgr.h
@@ -0,0 +1,8 @@
+#pragma once
+
+class cHandlingDataMgr
+{
+public:
+ int32 GetHandlingId(const char *name);
+};
+extern cHandlingDataMgr &mod_HandlingManager;
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index 8857f8c9..8cfc17e7 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -46,6 +46,37 @@ CTempDetachedNode *&DetachedNodesCars = *(CTempDetachedNode**)0x8E2824;
CTempDetachedNode *&DetachedNodesPeds = *(CTempDetachedNode**)0x8E28A0;
void
+CPathFind::StoreNodeInfoPed(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, bool crossing)
+{
+ int i;
+
+ i = id*12 + node;
+ InfoForTilePeds[i].type = type;
+ InfoForTilePeds[i].next = next;
+ InfoForTilePeds[i].x = x;
+ InfoForTilePeds[i].y = y;
+ InfoForTilePeds[i].z = z;
+ InfoForTilePeds[i].numLeftLanes = 0;
+ InfoForTilePeds[i].numRightLanes = 0;
+ InfoForTilePeds[i].crossing = crossing;
+}
+
+void
+CPathFind::StoreNodeInfoCar(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, int8 numLeft, int8 numRight)
+{
+ int i;
+
+ i = id*12 + node;
+ InfoForTileCars[i].type = type;
+ InfoForTileCars[i].next = next;
+ InfoForTileCars[i].x = x;
+ InfoForTileCars[i].y = y;
+ InfoForTileCars[i].z = z;
+ InfoForTileCars[i].numLeftLanes = numLeft;
+ InfoForTileCars[i].numRightLanes = numRight;
+}
+
+void
CPathFind::PreparePathData(void)
{
int i, j, k;
@@ -457,8 +488,8 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor
}
}else{
// Crosses road
- if(objectpathinfo[istart + iseg].next == jseg && objectpathinfo[istart + iseg].flag & 1 ||
- objectpathinfo[jstart + jseg].next == iseg && objectpathinfo[jstart + jseg].flag & 1)
+ if(objectpathinfo[istart + iseg].next == jseg && objectpathinfo[istart + iseg].crossing ||
+ objectpathinfo[jstart + jseg].next == iseg && objectpathinfo[jstart + jseg].crossing)
m_connectionFlags[m_numConnections] |= ConnectionCrossRoad;
else
m_connectionFlags[m_numConnections] &= ~ConnectionCrossRoad;
diff --git a/src/control/PathFind.h b/src/control/PathFind.h
index 495c4a73..ed3c7e9f 100644
--- a/src/control/PathFind.h
+++ b/src/control/PathFind.h
@@ -65,7 +65,7 @@ struct CPathInfoForObject
int8 next;
int8 numLeftLanes;
int8 numRightLanes;
- uint8 flag;
+ uint8 crossing : 1;
};
struct CTempNode
@@ -123,6 +123,8 @@ public:
void PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoForObject *objectpathinfo,
float unk, CTempDetachedNode *detachednodes, int unused);
void CalcNodeCoors(int16 x, int16 y, int16 z, int32 id, CVector *out);
+ void StoreNodeInfoPed(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, bool crossing);
+ void StoreNodeInfoCar(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, int8 numLeft, int8 numRight);
};
static_assert(sizeof(CPathFind) == 0x4c8f4, "CPathFind: error");
diff --git a/src/control/PedStats.cpp b/src/control/PedStats.cpp
new file mode 100644
index 00000000..3cb40d76
--- /dev/null
+++ b/src/control/PedStats.cpp
@@ -0,0 +1,5 @@
+#include "common.h"
+#include "patcher.h"
+#include "PedStats.h"
+
+WRAPPER int32 CPedStats::GetPedStatType(char *type) { EAXJMP(0x4EF780); }
diff --git a/src/control/PedStats.h b/src/control/PedStats.h
new file mode 100644
index 00000000..12ebdbc2
--- /dev/null
+++ b/src/control/PedStats.h
@@ -0,0 +1,23 @@
+#pragma once
+
+struct PedStat
+{
+ uint32 m_id;
+ char m_name[24];
+ int32 m_fleeDistance;
+ int32 m_headingChangeRate;
+ int8 m_fear;
+ int8 m_temper;
+ int8 m_lawfulness;
+ int8 m_sexiness;
+ int32 m_attackStrength;
+ int32 m_defendWeakness;
+ int16 m_flags;
+};
+static_assert(sizeof(PedStat) == 0x34, "PedStat: error");
+
+class CPedStats
+{
+public:
+ static int32 GetPedStatType(char *type);
+};
diff --git a/src/control/PedType.cpp b/src/control/PedType.cpp
new file mode 100644
index 00000000..587aa815
--- /dev/null
+++ b/src/control/PedType.cpp
@@ -0,0 +1,5 @@
+#include "common.h"
+#include "patcher.h"
+#include "PedType.h"
+
+WRAPPER int32 CPedType::FindPedType(char *type) { EAXJMP(0x4EEC10); }
diff --git a/src/control/PedType.h b/src/control/PedType.h
new file mode 100644
index 00000000..563dc294
--- /dev/null
+++ b/src/control/PedType.h
@@ -0,0 +1,7 @@
+#pragma once
+
+class CPedType
+{
+public:
+ static int32 FindPedType(char *type);
+};