diff --git a/stepmania/src/IniFile.h b/stepmania/src/IniFile.h index 3c398b2af7..08eedb687e 100644 --- a/stepmania/src/IniFile.h +++ b/stepmania/src/IniFile.h @@ -13,6 +13,7 @@ */ #include +using namespace std; class IniFile { diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index bc80dbc8ae..e521cb1c38 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -25,6 +25,8 @@ #include "ThemeManager.h" #include "RageSoundManager.h" +const int NUM_SCORE_DIGITS = 9; + // metrics that are common to all ScreenEvaluation classes #define BANNER_WIDTH THEME->GetMetricF("ScreenEvaluation","BannerWidth") #define BANNER_HEIGHT THEME->GetMetricF("ScreenEvaluation","BannerHeight") @@ -104,7 +106,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) // // debugging // - GAMESTATE->m_PlayMode = PLAY_MODE_NONSTOP; +/* GAMESTATE->m_PlayMode = PLAY_MODE_NONSTOP; GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS; GAMESTATE->m_MasterPlayerNumber = PLAYER_1; GAMESTATE->m_pCurSong = SONGMAN->GetAllSongs()[0]; @@ -116,7 +118,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) GAMESTATE->m_PlayerOptions[PLAYER_1].m_fScrollSpeed = 2; GAMESTATE->m_PlayerOptions[PLAYER_2].m_fScrollSpeed = 2; GAMESTATE->m_iCurrentStageIndex = 2; - +*/ LOG->Trace( "ScreenEvaluation::ScreenEvaluation()" ); @@ -144,6 +146,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) ASSERT(0); } +/* // // Debugging // @@ -155,6 +158,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) stageStats.fRadarActual[p][r] = 0.5f + r/10.0f; } } +*/ // // Calculate grades @@ -481,7 +485,7 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) case 5: iValue = stageStats.iTapNoteScores[p][TNS_MISS]; break; case 6: iValue = stageStats.iTapNoteScores[p][HNS_OK]; break; case 7: iValue = stageStats.iMaxCombo[p]; break; - default: ASSERT(0); + default: iValue = 0; ASSERT(0); } m_textJudgeNumbers[l][p].SetText( ssprintf("%4d",iValue) ); } @@ -508,10 +512,13 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) ) continue; // skip - m_ScoreDisplay[p].Init( (PlayerNumber)p ); - m_ScoreDisplay[p].Command( SCORE_NUMBER_ON_COMMAND(p) ); - m_ScoreDisplay[p].SetScore( stageStats.fScore[p] ); - this->AddChild( &m_ScoreDisplay[p] ); + m_textScore[p].LoadFromNumbers( THEME->GetPathTo("Numbers","ScreenEvaluation score numbers") ); + m_textScore[p].EnableShadow( false ); + m_textScore[p].SetDiffuse( PlayerToColor(p) ); + m_textScore[p].Command( SCORE_NUMBER_ON_COMMAND(p) ); + m_textScore[p].SetText( ssprintf("%*.0f", NUM_SCORE_DIGITS, stageStats.fScore[p]) ); + + this->AddChild( &m_textScore[p] ); } } @@ -532,10 +539,12 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName, Type type ) if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) ) continue; // skip - m_TimeDisplay[p].Init( (PlayerNumber)p ); - m_TimeDisplay[p].Command( TIME_NUMBER_ON_COMMAND(p) ); - m_TimeDisplay[p].SetText( SecondsToTime(stageStats.fAliveSeconds[p]) ); - this->AddChild( &m_TimeDisplay[p] ); + m_textTime[p].LoadFromNumbers( THEME->GetPathTo("Numbers","ScreenEvaluation score numbers") ); + m_textTime[p].EnableShadow( false ); + m_textTime[p].SetDiffuse( PlayerToColor(p) ); + m_textTime[p].Command( TIME_NUMBER_ON_COMMAND(p) ); + m_textTime[p].SetText( SecondsToTime(stageStats.fAliveSeconds[p]) ); + this->AddChild( &m_textTime[p] ); } } @@ -670,12 +679,12 @@ void ScreenEvaluation::TweenOffScreen() // score area m_sprScoreLabel.Command( SCORE_LABEL_OFF_COMMAND ); for( p=0; pGetMetric ("ScreenSelectMusic","BannerFrameOnCommand") #define BANNER_FRAME_OFF_COMMAND THEME->GetMetric ("ScreenSelectMusic","BannerFrameOffCommand") @@ -153,8 +154,10 @@ ScreenSelectMusic::ScreenSelectMusic() m_sprHighScoreFrame[p].SetState( p ); this->AddChild( &m_sprHighScoreFrame[p] ); - m_HighScore[p].SetDiffuse( PlayerToColor(p) ); - this->AddChild( &m_HighScore[p] ); + m_textHighScore[p].LoadFromNumbers( THEME->GetPathTo("Numbers","ScreenSelectMusic score numbers") ); + m_textHighScore[p].EnableShadow( false ); + m_textHighScore[p].SetDiffuse( PlayerToColor(p) ); + this->AddChild( &m_textHighScore[p] ); } m_MusicSortDisplay.Set( GAMESTATE->m_SongSortOrder ); @@ -209,50 +212,6 @@ void ScreenSelectMusic::DrawPrimitives() void ScreenSelectMusic::TweenOnScreen() { -/* - int p; - - m_sprBannerFrame.Command( 0, "bounce left", TWEEN_TIME ); - m_Banner.FadeOn( 0, "bounce left", TWEEN_TIME ); - m_BPMDisplay.FadeOn( 0, "bounce left", TWEEN_TIME ); - m_sprStage.FadeOn( 0, "bounce left", TWEEN_TIME ); - m_sprCDTitle.FadeOn( 0, "bounce left", TWEEN_TIME ); - - for( p=0; pIsExtraStage() || GAMESTATE->IsExtraStage2() ) @@ -304,7 +263,7 @@ void ScreenSelectMusic::TweenOffScreen() m_AutoGenIcon[p].Command( AUTOGEN_ICON_OFF_COMMAND(p) ); m_DifficultyMeter[p].Command( METER_OFF_COMMAND(p) ); m_sprHighScoreFrame[p].Command( SCORE_FRAME_OFF_COMMAND(p) ); - m_HighScore[p].Command( SCORE_OFF_COMMAND(p) ); + m_textHighScore[p].Command( SCORE_OFF_COMMAND(p) ); } } @@ -317,7 +276,7 @@ void ScreenSelectMusic::TweenScoreOnAndOffAfterChangeSort() for( int p=0; pm_pCurNotes[pn]; if( m_pNotes && SONGMAN->IsUsingMemoryCard(pn) ) - m_HighScore[pn].SetScore( m_pNotes->m_MemCardScores[pn].fScore ); + m_textHighScore[pn].SetText( ssprintf("%*.0f", NUM_SCORE_DIGITS, m_pNotes->m_MemCardScores[pn].fScore) ); m_DifficultyIcon[pn].SetFromNotes( pn, pNotes ); if( pNotes && pNotes->IsAutogen() ) diff --git a/stepmania/src/ScreenSelectMusic.h b/stepmania/src/ScreenSelectMusic.h index 2360726b7c..0df951dd0f 100644 --- a/stepmania/src/ScreenSelectMusic.h +++ b/stepmania/src/ScreenSelectMusic.h @@ -74,7 +74,7 @@ protected: DifficultyMeter m_DifficultyMeter[NUM_PLAYERS]; MusicSortDisplay m_MusicSortDisplay; Sprite m_sprHighScoreFrame[NUM_PLAYERS]; - ScoreDisplayNormal m_HighScore[NUM_PLAYERS]; + BitmapText m_textHighScore[NUM_PLAYERS]; MusicWheel m_MusicWheel; Sprite m_sprMarathonBalloon; Sprite m_sprLongBalloon;