summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-08 23:08:42 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-08 23:08:42 +0200
commitc851d9a6baa96ca404e416c4de12845839c72290 (patch)
tree3f115a97c2640f7af732002b99fa85ee17389de3
parentdebug func (diff)
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
downloadre3-c851d9a6baa96ca404e416c4de12845839c72290.tar
re3-c851d9a6baa96ca404e416c4de12845839c72290.tar.gz
re3-c851d9a6baa96ca404e416c4de12845839c72290.tar.bz2
re3-c851d9a6baa96ca404e416c4de12845839c72290.tar.lz
re3-c851d9a6baa96ca404e416c4de12845839c72290.tar.xz
re3-c851d9a6baa96ca404e416c4de12845839c72290.tar.zst
re3-c851d9a6baa96ca404e416c4de12845839c72290.zip
-rw-r--r--src/control/Curves.cpp20
-rw-r--r--src/core/Camera.cpp2
-rw-r--r--src/core/Camera.h2
-rw-r--r--src/core/Radar.cpp7
-rw-r--r--src/vehicles/Train.cpp2
5 files changed, 25 insertions, 8 deletions
diff --git a/src/control/Curves.cpp b/src/control/Curves.cpp
index ad7b35b5..9b075fb5 100644
--- a/src/control/Curves.cpp
+++ b/src/control/Curves.cpp
@@ -21,17 +21,27 @@ void CCurves::CalcCurvePoint(CVector* pPos1, CVector* pPos2, CVector* pDir1, CVe
float actualFactor = CalcSpeedScaleFactor(pPos1, pPos2, pDir1->x, pDir1->y, pDir2->x, pDir2->y);
CVector2D dir1 = *pDir1 * actualFactor;
CVector2D dir2 = *pDir2 * actualFactor;
- float t1 = Abs(DotProduct2D(*pPos1 - *pPos2, *pDir1));
- float t2 = Abs(DotProduct2D(*pPos2 - *pPos1, *pDir2));
+ float t1 = Abs(DotProduct2D(*pPos2 - *pPos1, *pDir1));
+ float t2 = Abs(DotProduct2D(*pPos1 - *pPos2, *pDir2));
float curveCoef;
if (t1 > t2) {
- if (between < (t1 - t2) / (t1 + t2))
+ float coef = (t1 - t2) / (t1 + t2);
+#ifdef FIX_BUGS
+ if (between <= coef)
+#else
+ if (between < coef)
+#endif
curveCoef = 0.0f;
else
- curveCoef = 0.5f - 0.5f * Cos(3.1415f * (t1 + t2) / (2 * t2) * (between - (t1 - t2) / (t1 + t2)));
+ curveCoef = 0.5f - 0.5f * Cos(3.1415f * (between - coef) * (t1 + t2) / (2 * t2));
}
else {
- if (2 * t1 / (t1 + t2) < between)
+ float coef = 2 * t1 / (t1 + t2);
+#ifdef FIX_BUGS
+ if (coef <= between)
+#else
+ if (coef < between)
+#endif
curveCoef = 1.0f;
else
curveCoef = 0.5f - 0.5f * Cos(3.1415f * between * (t1 + t2) / (2 * t1));
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 526f0015..6e632c7c 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -4078,7 +4078,7 @@ CCamera::IsPointVisible(const CVector &center, const CMatrix *mat)
}
bool
-CCamera::IsSphereVisible(const CVector &center, float radius, Const CMatrix *mat)
+CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat)
{
#ifdef GTA_PS2
CVuVector c;
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 3468f6d6..66a89f21 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -632,7 +632,7 @@ public:
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
void CalculateDerivedValues(void);
bool IsPointVisible(const CVector &center, const CMatrix *mat);
- bool IsSphereVisible(const CVector &center, float radius, Const CMatrix *mat);
+ bool IsSphereVisible(const CVector &center, float radius, const CMatrix *mat);
bool IsSphereVisible(const CVector &center, float radius);
bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat);
};
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 8d454d34..2a56598a 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -1058,9 +1058,11 @@ INITSAVEBUF
WriteSaveHeader(buf, 'R', 'D', 'R', '\0', *size - SAVE_HEADER_SIZE);
#ifdef MAP_ENHANCEMENTS
+ bool bWaypointDeleted = false;
if (TargetMarkerId != -1) {
ClearBlip(TargetMarkerId);
TargetMarkerId = -1;
+ bWaypointDeleted = true;
}
#endif
@@ -1085,6 +1087,11 @@ INITSAVEBUF
SkipSaveBuf(buf, sizeof(sRadarTraceSave));
}
+#ifdef MAP_ENHANCEMENTS
+ if(bWaypointDeleted)
+ ToggleTargetMarker(TargetMarkerPos.x, TargetMarkerPos.y);
+#endif
+
VALIDATESAVEBUF(*size);
}
diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp
index 3c3d45d7..57337459 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -296,7 +296,7 @@ CTrain::ProcessControl(void)
TrainHitStuff(s->m_lists[ENTITYLIST_PEDS_OVERLAP]);
}
}
-#endif GTA_TRAIN
+#endif // GTA_TRAIN
}
void