From 3da3825e20e867b55a7bd4420070a8839ff34647 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 23 Jan 2006 06:53:11 +0000 Subject: [PATCH] remove TWEEN_SMOOTH. Use Bezier. --- stepmania/src/Actor.cpp | 2 -- stepmania/src/Tween.cpp | 29 ----------------------------- stepmania/src/Tween.h | 1 - 3 files changed, 32 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index f337e79a67..20a0386f3f 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -1328,7 +1328,6 @@ public: static int linear( T* p, lua_State *L ) { p->BeginTweening(FArg(1),TWEEN_LINEAR); return 0; } static int accelerate( T* p, lua_State *L ) { p->BeginTweening(FArg(1),TWEEN_ACCELERATE); return 0; } static int decelerate( T* p, lua_State *L ) { p->BeginTweening(FArg(1),TWEEN_DECELERATE); return 0; } - static int smooth( T* p, lua_State *L ) { p->BeginTweening(FArg(1),TWEEN_SMOOTH); return 0; } static int spring( T* p, lua_State *L ) { p->BeginTweening(FArg(1),TWEEN_SPRING); return 0; } static int tween( T* p, lua_State *L ) { @@ -1469,7 +1468,6 @@ public: ADD_METHOD( linear ); ADD_METHOD( accelerate ); ADD_METHOD( decelerate ); - ADD_METHOD( smooth ); ADD_METHOD( spring ); ADD_METHOD( tween ); ADD_METHOD( stoptweening ); diff --git a/stepmania/src/Tween.cpp b/stepmania/src/Tween.cpp index 41504bd7cb..dffbe58452 100644 --- a/stepmania/src/Tween.cpp +++ b/stepmania/src/Tween.cpp @@ -9,7 +9,6 @@ static const char *TweenTypeNames[] = { "Linear", "Accelerate", "Decelerate", - "Smooth", "Spring", "Bezier" }; @@ -41,33 +40,6 @@ struct TweenDecelerate: public ITween float Tween( float f ) const { return 1 - (1-f) * (1-f); } ITween *Copy() const { return new TweenDecelerate(*this); } }; -struct TweenSmooth: public ITween -{ - float Tween( float f ) const - { - /* Accelerate, reaching full speed at fShift, then decelerate the rest of - * the way. fShift = 1 degrades to TWEEN_ACCELERATE. fShift = 0 degrades - * to TWEEN_DECELERATE. (This is a rough approximation of a sigmoid.) */ - const float fShift = 0.5f; - if( f < fShift ) - { - f = SCALE( f, 0.0f, fShift, 0.0f, 1.0f ); - f = f * f; - f = SCALE( f, 0.0f, 1.0f, 0.0f, fShift ); - } - else - { - f = SCALE( f, fShift, 1.0f, 0.0f, 1.0f ); - f = 1 - (1-f) * (1-f); - f = SCALE( f, 0.0f, 1.0f, fShift, 1.0f ); - } - - return f; - } - - ITween *Copy() const { return new TweenSmooth(*this); } -}; - struct TweenSpring: public ITween { float Tween( float f ) const { return 1 - RageFastCos( f*PI*2.5f )/(1+f*3); } @@ -120,7 +92,6 @@ ITween *ITween::CreateFromType( TweenType tt ) case TWEEN_LINEAR: return new TweenLinear; case TWEEN_ACCELERATE: return new TweenAccelerate; case TWEEN_DECELERATE: return new TweenDecelerate; - case TWEEN_SMOOTH: return new TweenSmooth; /* * These may actually be faster than InterpolateBounceBegin/InterpolateBounceEnd, since diff --git a/stepmania/src/Tween.h b/stepmania/src/Tween.h index 02249605a4..621cbd3e94 100644 --- a/stepmania/src/Tween.h +++ b/stepmania/src/Tween.h @@ -9,7 +9,6 @@ enum TweenType TWEEN_LINEAR, TWEEN_ACCELERATE, TWEEN_DECELERATE, - TWEEN_SMOOTH, TWEEN_SPRING, TWEEN_BEZIER, NUM_TweenType