fix brake/boost tweening
allow tweening to/from constant speed mods
This commit is contained in:
@@ -27,26 +27,32 @@ float g_fExpandSeconds = 0;
|
||||
|
||||
static float GetNoteFieldHeight( PlayerNumber pn )
|
||||
{
|
||||
return SCREEN_HEIGHT + fabsf(GAMESTATE->m_PlayerOptions[pn].m_fPerspectiveTilt)*200;
|
||||
return SCREEN_HEIGHT + fabsf(GAMESTATE->m_CurrentPlayerOptions[pn].m_fPerspectiveTilt)*200;
|
||||
}
|
||||
|
||||
float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat )
|
||||
{
|
||||
float fYOffset;
|
||||
if( !GAMESTATE->m_PlayerOptions[pn].m_bTimeSpacing )
|
||||
float fYOffset = 0;
|
||||
|
||||
/* Usually, fTimeSpacing is 0 or 1, in which case we use entirely beat spacing or
|
||||
* entirely time spacing (respectively). Occasionally, we tween between them. */
|
||||
if( GAMESTATE->m_CurrentPlayerOptions[pn].m_fTimeSpacing != 1.0f )
|
||||
{
|
||||
float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||
float fBeatsUntilStep = fNoteBeat - fSongBeat;
|
||||
fYOffset = fBeatsUntilStep * ARROW_SPACING;
|
||||
float fYOffsetBeatSpacing = fBeatsUntilStep * ARROW_SPACING;
|
||||
fYOffset += fYOffsetBeatSpacing * (1-GAMESTATE->m_CurrentPlayerOptions[pn].m_fTimeSpacing);
|
||||
}
|
||||
else
|
||||
|
||||
if( GAMESTATE->m_CurrentPlayerOptions[pn].m_fTimeSpacing != 0.0f )
|
||||
{
|
||||
float fSongSeconds = GAMESTATE->m_fMusicSeconds;
|
||||
float fNoteSeconds = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat(fNoteBeat);
|
||||
float fSecondsUntilStep = fNoteSeconds - fSongSeconds;
|
||||
float fBPM = GAMESTATE->m_PlayerOptions[pn].m_fScrollBPM;
|
||||
float fBPM = GAMESTATE->m_CurrentPlayerOptions[pn].m_fScrollBPM;
|
||||
float fBPS = fBPM/60.f;
|
||||
fYOffset = fSecondsUntilStep * fBPS * ARROW_SPACING;
|
||||
float fYOffsetTimeSpacing = fSecondsUntilStep * fBPS * ARROW_SPACING;
|
||||
fYOffset += fYOffsetTimeSpacing * GAMESTATE->m_CurrentPlayerOptions[pn].m_fTimeSpacing;
|
||||
}
|
||||
|
||||
// don't mess with the arrows after they've crossed 0
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
void PlayerOptions::Init()
|
||||
{
|
||||
m_bTimeSpacing = false;
|
||||
m_fTimeSpacing = 0; m_SpeedfTimeSpacing = 1.0f;
|
||||
m_fScrollSpeed = 1.0f; m_SpeedfScrollSpeed = 1.0f;
|
||||
m_fScrollBPM = 200; m_SpeedfScrollBPM = 1.0f;
|
||||
ZERO( m_fAccels ); ONE( m_SpeedfAccels );
|
||||
@@ -59,6 +59,7 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
|
||||
APP( fAppearances[i] );
|
||||
for( i=0; i<NUM_SCROLLS; i++ )
|
||||
APP( fScrolls[i] );
|
||||
APP( fTimeSpacing );
|
||||
APP( fScrollSpeed );
|
||||
APP( fDark );
|
||||
APP( fBlind );
|
||||
@@ -82,7 +83,7 @@ CString PlayerOptions::GetString() const
|
||||
{
|
||||
CString sReturn;
|
||||
|
||||
if( !m_bTimeSpacing )
|
||||
if( !m_fTimeSpacing )
|
||||
{
|
||||
if( m_fScrollSpeed != 1 )
|
||||
{
|
||||
@@ -206,7 +207,7 @@ void PlayerOptions::FromString( CString sOptions )
|
||||
vector<CString> matches;
|
||||
if( mult.Compare(sBit, matches) )
|
||||
{
|
||||
m_bTimeSpacing = false;
|
||||
m_fTimeSpacing = 0.0f;
|
||||
int ret = sscanf( matches[0], "%f", &m_fScrollSpeed );
|
||||
ASSERT( ret == 1 );
|
||||
continue;
|
||||
@@ -214,7 +215,7 @@ void PlayerOptions::FromString( CString sOptions )
|
||||
|
||||
else if( sscanf( sBit, "c%d", &i1 ) == 1 )
|
||||
{
|
||||
m_bTimeSpacing = true;
|
||||
m_fTimeSpacing = 1.0f;
|
||||
m_fScrollBPM = (float) i1;
|
||||
continue;
|
||||
}
|
||||
@@ -514,7 +515,7 @@ float PlayerOptions::GetReversePercentForColumn( int iCol )
|
||||
bool PlayerOptions::operator==( const PlayerOptions &other ) const
|
||||
{
|
||||
#define COMPARE(x) { if( x != other.x ) return false; }
|
||||
COMPARE(m_bTimeSpacing);
|
||||
COMPARE(m_fTimeSpacing);
|
||||
COMPARE(m_fScrollSpeed);
|
||||
COMPARE(m_fScrollBPM);
|
||||
COMPARE(m_fDark);
|
||||
@@ -544,7 +545,7 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
|
||||
|
||||
bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps )
|
||||
{
|
||||
if( m_bTimeSpacing && pSong->HasSignificantBpmChangesOrStops() )
|
||||
if( m_fTimeSpacing && pSong->HasSignificantBpmChangesOrStops() )
|
||||
return true;
|
||||
if( m_bTransforms[TRANSFORM_NOHOLDS] && pSteps->GetRadarValues()[RADAR_NUM_HOLDS]>0 )
|
||||
return true;
|
||||
|
||||
@@ -95,11 +95,9 @@ struct PlayerOptions
|
||||
};
|
||||
float GetReversePercentForColumn( int iCol ); // accounts for all Directions
|
||||
|
||||
|
||||
bool m_bTimeSpacing; // instead of Beat spacing
|
||||
|
||||
/* All floats have a corresponding speed setting, which determines how fast
|
||||
* PlayerOptions::Approach approaches. */
|
||||
float m_fTimeSpacing, m_SpeedfTimeSpacing; // instead of Beat spacing
|
||||
float m_fScrollSpeed, m_SpeedfScrollSpeed; // used if !m_bTimeSpacing
|
||||
float m_fScrollBPM, m_SpeedfScrollBPM; // used if m_bTimeSpacing
|
||||
float m_fAccels[NUM_ACCELS], m_SpeedfAccels[NUM_ACCELS];
|
||||
|
||||
Reference in New Issue
Block a user