From 84e3b9dbe9af3a61c081b7678d1503e6c0fb46e1 Mon Sep 17 00:00:00 2001 From: Flakebi Date: Fri, 3 Jul 2015 15:38:20 +0200 Subject: [PATCH] Remove SKID_OLD code --- src/karts/skidding.cpp | 24 +----------------------- src/karts/skidding.hpp | 6 ++---- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/karts/skidding.cpp b/src/karts/skidding.cpp index 9fbff5b9f..2d006409c 100644 --- a/src/karts/skidding.cpp +++ b/src/karts/skidding.cpp @@ -67,7 +67,7 @@ Skidding::~Skidding() void Skidding::reset() { m_skid_time = 0.0f; - m_skid_state = m_skid_visual_time<=0 ? SKID_OLD : SKID_NONE; + m_skid_state = SKID_NONE; m_skid_factor = 1.0f; m_real_steering = 0.0f; m_visual_rotation = 0.0f; @@ -95,20 +95,8 @@ void Skidding::reset() */ void Skidding::updateSteering(float steer, float dt) { - if(m_skid_state==SKID_OLD) - { - float speed = m_kart->getSpeed(); - float current_max_speed = m_kart->getCurrentMaxSpeed(); - float speed_ratio = speed / current_max_speed; - m_real_steering = steer * m_skid_factor; - m_visual_rotation = m_real_steering /m_skid_max * speed_ratio; - return; - } - // Now only new skidding is happening switch(m_skid_state) { - case SKID_OLD: assert(false); - break; case SKID_SHOW_GFX_LEFT: case SKID_SHOW_GFX_RIGHT: case SKID_NONE: @@ -178,7 +166,6 @@ float Skidding::getSteeringWhenSkidding(float steering) const { switch(m_skid_state) { - case SKID_OLD: assert(false); break; case SKID_SHOW_GFX_LEFT: case SKID_SHOW_GFX_RIGHT: case SKID_BREAK: @@ -257,13 +244,6 @@ void Skidding::update(float dt, bool is_on_ground, else if(m_skid_factor<1.0f) m_skid_factor = 1.0f; - // FIXME hiker: remove once the new skidding code is finished. - if(m_skid_state == SKID_OLD) - { - updateSteering(steering, dt); - return; - } - // If skidding was started and a graphical jump should still // be displayed, update the data if(m_remaining_jump_time>0) @@ -456,8 +436,6 @@ void Skidding::update(float dt, bool is_on_ground, m_kart->getKartGFX()->updateSkidLight(0); m_skid_state = SKID_NONE; } - case SKID_OLD: - break; } // switch updateSteering(steering, dt); } // update diff --git a/src/karts/skidding.hpp b/src/karts/skidding.hpp index 9e74723a1..a53c0d989 100644 --- a/src/karts/skidding.hpp +++ b/src/karts/skidding.hpp @@ -74,7 +74,6 @@ private: float m_jump_speed; public: - /** SKID_OLD: old skidding, will be removed. */ /** SKID_NONE: Kart is currently not skidding. * SKID_ACCUMULATE_LEFT: Kart is skidding to the left and accumulating * for bonus. @@ -83,9 +82,8 @@ public: * and the kart was turning left. * SKID_SHOW_GFX_RIGHT: Similar for turning right. * SKID_BREAK: Skidding was stopped without bonus */ - enum SkidState {SKID_OLD, SKID_NONE, SKID_ACCUMULATE_LEFT, - SKID_ACCUMULATE_RIGHT, SKID_SHOW_GFX_LEFT, - SKID_SHOW_GFX_RIGHT, SKID_BREAK} ; + enum SkidState { SKID_NONE, SKID_ACCUMULATE_LEFT, SKID_ACCUMULATE_RIGHT, + SKID_SHOW_GFX_LEFT, SKID_SHOW_GFX_RIGHT, SKID_BREAK} ; private: /** The current skidding state. */