diff --git a/stepmania/src/GradeDisplay.cpp b/stepmania/src/GradeDisplay.cpp index 92da58df91..6f629119f5 100644 --- a/stepmania/src/GradeDisplay.cpp +++ b/stepmania/src/GradeDisplay.cpp @@ -7,22 +7,6 @@ #include "arch/Dialog/Dialog.h" #include "RageLog.h" - -const float SCROLL_TIME = 5.0f; -const float QUICK_SCROLL_TIME = .25f; -const int NUM_GRADE_FRAMES = 8; -const float GRADE_FRAME_HEIGHT = 1/(float)NUM_GRADE_FRAMES; -const float GRADES_TO_SCROLL = NUM_GRADE_FRAMES*4; - - -GradeDisplay::GradeDisplay() -{ - m_fTimeLeftInScroll = 0; - m_bDoScrolling = 0; - - SetGrade( PLAYER_1, Grade_NoData ); -} - void GradeDisplay::Load( RageTextureID ID ) { ID.bStretch = true; @@ -40,38 +24,6 @@ void GradeDisplay::Load( RageTextureID ID ) } } -void GradeDisplay::Update( float fDeltaTime ) -{ - Sprite::Update( fDeltaTime ); - - if( m_bDoScrolling ) - { - m_fTimeLeftInScroll -= fDeltaTime; - m_fTimeLeftInScroll = max( 0, m_fTimeLeftInScroll ); - - float fPercentIntoScrolling; - if( m_bDoScrolling == 1 ) - { - fPercentIntoScrolling = 1 - (m_fTimeLeftInScroll/SCROLL_TIME); - if( fPercentIntoScrolling < 0.75 ) - fPercentIntoScrolling = (fPercentIntoScrolling/0.75f) * (1 + 1.0f/NUM_GRADE_FRAMES); - else if( fPercentIntoScrolling < 0.9 ) - fPercentIntoScrolling = 1 + 1.0f/NUM_GRADE_FRAMES; - else - fPercentIntoScrolling = (1 + 1.0f/NUM_GRADE_FRAMES) - ((fPercentIntoScrolling-0.9f)/0.1f) * 1.0f/NUM_GRADE_FRAMES; - } else { - fPercentIntoScrolling = 1 - (m_fTimeLeftInScroll/QUICK_SCROLL_TIME); - } - - m_frectCurTexCoords.left = m_frectStartTexCoords.left*(1-fPercentIntoScrolling) + m_frectDestTexCoords.left*fPercentIntoScrolling; - m_frectCurTexCoords.top = m_frectStartTexCoords.top*(1-fPercentIntoScrolling) + m_frectDestTexCoords.top*fPercentIntoScrolling; - m_frectCurTexCoords.right = m_frectStartTexCoords.right*(1-fPercentIntoScrolling) + m_frectDestTexCoords.right*fPercentIntoScrolling; - m_frectCurTexCoords.bottom = m_frectStartTexCoords.bottom*(1-fPercentIntoScrolling) + m_frectDestTexCoords.bottom*fPercentIntoScrolling; - - this->SetCustomTextureRect( m_frectCurTexCoords ); - } -} - int GradeDisplay::GetFrameIndex( PlayerNumber pn, Grade g ) { if( Sprite::GetNumStates() == 1 ) @@ -111,9 +63,6 @@ void GradeDisplay::SetGrade( PlayerNumber pn, Grade g ) m_PlayerNumber = pn; m_Grade = g; - m_bDoScrolling = false; - StopUsingCustomCoords(); - if( g != Grade_NoData ) { SetState( GetFrameIndex(pn,g) ); @@ -125,69 +74,6 @@ void GradeDisplay::SetGrade( PlayerNumber pn, Grade g ) } } -void GradeDisplay::Scroll() -{ - m_bDoScrolling = true; - - int iFrameNo = GetFrameIndex( m_PlayerNumber, m_Grade ); - - m_frectDestTexCoords = *GetTextureCoordRectForState( iFrameNo ); - m_frectStartTexCoords = m_frectDestTexCoords; - m_frectStartTexCoords.top += GRADES_TO_SCROLL * GRADE_FRAME_HEIGHT; - m_frectStartTexCoords.bottom += GRADES_TO_SCROLL * GRADE_FRAME_HEIGHT; - - m_fTimeLeftInScroll = SCROLL_TIME; - - /* Set the initial position. */ - Update(0); -} - -void GradeDisplay::SettleImmediately() -{ - m_fTimeLeftInScroll = 0; -} - -void GradeDisplay::SettleQuickly() -{ - if( m_bDoScrolling != 1 ) - return; - - /* If we're in the last phase of scrolling, don't do this. */ - if( 1 - (m_fTimeLeftInScroll/SCROLL_TIME) >= 0.9 ) - return; - - /* m_frectDestTexCoords.top is between 0 and 1 (inclusive). m_frectCurTexCoords - * is somewhere above that. Shift m_frectCurTexCoords downwards so it's pointing - * at the same physical place (remember, the grade texture is tiled) but no more - * than one rotation away from the destination. */ - while( m_frectCurTexCoords.top > m_frectDestTexCoords.top + 1.0f ) - { - m_frectCurTexCoords.top -= 1.0f; - m_frectCurTexCoords.bottom -= 1.0f; - } - - m_frectStartTexCoords = m_frectCurTexCoords; - m_bDoScrolling = 2; - m_fTimeLeftInScroll = QUICK_SCROLL_TIME; -} - -// lua start -#include "LuaBinding.h" - -class LunaGradeDisplay: public Luna -{ -public: - static int scroll( T* p, lua_State *L ) { p->Scroll(); return 0; } - - LunaGradeDisplay() - { - ADD_METHOD( scroll ); - } -}; - -LUA_REGISTER_DERIVED_CLASS( GradeDisplay, Sprite ) -// lua end - /* * (c) 2001-2002 Chris Danford * All rights reserved. diff --git a/stepmania/src/GradeDisplay.h b/stepmania/src/GradeDisplay.h index 5a2408e109..cdb09521c7 100644 --- a/stepmania/src/GradeDisplay.h +++ b/stepmania/src/GradeDisplay.h @@ -11,35 +11,14 @@ class GradeDisplay : public Sprite { public: - GradeDisplay(); virtual void Load( RageTextureID ID ); - - virtual void Update( float fDeltaTime ); - void SetGrade( PlayerNumber pn, Grade g ); - void Scroll(); - void SettleImmediately(); - void SettleQuickly(); - - Grade GetGrade () const { return m_Grade; } - - // - // Lua - // - virtual void PushSelf( lua_State *L ); protected: int GetFrameIndex( PlayerNumber pn, Grade g ); PlayerNumber m_PlayerNumber; Grade m_Grade; - - // for scrolling; 0 = no, 1 = normal, 2 = quick - int m_bDoScrolling; - RectF m_frectStartTexCoords; - RectF m_frectDestTexCoords; - RectF m_frectCurTexCoords; - float m_fTimeLeftInScroll; }; #endif diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index c605e14991..aadd7ee511 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -809,9 +809,6 @@ void ScreenEvaluation::MenuStart( const InputEventPlus &input ) void ScreenEvaluation::HandleMenuStart() { - FOREACH_PlayerNumber( p ) - m_Grades[p].SettleImmediately(); - StartTransitioningScreen( SM_GoToNextScreen ); }