summaryrefslogtreecommitdiffstats
path: root/src/control/AutoPilot.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-06-28 02:59:07 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-28 04:12:54 +0200
commitf8297df9c5a7d65d5658d1a8d85d391fbb15b95a (patch)
tree9dcfac13fc3be99320ca7b546c4ff2007bff4121 /src/control/AutoPilot.cpp
parentRemove waiting for stream closure in multi-thread audio (diff)
downloadre3-f8297df9c5a7d65d5658d1a8d85d391fbb15b95a.tar
re3-f8297df9c5a7d65d5658d1a8d85d391fbb15b95a.tar.gz
re3-f8297df9c5a7d65d5658d1a8d85d391fbb15b95a.tar.bz2
re3-f8297df9c5a7d65d5658d1a8d85d391fbb15b95a.tar.lz
re3-f8297df9c5a7d65d5658d1a8d85d391fbb15b95a.tar.xz
re3-f8297df9c5a7d65d5658d1a8d85d391fbb15b95a.tar.zst
re3-f8297df9c5a7d65d5658d1a8d85d391fbb15b95a.zip
Diffstat (limited to 'src/control/AutoPilot.cpp')
-rw-r--r--src/control/AutoPilot.cpp60
1 files changed, 31 insertions, 29 deletions
diff --git a/src/control/AutoPilot.cpp b/src/control/AutoPilot.cpp
index d3de6ac2..db72548f 100644
--- a/src/control/AutoPilot.cpp
+++ b/src/control/AutoPilot.cpp
@@ -5,6 +5,7 @@
#include "CarCtrl.h"
#include "Curves.h"
#include "PathFind.h"
+#include "SaveBuf.h"
void CAutoPilot::ModifySpeed(float speed)
{
@@ -92,43 +93,44 @@ void CAutoPilot::Save(uint8*& buf)
void CAutoPilot::Load(uint8*& buf)
{
- m_nCurrentRouteNode = ReadSaveBuf<int32>(buf);
- m_nNextRouteNode = ReadSaveBuf<int32>(buf);
- m_nPrevRouteNode = ReadSaveBuf<int32>(buf);
- m_nTimeEnteredCurve = ReadSaveBuf<int32>(buf);
- m_nTimeToSpendOnCurrentCurve = ReadSaveBuf<int32>(buf);
- m_nCurrentPathNodeInfo = ReadSaveBuf<uint32>(buf);
- m_nNextPathNodeInfo = ReadSaveBuf<uint32>(buf);
- m_nPreviousPathNodeInfo = ReadSaveBuf<uint32>(buf);
- m_nAntiReverseTimer = ReadSaveBuf<uint32>(buf);
- m_nTimeToStartMission = ReadSaveBuf<uint32>(buf);
- m_nPreviousDirection = ReadSaveBuf<int8>(buf);
- m_nCurrentDirection = ReadSaveBuf<int8>(buf);
- m_nNextDirection = ReadSaveBuf<int8>(buf);
- m_nCurrentLane = ReadSaveBuf<int8>(buf);
- m_nNextLane = ReadSaveBuf<int8>(buf);
- m_nDrivingStyle = ReadSaveBuf<uint8>(buf);
- m_nCarMission = ReadSaveBuf<uint8>(buf);
- m_nTempAction = ReadSaveBuf<uint8>(buf);
- m_nTimeTempAction = ReadSaveBuf<uint32>(buf);
- m_fMaxTrafficSpeed = ReadSaveBuf<float>(buf);
- m_nCruiseSpeed = ReadSaveBuf<uint8>(buf);
- m_nCruiseSpeedMultiplierType = ReadSaveBuf<uint8>(buf);
+ ReadSaveBuf(&m_nCurrentRouteNode, buf);
+ ReadSaveBuf(&m_nNextRouteNode, buf);
+ ReadSaveBuf(&m_nPrevRouteNode, buf);
+ ReadSaveBuf(&m_nTimeEnteredCurve, buf);
+ ReadSaveBuf(&m_nTimeToSpendOnCurrentCurve, buf);
+ ReadSaveBuf(&m_nCurrentPathNodeInfo, buf);
+ ReadSaveBuf(&m_nNextPathNodeInfo, buf);
+ ReadSaveBuf(&m_nPreviousPathNodeInfo, buf);
+ ReadSaveBuf(&m_nAntiReverseTimer, buf);
+ ReadSaveBuf(&m_nTimeToStartMission, buf);
+ ReadSaveBuf(&m_nPreviousDirection, buf);
+ ReadSaveBuf(&m_nCurrentDirection, buf);
+ ReadSaveBuf(&m_nNextDirection, buf);
+ ReadSaveBuf(&m_nCurrentLane, buf);
+ ReadSaveBuf(&m_nNextLane, buf);
+ ReadSaveBuf(&m_nDrivingStyle, buf);
+ ReadSaveBuf(&m_nCarMission, buf);
+ ReadSaveBuf(&m_nTempAction, buf);
+ ReadSaveBuf(&m_nTimeTempAction, buf);
+ ReadSaveBuf(&m_fMaxTrafficSpeed, buf);
+ ReadSaveBuf(&m_nCruiseSpeed, buf);
+ ReadSaveBuf(&m_nCruiseSpeedMultiplierType, buf);
SkipSaveBuf(buf, 2);
- m_fCruiseSpeedMultiplier = ReadSaveBuf<float>(buf);
- uint8 flags = ReadSaveBuf<uint8>(buf);
+ ReadSaveBuf(&m_fCruiseSpeedMultiplier, buf);
+ uint8 flags;
+ ReadSaveBuf(&flags, buf);
m_bSlowedDownBecauseOfCars = !!(flags & BIT(0));
m_bSlowedDownBecauseOfPeds = !!(flags & BIT(1));
m_bStayInCurrentLevel = !!(flags & BIT(2));
m_bStayInFastLane = !!(flags & BIT(3));
m_bIgnorePathfinding = !!(flags & BIT(4));
- m_nSwitchDistance = ReadSaveBuf<uint8>(buf);
+ ReadSaveBuf(&m_nSwitchDistance, buf);
SkipSaveBuf(buf, 2);
- m_vecDestinationCoors.x = ReadSaveBuf<float>(buf);
- m_vecDestinationCoors.y = ReadSaveBuf<float>(buf);
- m_vecDestinationCoors.z = ReadSaveBuf<float>(buf);
+ ReadSaveBuf(&m_vecDestinationCoors.x, buf);
+ ReadSaveBuf(&m_vecDestinationCoors.y, buf);
+ ReadSaveBuf(&m_vecDestinationCoors.z, buf);
SkipSaveBuf(buf, 32);
- m_nPathFindNodesCount = ReadSaveBuf<int16>(buf);
+ ReadSaveBuf(&m_nPathFindNodesCount, buf);
SkipSaveBuf(buf, 6);
}
#endif \ No newline at end of file