Merge branch 'miami' into lcs

This commit is contained in:
Nikolay Korolev 2021-08-09 00:08:42 +03:00
commit c851d9a6ba
5 changed files with 25 additions and 8 deletions

View file

@ -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); float actualFactor = CalcSpeedScaleFactor(pPos1, pPos2, pDir1->x, pDir1->y, pDir2->x, pDir2->y);
CVector2D dir1 = *pDir1 * actualFactor; CVector2D dir1 = *pDir1 * actualFactor;
CVector2D dir2 = *pDir2 * actualFactor; CVector2D dir2 = *pDir2 * actualFactor;
float t1 = Abs(DotProduct2D(*pPos1 - *pPos2, *pDir1)); float t1 = Abs(DotProduct2D(*pPos2 - *pPos1, *pDir1));
float t2 = Abs(DotProduct2D(*pPos2 - *pPos1, *pDir2)); float t2 = Abs(DotProduct2D(*pPos1 - *pPos2, *pDir2));
float curveCoef; float curveCoef;
if (t1 > t2) { 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; curveCoef = 0.0f;
else 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 { 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; curveCoef = 1.0f;
else else
curveCoef = 0.5f - 0.5f * Cos(3.1415f * between * (t1 + t2) / (2 * t1)); curveCoef = 0.5f - 0.5f * Cos(3.1415f * between * (t1 + t2) / (2 * t1));

View file

@ -4078,7 +4078,7 @@ CCamera::IsPointVisible(const CVector &center, const CMatrix *mat)
} }
bool bool
CCamera::IsSphereVisible(const CVector &center, float radius, Const CMatrix *mat) CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat)
{ {
#ifdef GTA_PS2 #ifdef GTA_PS2
CVuVector c; CVuVector c;

View file

@ -632,7 +632,7 @@ public:
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; } CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
void CalculateDerivedValues(void); void CalculateDerivedValues(void);
bool IsPointVisible(const CVector &center, const CMatrix *mat); 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 IsSphereVisible(const CVector &center, float radius);
bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat); bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat);
}; };

View file

@ -1058,9 +1058,11 @@ INITSAVEBUF
WriteSaveHeader(buf, 'R', 'D', 'R', '\0', *size - SAVE_HEADER_SIZE); WriteSaveHeader(buf, 'R', 'D', 'R', '\0', *size - SAVE_HEADER_SIZE);
#ifdef MAP_ENHANCEMENTS #ifdef MAP_ENHANCEMENTS
bool bWaypointDeleted = false;
if (TargetMarkerId != -1) { if (TargetMarkerId != -1) {
ClearBlip(TargetMarkerId); ClearBlip(TargetMarkerId);
TargetMarkerId = -1; TargetMarkerId = -1;
bWaypointDeleted = true;
} }
#endif #endif
@ -1085,6 +1087,11 @@ INITSAVEBUF
SkipSaveBuf(buf, sizeof(sRadarTraceSave)); SkipSaveBuf(buf, sizeof(sRadarTraceSave));
} }
#ifdef MAP_ENHANCEMENTS
if(bWaypointDeleted)
ToggleTargetMarker(TargetMarkerPos.x, TargetMarkerPos.y);
#endif
VALIDATESAVEBUF(*size); VALIDATESAVEBUF(*size);
} }

View file

@ -296,7 +296,7 @@ CTrain::ProcessControl(void)
TrainHitStuff(s->m_lists[ENTITYLIST_PEDS_OVERLAP]); TrainHitStuff(s->m_lists[ENTITYLIST_PEDS_OVERLAP]);
} }
} }
#endif GTA_TRAIN #endif // GTA_TRAIN
} }
void void