From 4b7dc08bf5aece0ca238edbb0a99e1f6550f9f64 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 9 Aug 2021 00:57:18 +0300 Subject: [PATCH] debug func fix --- src/control/CarCtrl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 29200d0a..0221a5eb 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -3442,10 +3442,12 @@ void CCarCtrl::RenderDebugInfo(CVehicle* pVehicle) CVector vCurPos(vCurNodePos); CVector vCurDir(0.0f, 0.0f, 1.0f); for (int i = 0; i < 10; i++) { - CVector vNextPos = vCurPos; + CVector vPrevPos = vCurPos; CCurves::CalcCurvePoint(&vCurNodePos, &vNextNodePos, &vCurLinkDir, &vNextLinkDir, i * 0.1f, pVehicle->AutoPilot.m_nTimeToSpendOnCurrentCurve, &vCurPos, &vCurDir); // Render3DLine(&vCurPos, &vNextPos, CVector(255.0f, 255.0f, 0.0f, 255.0f)); // <- originally this is called, let's reuse stuff we have - CLines::RenderLineWithClipping(vCurPos.x, vCurPos.y, vCurPos.z, vNextPos.x, vNextPos.y, vNextPos.z, 0xFF0000FF, 0xFF0000FF); + // TODO: not drawing :( + CLines::RenderLineWithClipping(vPrevPos.x, vPrevPos.y, vCurNodePos.z, vCurPos.x, vCurPos.y, vNextNodePos.z, 0xFFFF00FF, 0xFFFF00FF); // using NodePos for Z coord cause Curves set it to 0 } + DefinedState(); } }