float m_fScoreDisplay -> ScoreDisplay m_ScoreDisplay

minor cleanup
This commit is contained in:
Glenn Maynard
2005-01-10 15:10:02 +00:00
parent 681cf95ebc
commit 8c89672c89
3 changed files with 11 additions and 16 deletions
+5 -6
View File
@@ -33,7 +33,7 @@ void PlayerOptions::Init()
ZERO( m_bTurns ); ZERO( m_bTurns );
ZERO( m_bTransforms ); ZERO( m_bTransforms );
m_bProTiming = false; m_bProTiming = false;
m_fScoreDisplay = SCORING_ADD; m_ScoreDisplay = SCORING_ADD;
m_sPositioning = ""; // "null" m_sPositioning = ""; // "null"
m_sNoteSkin = "default"; m_sNoteSkin = "default";
} }
@@ -317,12 +317,11 @@ void PlayerOptions::FromString( CString sOptions )
else if ( sBit == "randomspeed" ) else if ( sBit == "randomspeed" )
SET_FLOAT( fRandomSpeed ) SET_FLOAT( fRandomSpeed )
else if ( sBit == "addscore" ) else if ( sBit == "addscore" )
m_fScoreDisplay = SCORING_ADD; m_ScoreDisplay = SCORING_ADD;
else if ( sBit == "subtractscore" ) else if ( sBit == "subtractscore" )
m_fScoreDisplay = SCORING_SUBTRACT; m_ScoreDisplay = SCORING_SUBTRACT;
else if ( sBit == "averagescore" ) else if ( sBit == "averagescore" )
m_fScoreDisplay = SCORING_AVERAGE; m_ScoreDisplay = SCORING_AVERAGE;
} }
} }
@@ -524,7 +523,7 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
COMPARE(m_fScrollSpeed); COMPARE(m_fScrollSpeed);
COMPARE(m_fScrollBPM); COMPARE(m_fScrollBPM);
COMPARE(m_fRandomSpeed); COMPARE(m_fRandomSpeed);
COMPARE(m_fScoreDisplay); COMPARE(m_ScoreDisplay);
COMPARE(m_fDark); COMPARE(m_fDark);
COMPARE(m_fBlind); COMPARE(m_fBlind);
COMPARE(m_fCover); COMPARE(m_fCover);
+1 -1
View File
@@ -125,7 +125,7 @@ struct PlayerOptions
bool m_bTurns[NUM_TURNS]; bool m_bTurns[NUM_TURNS];
bool m_bTransforms[NUM_TRANSFORMS]; bool m_bTransforms[NUM_TRANSFORMS];
bool m_bProTiming; bool m_bProTiming;
float m_fScoreDisplay; ScoreDisplay m_ScoreDisplay;
CString m_sPositioning; /* The current positioning mode, or empty to use the normal positions. */ CString m_sPositioning; /* The current positioning mode, or empty to use the normal positions. */
CString m_sNoteSkin; CString m_sNoteSkin;
+5 -9
View File
@@ -57,24 +57,20 @@ void ScoreDisplayNormal::SetScore( int iNewScore )
PlayerNumber pn = m_pPlayerState->m_PlayerNumber; PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
if ( m_pPlayerState->m_CurrentPlayerOptions.m_fScoreDisplay == PlayerOptions::SCORING_SUBTRACT ) if( m_pPlayerState->m_CurrentPlayerOptions.m_ScoreDisplay == PlayerOptions::SCORING_SUBTRACT )
{ {
if ( iNewScore == 0 && g_CurStageStats.m_player[pn].iMaxScoreToNow == 0 ) if( iNewScore == 0 && g_CurStageStats.m_player[pn].iMaxScoreToNow == 0 )
{
m_iScore = g_CurStageStats.m_player[pn].iMaxScore; m_iScore = g_CurStageStats.m_player[pn].iMaxScore;
}
else else
{
m_iScore = g_CurStageStats.m_player[pn].iMaxScore - ( g_CurStageStats.m_player[pn].iMaxScoreToNow - iNewScore ); m_iScore = g_CurStageStats.m_player[pn].iMaxScore - ( g_CurStageStats.m_player[pn].iMaxScoreToNow - iNewScore );
}
} }
else if ( m_pPlayerState->m_CurrentPlayerOptions.m_fScoreDisplay == PlayerOptions::SCORING_AVERAGE ) else if( m_pPlayerState->m_CurrentPlayerOptions.m_ScoreDisplay == PlayerOptions::SCORING_AVERAGE )
{ {
if ( g_CurStageStats.m_player[pn].iMaxScoreToNow == 0 ) // don't divide by zero fats if( g_CurStageStats.m_player[pn].iMaxScoreToNow == 0 ) // don't divide by zero fats
m_iScore = 0; m_iScore = 0;
else else
{ {
float scoreRatio = ( (float) iNewScore / (float) g_CurStageStats.m_player[pn].iMaxScoreToNow ); float scoreRatio = (float) iNewScore / (float) g_CurStageStats.m_player[pn].iMaxScoreToNow;
m_iScore = (int) ( scoreRatio * g_CurStageStats.m_player[pn].iMaxScore ); m_iScore = (int) ( scoreRatio * g_CurStageStats.m_player[pn].iMaxScore );
} }
} }