move enum TimingWindow to global for PrefsManager
This commit is contained in:
@@ -160,6 +160,20 @@ const CString& HoldNoteScoreToThemedString( HoldNoteScore hns );
|
|||||||
HoldNoteScore StringToHoldNoteScore( const CString& str );
|
HoldNoteScore StringToHoldNoteScore( const CString& str );
|
||||||
|
|
||||||
|
|
||||||
|
enum TimingWindow
|
||||||
|
{
|
||||||
|
TW_Tier1,
|
||||||
|
TW_Tier2,
|
||||||
|
TW_Tier3,
|
||||||
|
TW_Tier4,
|
||||||
|
TW_Tier5,
|
||||||
|
TW_Mine,
|
||||||
|
TW_Attack,
|
||||||
|
TW_Held,
|
||||||
|
TW_Roll
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Profile and MemCard stuff
|
// Profile and MemCard stuff
|
||||||
//
|
//
|
||||||
|
|||||||
+22
-38
@@ -47,47 +47,31 @@ CString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ){ return "AttackDisp
|
|||||||
/* Distance to search for a note in Step(), in seconds. */
|
/* Distance to search for a note in Step(), in seconds. */
|
||||||
static const float StepSearchDistance = 1.0f;
|
static const float StepSearchDistance = 1.0f;
|
||||||
|
|
||||||
enum HoldWindow { HW_OK, HW_Roll };
|
float AdjustedWindowSeconds( TimingWindow tw, bool bIsPlayingBeginner )
|
||||||
enum TapWindow { TW_Tier1, TW_Tier2, TW_Tier3, TW_Tier4, TW_Tier5, TW_Mine, TW_Attack };
|
|
||||||
|
|
||||||
|
|
||||||
float AdjustedWindowTap( TapWindow tw, bool bIsPlayingBeginner )
|
|
||||||
{
|
{
|
||||||
float fSecs = 0;
|
float fSecs = 0;
|
||||||
switch( tw )
|
switch( tw )
|
||||||
{
|
{
|
||||||
case TW_Tier1: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier1; break;
|
case TW_Tier1: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier1; break;
|
||||||
case TW_Tier2: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier2; break;
|
case TW_Tier2: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier2; break;
|
||||||
case TW_Tier3: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier3; break;
|
case TW_Tier3: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier3; break;
|
||||||
case TW_Tier4: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier4; break;
|
case TW_Tier4: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier4; break;
|
||||||
case TW_Tier5: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier5; break;
|
case TW_Tier5: fSecs = PREFSMAN->m_fJudgeWindowSecondsTier5; break;
|
||||||
case TW_Mine: fSecs = PREFSMAN->m_fJudgeWindowSecondsMine; break;
|
case TW_Mine: fSecs = PREFSMAN->m_fJudgeWindowSecondsMine; break;
|
||||||
case TW_Attack: fSecs = PREFSMAN->m_fJudgeWindowSecondsAttack; break;
|
case TW_Attack: fSecs = PREFSMAN->m_fJudgeWindowSecondsAttack; break;
|
||||||
|
case TW_Held: fSecs = PREFSMAN->m_fJudgeWindowSecondsHeld; break;
|
||||||
|
case TW_Roll: fSecs = PREFSMAN->m_fJudgeWindowSecondsRoll; break;
|
||||||
default: ASSERT(0);
|
default: ASSERT(0);
|
||||||
}
|
}
|
||||||
fSecs *= PREFSMAN->m_fJudgeWindowScale;
|
fSecs *= PREFSMAN->m_fJudgeWindowScale;
|
||||||
fSecs += PREFSMAN->m_fJudgeWindowAdd;
|
fSecs += PREFSMAN->m_fJudgeWindowAdd;
|
||||||
if( bIsPlayingBeginner && PREFSMAN->m_bMercifulBeginner && tw==TW_Tier5 )
|
if( tw==TW_Tier5 && bIsPlayingBeginner && PREFSMAN->m_bMercifulBeginner )
|
||||||
fSecs += 0.5f;
|
fSecs += 0.5f;
|
||||||
return fSecs;
|
return fSecs;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AdjustedWindowHold( HoldWindow hw, bool bIsPlayingBeginner )
|
|
||||||
{
|
|
||||||
float fSecs = 0;
|
|
||||||
switch( hw )
|
|
||||||
{
|
|
||||||
case HW_OK: fSecs = PREFSMAN->m_fJudgeWindowSecondsHeld; break;
|
|
||||||
case HW_Roll: fSecs = PREFSMAN->m_fJudgeWindowSecondsRoll; break;
|
|
||||||
default: ASSERT(0);
|
|
||||||
}
|
|
||||||
fSecs *= PREFSMAN->m_fJudgeWindowScale;
|
|
||||||
fSecs += PREFSMAN->m_fJudgeWindowAdd;
|
|
||||||
return fSecs;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ADJUSTED_WINDOW_TAP( tw ) AdjustedWindowTap( tw, IsPlayingBeginner() )
|
#define ADJUSTED_WINDOW_SECONDS( tw ) AdjustedWindowSeconds( tw, IsPlayingBeginner() )
|
||||||
#define ADJUSTED_WINDOW_HOLD( hw ) AdjustedWindowHold( hw, IsPlayingBeginner() )
|
|
||||||
|
|
||||||
|
|
||||||
Player::Player( bool bShowNoteField, bool bShowJudgment )
|
Player::Player( bool bShowNoteField, bool bShowJudgment )
|
||||||
@@ -665,7 +649,7 @@ void Player::Update( float fDeltaTime )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Decrease life
|
// Decrease life
|
||||||
fLife -= fDeltaTime/ADJUSTED_WINDOW_HOLD(HW_OK);
|
fLife -= fDeltaTime/ADJUSTED_WINDOW_SECONDS(TW_Held);
|
||||||
fLife = max( fLife, 0 ); // clamp
|
fLife = max( fLife, 0 ); // clamp
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -676,7 +660,7 @@ void Player::Update( float fDeltaTime )
|
|||||||
// give positive life in Step(), not here.
|
// give positive life in Step(), not here.
|
||||||
|
|
||||||
// Decrease life
|
// Decrease life
|
||||||
fLife -= fDeltaTime/ADJUSTED_WINDOW_HOLD(HW_Roll);
|
fLife -= fDeltaTime/ADJUSTED_WINDOW_SECONDS(TW_Roll);
|
||||||
fLife = max( fLife, 0 ); // clamp
|
fLife = max( fLife, 0 ); // clamp
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1122,20 +1106,20 @@ void Player::HandleStep( int col, const RageTimer &tm, bool bHeld )
|
|||||||
{
|
{
|
||||||
case TapNote::mine:
|
case TapNote::mine:
|
||||||
// stepped too close to mine?
|
// stepped too close to mine?
|
||||||
if( fSecondsFromTier2 <= ADJUSTED_WINDOW_TAP(TW_Mine) )
|
if( fSecondsFromTier2 <= ADJUSTED_WINDOW_SECONDS(TW_Mine) )
|
||||||
score = TNS_HitMine;
|
score = TNS_HitMine;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TapNote::attack:
|
case TapNote::attack:
|
||||||
if( fSecondsFromTier2 <= ADJUSTED_WINDOW_TAP(TW_Attack) && !tn.result.bHidden )
|
if( fSecondsFromTier2 <= ADJUSTED_WINDOW_SECONDS(TW_Attack) && !tn.result.bHidden )
|
||||||
score = TNS_Tier2; /* sentinel */
|
score = TNS_Tier2; /* sentinel */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if( fSecondsFromTier2 <= ADJUSTED_WINDOW_TAP(TW_Tier1) ) score = TNS_Tier1;
|
if( fSecondsFromTier2 <= ADJUSTED_WINDOW_SECONDS(TW_Tier1) ) score = TNS_Tier1;
|
||||||
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_TAP(TW_Tier2) ) score = TNS_Tier2;
|
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_SECONDS(TW_Tier2) ) score = TNS_Tier2;
|
||||||
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_TAP(TW_Tier3) ) score = TNS_Tier3;
|
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_SECONDS(TW_Tier3) ) score = TNS_Tier3;
|
||||||
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_TAP(TW_Tier4) ) score = TNS_Tier4;
|
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_SECONDS(TW_Tier4) ) score = TNS_Tier4;
|
||||||
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_TAP(TW_Tier5) ) score = TNS_Tier5;
|
else if( fSecondsFromTier2 <= ADJUSTED_WINDOW_SECONDS(TW_Tier5) ) score = TNS_Tier5;
|
||||||
else score = TNS_None;
|
else score = TNS_None;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1148,7 +1132,7 @@ void Player::HandleStep( int col, const RageTimer &tm, bool bHeld )
|
|||||||
// GetTapNoteScore always returns TNS_Tier1 in autoplay.
|
// GetTapNoteScore always returns TNS_Tier1 in autoplay.
|
||||||
// If the step is far away, don't judge it.
|
// If the step is far away, don't judge it.
|
||||||
if( m_pPlayerState->m_PlayerController == PC_AUTOPLAY &&
|
if( m_pPlayerState->m_PlayerController == PC_AUTOPLAY &&
|
||||||
fSecondsFromTier2 > ADJUSTED_WINDOW_TAP(TW_Tier5) )
|
fSecondsFromTier2 > ADJUSTED_WINDOW_SECONDS(TW_Tier5) )
|
||||||
{
|
{
|
||||||
score = TNS_None;
|
score = TNS_None;
|
||||||
break;
|
break;
|
||||||
@@ -1836,7 +1820,7 @@ void Player::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore )
|
|||||||
|
|
||||||
float Player::GetMaxStepDistanceSeconds()
|
float Player::GetMaxStepDistanceSeconds()
|
||||||
{
|
{
|
||||||
return GAMESTATE->m_SongOptions.m_fMusicRate * ADJUSTED_WINDOW_TAP(TW_Tier5);
|
return GAMESTATE->m_SongOptions.m_fMusicRate * ADJUSTED_WINDOW_SECONDS(TW_Tier5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::FadeToFail()
|
void Player::FadeToFail()
|
||||||
|
|||||||
Reference in New Issue
Block a user