Remove SKID_OLD code

This commit is contained in:
Flakebi 2015-07-03 15:38:20 +02:00
parent d2ca7d11d7
commit 84e3b9dbe9
2 changed files with 3 additions and 27 deletions

View File

@ -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

View File

@ -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. */