Added Mmod compensation to ArrowEffects::GetYOffset.

This commit is contained in:
Kyzentun
2014-05-08 03:07:02 -06:00
parent e4f1905839
commit 2b9982f505
4 changed files with 14 additions and 11 deletions
+8 -4
View File
@@ -283,9 +283,16 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
// (per issue 24), edit this to reflect that. -aj // (per issue 24), edit this to reflect that. -aj
fYOffset *= ARROW_SPACING; fYOffset *= ARROW_SPACING;
// Factor in scroll speed
float fScrollSpeed = pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollSpeed;
if(pPlayerState->m_PlayerOptions.GetCurrent().m_fMaxScrollBPM != 0)
{
fScrollSpeed= pPlayerState->m_PlayerOptions.GetCurrent().m_fMaxScrollBPM / pPlayerState->m_fReadBPM;
}
// don't mess with the arrows after they've crossed 0 // don't mess with the arrows after they've crossed 0
if( fYOffset < 0 ) if( fYOffset < 0 )
return fYOffset * pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollSpeed; return fYOffset * fScrollSpeed;
const float* fAccels = pPlayerState->m_PlayerOptions.GetCurrent().m_fAccels; const float* fAccels = pPlayerState->m_PlayerOptions.GetCurrent().m_fAccels;
//const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects; //const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects;
@@ -326,9 +333,6 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
fYOffset = (-1*fYOffset*fYOffset/SCREEN_HEIGHT) + 1.5f*fYOffset; fYOffset = (-1*fYOffset*fYOffset/SCREEN_HEIGHT) + 1.5f*fYOffset;
} }
// Factor in scroll speed
float fScrollSpeed = pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollSpeed;
if( pPlayerState->m_PlayerOptions.GetCurrent().m_fRandomSpeed > 0 && !bAbsolute ) if( pPlayerState->m_PlayerOptions.GetCurrent().m_fRandomSpeed > 0 && !bAbsolute )
{ {
// Generate a deterministically "random" speed for each arrow. // Generate a deterministically "random" speed for each arrow.
+2 -5
View File
@@ -402,7 +402,7 @@ void Player::Init(
// calculate M-mod speed here, so we can adjust properly on a per-song basis. // calculate M-mod speed here, so we can adjust properly on a per-song basis.
// XXX: can we find a better location for this? // XXX: can we find a better location for this?
if( m_pPlayerState->m_PlayerOptions.GetCurrent().m_fMaxScrollBPM != 0 ) // Always calculate the reading bpm, to allow switching to an mmod mid-song.
{ {
DisplayBpms bpms; DisplayBpms bpms;
@@ -464,10 +464,7 @@ void Player::Init(
} }
ASSERT( fMaxBPM > 0 ); ASSERT( fMaxBPM > 0 );
m_pPlayerState->m_fReadBPM= fMaxBPM;
// set an X-mod equal to Mnum / fMaxBPM (e.g. M600 with 150 becomes 4x)
PO_GROUP_ASSIGN(m_pPlayerState->m_PlayerOptions, ModsLevel_Preferred, m_fScrollSpeed,
m_pPlayerState->m_PlayerOptions.GetPreferred().m_fMaxScrollBPM / fMaxBPM);
} }
float fBalance = GameSoundManager::GetPlayerBalance( pn ); float fBalance = GameSoundManager::GetPlayerBalance( pn );
+1 -2
View File
@@ -66,7 +66,7 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
APPROACH( fTimeSpacing ); APPROACH( fTimeSpacing );
APPROACH( fScrollSpeed ); APPROACH( fScrollSpeed );
//APPROACH( fMaxScrollBPM ); // if uncommented, causes crashes. -aj APPROACH( fMaxScrollBPM );
fapproach( m_fScrollBPM, other.m_fScrollBPM, fDeltaSeconds * other.m_SpeedfScrollBPM*150 ); fapproach( m_fScrollBPM, other.m_fScrollBPM, fDeltaSeconds * other.m_SpeedfScrollBPM*150 );
for( int i=0; i<NUM_ACCELS; i++ ) for( int i=0; i<NUM_ACCELS; i++ )
APPROACH( fAccels[i] ); APPROACH( fAccels[i] );
@@ -365,7 +365,6 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
m_fMaxScrollBPM = 0; m_fMaxScrollBPM = 0;
} }
// oITG's m-mods // oITG's m-mods
// XXX: will not properly tween, I don't think.
else if( sscanf( sBit, "m%f", &level ) == 1 ) else if( sscanf( sBit, "m%f", &level ) == 1 )
{ {
// OpenITG doesn't have this block: // OpenITG doesn't have this block:
+3
View File
@@ -136,6 +136,9 @@ public:
int m_iTapsHitSinceLastHasteUpdate; int m_iTapsHitSinceLastHasteUpdate;
int m_iTapsMissedSinceLastHasteUpdate; int m_iTapsMissedSinceLastHasteUpdate;
// Stores the bpm that was picked for reading the chart if the player is using an mmod.
float m_fReadBPM;
// Used in Rave // Used in Rave
float m_fSuperMeter; // between 0 and NUM_ATTACK_LEVELS float m_fSuperMeter; // between 0 and NUM_ATTACK_LEVELS
float m_fSuperMeterGrowthScale; float m_fSuperMeterGrowthScale;