From 55e0e4c0742d34710e2e80cc4aa7cc1549d40a6d Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 12 Oct 2013 22:51:03 +0000 Subject: [PATCH] Small improvements on skid lines git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14244 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/skid_marks.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/graphics/skid_marks.cpp b/src/graphics/skid_marks.cpp index 090982abf..1ae56cdf1 100644 --- a/src/graphics/skid_marks.cpp +++ b/src/graphics/skid_marks.cpp @@ -143,14 +143,11 @@ void SkidMarks::update(float dt, bool force_skid_marks, delta *= m_width; float distance = 0.0f; - if (m_current > 0) - { - Vec3 start = m_left[m_current - 1]->getCenterStart(); - Vec3 newPoint = (raycast_left.m_contactPointWS + raycast_right.m_contactPointWS)/2; - // this linear distance does not account for the kart turning, it's true, - // but it produces good enough results - distance = (newPoint - start).length(); - } + Vec3 start = m_left[m_current]->getCenterStart(); + Vec3 newPoint = (raycast_left.m_contactPointWS + raycast_right.m_contactPointWS)/2; + // this linear distance does not account for the kart turning, it's true, + // but it produces good enough results + distance = (newPoint - start).length(); m_left [m_current]->add(raycast_left.m_contactPointWS, raycast_left.m_contactPointWS + delta, @@ -271,7 +268,10 @@ void SkidMarks::SkidMarkQuads::add(const Vec3 &left, video::S3DVertex v; v.Color = m_start_color; - v.Color.setAlpha(m_start_alpha); + if (n == 0) + v.Color.setAlpha(0.0f); + else + v.Color.setAlpha(m_start_alpha); v.Pos = left.toIrrVector(); v.Pos.Y += m_z_offset; v.Normal = core::vector3df(0, 1, 0); @@ -317,7 +317,7 @@ void SkidMarks::SkidMarkQuads::fade(float f) a -= (a < m_fade_out ? a : (int)m_fade_out); c.setAlpha(a); - for(unsigned int i=0; i