diff --git a/stepmania/src/LyricsLoader.cpp b/stepmania/src/LyricsLoader.cpp index 723eb9196c..4ded39a155 100644 --- a/stepmania/src/LyricsLoader.cpp +++ b/stepmania/src/LyricsLoader.cpp @@ -85,7 +85,7 @@ bool LyricsLoader::LoadFromLRCFile(const CString& sPath, Song& out) LyricSegment seg; seg.m_Color = CurrentColor; - seg.m_fStartTime = TimeToSeconds(sValueName); + seg.m_fStartTime = HHMMSSToSeconds(sValueName); seg.m_sLyric = sValueData; seg.m_sLyric.Replace( "|","\n" ); // Pipe symbols denote a new line in LRC files diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index f051673e85..c45ee224d4 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -310,10 +310,10 @@ float DWILoader::ParseBrokenDWITimestamp(const CString &arg1, const CString &arg /* 2+ args */ if(arg3.empty()) - return TimeToSeconds( arg1+":"+arg2 ); + return HHMMSSToSeconds( arg1+":"+arg2 ); /* 3+ args */ - return TimeToSeconds( arg1+":"+arg2+":"+arg3 ); + return HHMMSSToSeconds( arg1+":"+arg2+":"+arg3 ); } bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index 48cbb482c9..050aeb0ffe 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -269,10 +269,10 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) } else if( 0==stricmp(sValueName,"SAMPLESTART") ) - out.m_fMusicSampleStartSeconds = TimeToSeconds( sParams[1] ); + out.m_fMusicSampleStartSeconds = HHMMSSToSeconds( sParams[1] ); else if( 0==stricmp(sValueName,"SAMPLELENGTH") ) - out.m_fMusicSampleLengthSeconds = TimeToSeconds( sParams[1] ); + out.m_fMusicSampleLengthSeconds = HHMMSSToSeconds( sParams[1] ); else if( 0==stricmp(sValueName,"DISPLAYBPM") ) { diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 6a08cd0aa8..0966b9eb8c 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -78,6 +78,11 @@ void Profile::InitGeneralData() m_iNumToasties = 0; m_UnlockedSongs.clear(); m_sLastMachinePlayed = ""; + m_iNumTapsAndHolds = 0; + m_iNumJumps = 0; + m_iNumHolds = 0; + m_iNumMines = 0; + m_iNumHands = 0; int i; for( i=0; iAppendChild( "NumExtraStagesPassed", m_iNumExtraStagesPassed ); pGeneralDataNode->AppendChild( "NumExtraStagesFailed", m_iNumExtraStagesFailed ); pGeneralDataNode->AppendChild( "NumToasties", m_iNumToasties ); + pGeneralDataNode->AppendChild( "NumTapsAndHolds", m_iNumTapsAndHolds ); + pGeneralDataNode->AppendChild( "NumJumps", m_iNumJumps ); + pGeneralDataNode->AppendChild( "NumHolds", m_iNumHolds ); + pGeneralDataNode->AppendChild( "NumMines", m_iNumMines ); + pGeneralDataNode->AppendChild( "NumHands", m_iNumHands ); { XNode* pUnlockedSongs = pGeneralDataNode->AppendChild("UnlockedSongs"); @@ -605,7 +615,8 @@ void Profile::LoadEditableDataFromDir( CString sDir ) wstr = wstr.substr(0, 12); m_sDisplayName = WStringToCString(wstr); // TODO: strip invalid chars? - CLAMP( m_fWeightPounds, 0, 500 ); + if( m_fWeightPounds != 0 ) + CLAMP( m_fWeightPounds, 50, 500 ); } void Profile::LoadGeneralDataFromNode( const XNode* pNode ) @@ -624,6 +635,11 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) pNode->GetChildValue( "NumExtraStagesPassed", m_iNumExtraStagesPassed ); pNode->GetChildValue( "NumExtraStagesFailed", m_iNumExtraStagesFailed ); pNode->GetChildValue( "NumToasties", m_iNumToasties ); + pNode->GetChildValue( "NumTapsAndHolds", m_iNumTapsAndHolds ); + pNode->GetChildValue( "NumJumps", m_iNumJumps ); + pNode->GetChildValue( "NumHolds", m_iNumHolds ); + pNode->GetChildValue( "NumMines", m_iNumMines ); + pNode->GetChildValue( "NumHands", m_iNumHands ); { XNode* pUnlockedSongs = pNode->GetChild("UnlockedSongs"); @@ -699,6 +715,25 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) } } +void Profile::AddStepTotals( int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumMines, int iNumHands ) +{ + m_iNumTapsAndHolds += iNumTapsAndHolds; + m_iNumJumps += iNumJumps; + m_iNumHolds += iNumHolds; + m_iNumMines += iNumMines; + m_iNumHands += iNumHands; + + if( m_fWeightPounds != 0 ) + { + float fCals = + SCALE( m_fWeightPounds, 100.f, 200.f, 0.029f, 0.052f ) * iNumTapsAndHolds + + SCALE( m_fWeightPounds, 100.f, 200.f, 0.111f, 0.193f ) * iNumJumps + + SCALE( m_fWeightPounds, 100.f, 200.f, 0.029f, 0.052f ) * iNumHolds + + SCALE( m_fWeightPounds, 100.f, 200.f, 0.000f, 0.000f ) * iNumMines + + SCALE( m_fWeightPounds, 100.f, 200.f, 0.222f, 0.386f ) * iNumHands; + m_fCaloriesBurned += fCals; + } +} XNode* Profile::SaveSongScoresCreateNode() const { diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index 1ebf080633..95a12a0f90 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -66,7 +66,7 @@ public: // smart accessors // CString GetDisplayName() const; - CString GetDisplayCaloriesBurned(); + CString GetDisplayCaloriesBurned() const; int GetTotalNumSongsPlayed() const; int GetTotalNumSongsPassed() const; static CString GetProfileDisplayNameFromDir( CString sDir ); @@ -93,6 +93,11 @@ public: int m_iNumExtraStagesPassed; int m_iNumExtraStagesFailed; int m_iNumToasties; + int m_iNumTapsAndHolds; + int m_iNumJumps; + int m_iNumHolds; + int m_iNumMines; + int m_iNumHands; set m_UnlockedSongs; mutable CString m_sLastMachinePlayed; // mutable because we overwrite this on save, and I don't want to remove const from the whole save chain. -Chris int m_iNumSongsPlayedByPlayMode[NUM_PLAY_MODES]; @@ -102,6 +107,7 @@ public: int m_iNumSongsPassedByPlayMode[NUM_PLAY_MODES]; int m_iNumSongsPassedByGrade[NUM_GRADES]; + void AddStepTotals( int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumMines, int iNumHands ); // // Steps high scores diff --git a/stepmania/src/ProfileHtml.cpp b/stepmania/src/ProfileHtml.cpp index b6b76ee9d1..a0c7f406a8 100644 --- a/stepmania/src/ProfileHtml.cpp +++ b/stepmania/src/ProfileHtml.cpp @@ -23,6 +23,7 @@ #include "Bookkeeper.h" #include "PrefsManager.h" #include "CryptManager.h" +#include "RageUtil.h" const CString STATS_HTML = "Stats.html"; @@ -40,7 +41,6 @@ inline void PRINT_OPEN(RageFile &f,CString sName,bool bExpanded,CString sID){ g_ inline void PRINT_OPEN(RageFile &f,CString sName,bool bExpanded=false) { PRINT_OPEN(f,sName,bExpanded,MakeUniqueId()); } inline void PRINT_CLOSE(RageFile &f) { f.Write( "\n" "\n" ); g_Level--; ASSERT(g_Level>=0); } -#define PRETTY_PERCENT(numerator,denominator) ssprintf("%0.2f%%",(float)numerator/(float)denominator*100) struct Table { @@ -52,7 +52,7 @@ struct Table Line(CString n) { sName = n; } Line(CString n,CString v) { sName = n; sValue = v; } Line(CString n,bool v) { sName = n; sValue = ssprintf("%s",v?"yes":"no"); } - Line(CString n,int v) { sName = n; sValue = ssprintf("%d",v); } + Line(CString n,int v) { sName = n; sValue = Commify(v); } Line(int r,CString n,int v) { sRank = ssprintf("%d",r); sName = n; sValue = ssprintf("%d",v); } Line(int r,CString n,CString sn,int v) { sRank = ssprintf("%d",r); sName = n; sSubName = sn; sValue = ssprintf("%d",v); } Line(int r,CString n,CString sn,CString ssn,int v) { sRank = ssprintf("%d",r); sName = n; sSubName = sn; sSubSubName = ssn; sValue = ssprintf("%d",v); } @@ -274,11 +274,16 @@ void PrintStatistics( RageFile &f, const Profile *pProfile, CString sTitle, vect TABLE_LINE2( "UsingProfileDefaultModifiers", pProfile->m_bUsingProfileDefaultModifiers ); TABLE_LINE2( "DefaultModifiers", pProfile->m_sDefaultModifiers ); TABLE_LINE2( "TotalPlays", pProfile->m_iTotalPlays ); - TABLE_LINE2( "TotalPlaySeconds", pProfile->m_iTotalPlaySeconds ); - TABLE_LINE2( "TotalGameplaySeconds", pProfile->m_iTotalGameplaySeconds ); + TABLE_LINE2( "TotalPlay", SecondsToHHMMSS(pProfile->m_iTotalPlaySeconds) ); + TABLE_LINE2( "TotalGameplay", SecondsToHHMMSS(pProfile->m_iTotalGameplaySeconds) ); TABLE_LINE2( "CurrentCombo", pProfile->m_iCurrentCombo ); - TABLE_LINE2( "CaloriesBurned", pProfile->m_fCaloriesBurned ); + TABLE_LINE2( "CaloriesBurned", pProfile->GetDisplayCaloriesBurned() ); TABLE_LINE2( "LastMachinePlayed", pProfile->m_sLastMachinePlayed ); + TABLE_LINE2( "NumTapsAndHolds", pProfile->m_iNumTapsAndHolds ); + TABLE_LINE2( "NumJumps", pProfile->m_iNumJumps ); + TABLE_LINE2( "NumHolds", pProfile->m_iNumHolds ); + TABLE_LINE2( "NumMines", pProfile->m_iNumMines ); + TABLE_LINE2( "NumHands", pProfile->m_iNumHands ); END_TABLE; } PRINT_CLOSE(f); @@ -393,7 +398,7 @@ void PrintPopularity( RageFile &f, const Profile *pProfile, CString sTitle, vect int iNumTimesPlayed = pProfile->GetSongNumTimesPlayed(pSong); if( iNumTimesPlayed == 0 || iNumTimesPlayed < iPopularNumPlaysThreshold ) // not popular break; // done searching - TABLE_LINE4(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), PRETTY_PERCENT(iNumTimesPlayed,iTotalPlays) ); + TABLE_LINE4(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), PrettyPercent(iNumTimesPlayed,iTotalPlays) ); } if( i == 0 ) TABLE_LINE1("empty"); @@ -414,7 +419,7 @@ void PrintPopularity( RageFile &f, const Profile *pProfile, CString sTitle, vect int iNumTimesPlayed = pProfile->GetSongNumTimesPlayed(pSong); if( iNumTimesPlayed >= iPopularNumPlaysThreshold ) // not unpopular break; // done searching - TABLE_LINE4(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), PRETTY_PERCENT(iNumTimesPlayed,iTotalPlays) ); + TABLE_LINE4(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), PrettyPercent(iNumTimesPlayed,iTotalPlays) ); } if( i == 0 ) TABLE_LINE1("empty"); @@ -442,7 +447,7 @@ void PrintPopularity( RageFile &f, const Profile *pProfile, CString sTitle, vect s += GAMEMAN->NotesTypeToString(pSteps->m_StepsType); s += " "; s += DifficultyToString(pSteps->GetDifficulty()); - TABLE_LINE5(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), s, PRETTY_PERCENT(iNumTimesPlayed,iTotalPlays) ); + TABLE_LINE5(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), s, PrettyPercent(iNumTimesPlayed,iTotalPlays) ); } if( i == 0 ) TABLE_LINE1("empty"); @@ -463,7 +468,7 @@ void PrintPopularity( RageFile &f, const Profile *pProfile, CString sTitle, vect { Course* pCourse = vpCourses[i]; int iNumTimesPlayed = pProfile->GetCourseNumTimesPlayed(pCourse); - TABLE_LINE3(i+1, pCourse->m_sName, PRETTY_PERCENT(iNumTimesPlayed,iTotalPlays) ); + TABLE_LINE3(i+1, pCourse->m_sName, PrettyPercent(iNumTimesPlayed,iTotalPlays) ); } if( i == 0 ) TABLE_LINE1("empty"); @@ -761,7 +766,7 @@ bool PrintInventoryForSong( RageFile &f, const Profile *pProfile, Song* pSong ) CString sBPM = (fMinBPM==fMaxBPM) ? ssprintf("%.1f",fMinBPM) : ssprintf("%.1f - %.1f",fMinBPM,fMaxBPM); TABLE_LINE2( "BPM", sBPM ); TABLE_LINE2( "Credit", pSong->m_sCredit ); - TABLE_LINE2( "MusicLength", SecondsToTime(pSong->m_fMusicLengthSeconds) ); + TABLE_LINE2( "MusicLength", SecondsToMMSSMsMs(pSong->m_fMusicLengthSeconds) ); TABLE_LINE2( "Lyrics", !pSong->m_sLyricsFile.empty() ); TABLE_LINE2( "NumTimesPlayed", pProfile->GetSongNumTimesPlayed(pSong) ); END_TABLE; diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index ca64741f72..ee285ebc78 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -436,6 +436,13 @@ void ProfileManager::IncrementToastiesCount( PlayerNumber pn ) ++PROFILEMAN->GetMachineProfile()->m_iNumToasties; } +void ProfileManager::AddStepTotals( PlayerNumber pn, int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumMines, int iNumHands ) +{ + if( PROFILEMAN->IsUsingProfile(pn) ) + PROFILEMAN->GetProfile(pn)->AddStepTotals( iNumTapsAndHolds, iNumJumps, iNumHolds, iNumMines, iNumHands ); + PROFILEMAN->GetMachineProfile()->AddStepTotals( iNumTapsAndHolds, iNumJumps, iNumHolds, iNumMines, iNumHands ); +} + // // Song stats // diff --git a/stepmania/src/ProfileManager.h b/stepmania/src/ProfileManager.h index d34203cf4a..9ca4fecf7f 100644 --- a/stepmania/src/ProfileManager.h +++ b/stepmania/src/ProfileManager.h @@ -42,6 +42,7 @@ public: // General data // void IncrementToastiesCount( PlayerNumber pn ); + void AddStepTotals( PlayerNumber pn, int iNumTapsAndHolds, int iNumJumps, int iNumHolds, int iNumMines, int iNumHands ); // @@ -77,7 +78,6 @@ public: bool ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const; - // // Song stats // diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index 3ba4779400..40bb4918e7 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -251,7 +251,7 @@ void RageLog::Write( int where, const CString &line ) CString LineHeader; if( m_bTimestamping ) - LineHeader += SecondsToTime(RageTimer::GetTimeSinceStart()) + ": "; + LineHeader += SecondsToMMSSMsMs(RageTimer::GetTimeSinceStart()) + ": "; if( where & WRITE_LOUD ) LineHeader += "WARNING: "; diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index dfb63426eb..de7c93a291 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -94,10 +94,10 @@ bool IsHexVal( const CString &s ) return true; } -float TimeToSeconds( const CString &sHMS ) +float HHMMSSToSeconds( const CString &sHHMMSS ) { CStringArray arrayBits; - split( sHMS, ":", arrayBits, false ); + split( sHHMMSS, ":", arrayBits, false ); while( arrayBits.size() < 3 ) arrayBits.insert(arrayBits.begin(), "0" ); // pad missing bits @@ -110,23 +110,40 @@ float TimeToSeconds( const CString &sHMS ) return fSeconds; } -CString SecondsToTime( float fSecs ) +CString SecondsToHHMMSS( float fSecs ) { const int iMinsDisplay = (int)fSecs/60; const int iSecsDisplay = (int)fSecs - iMinsDisplay*60; const float fLeftoverDisplay = (fSecs - iMinsDisplay*60 - iSecsDisplay) * 100; - CString sReturn = ssprintf( "%02d:%02d:%02.0f", iMinsDisplay, iSecsDisplay, min(99.0f,fLeftoverDisplay) ); - if( iMinsDisplay >= 60 ) - { - /* Oops. Probably a really long endless course. Do "hh:mm.ss"; use a period - * to differentiate between "mm:ss:ms". I'd much prefer reversing those, since - * it makes much more sense to do "mm:ss.ms", but people would probably complain - * about "arcade accuracy" ... - */ - sReturn = ssprintf( "%02d:%02d.%02d", iMinsDisplay/60, iMinsDisplay%60, iSecsDisplay ); - } + CString sReturn = ssprintf( "%02d:%02d:%02d", iMinsDisplay/60, iMinsDisplay%60, iSecsDisplay ); + return sReturn; +} - ASSERT( sReturn.GetLength() <= 8 ); +CString SecondsToMMSSMsMs( float fSecs ) +{ + const int iMinsDisplay = (int)fSecs/60; + const int iSecsDisplay = (int)fSecs - iMinsDisplay*60; + const float fLeftoverDisplay = (fSecs - iMinsDisplay*60 - iSecsDisplay) * 100; + CString sReturn = ssprintf( "%02d:%02d.%02.0f", iMinsDisplay, iSecsDisplay, min(99.0f,fLeftoverDisplay) ); + return sReturn; +} + +CString PrettyPercent( float fNumerator, float fDenominator) +{ + return ssprintf("%0.2f%%",(float)fNumerator/(float)fDenominator*100); +} + +CString Commify( int iNum ) +{ + CString sNum = ssprintf("%d",iNum); + CString sReturn; + for( int i=0; iIsPlayerEnabled(m_PlayerNumber) ) fSecsIntoPlay = g_CurStageStats.fAliveSeconds[m_PlayerNumber]; - m_text.SetText( SecondsToTime(fSecsIntoPlay) ); + m_text.SetText( SecondsToMMSSMsMs(fSecsIntoPlay) ); } diff --git a/stepmania/src/ScreenEndlessBreak.cpp b/stepmania/src/ScreenEndlessBreak.cpp index ed4c52d9ef..8236afbdbe 100644 --- a/stepmania/src/ScreenEndlessBreak.cpp +++ b/stepmania/src/ScreenEndlessBreak.cpp @@ -59,7 +59,7 @@ ScreenEndlessBreak::ScreenEndlessBreak( CString sName ) : Screen( sName ) //BitmapText stuff m_textTimeRemaining.LoadFromFont( THEME->GetPathToF("Common Normal") ); - m_textTimeRemaining.SetText( SecondsToTime(m_fCountdownSecs) ); + m_textTimeRemaining.SetText( SecondsToMMSSMsMs(m_fCountdownSecs) ); m_textTimeRemaining.SetX( CENTER_X ); m_textTimeRemaining.SetY( CENTER_Y ); @@ -74,7 +74,7 @@ ScreenEndlessBreak::ScreenEndlessBreak( CString sName ) : Screen( sName ) void ScreenEndlessBreak::Update(float fDeltaTime) { - m_textTimeRemaining.SetText( SecondsToTime(m_fCountdownSecs) ); + m_textTimeRemaining.SetText( SecondsToMMSSMsMs(m_fCountdownSecs) ); if( !m_bExiting ) if(m_fCountdownSecs <= 0) { diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index c11db864b2..70a4e5682a 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -740,7 +740,7 @@ void ScreenEvaluation::Init() m_textTime[p].SetDiffuse( PlayerToColor(p) ); m_textTime[p].SetName( ssprintf("TimeNumberP%d",p+1) ); SET_XY_AND_ON_COMMAND( m_textTime[p] ); - m_textTime[p].SetText( SecondsToTime(stageStats.fAliveSeconds[p]) ); + m_textTime[p].SetText( SecondsToMMSSMsMs(stageStats.fAliveSeconds[p]) ); this->AddChild( &m_textTime[p] ); } } @@ -873,6 +873,18 @@ void ScreenEvaluation::CommitScores( const StageStats &stageStats, int iPersonal if( !GAMESTATE->IsHumanPlayer(p) ) continue; + // + // Add step totals + // + int iNumTapsAndHolds = stageStats.fRadarPossible[p][RADAR_NUM_TAPS_AND_HOLDS]; + int iNumJumps = stageStats.fRadarPossible[p][RADAR_NUM_JUMPS]; + int iNumHolds = stageStats.fRadarPossible[p][RADAR_NUM_HOLDS]; + int iNumMines = stageStats.fRadarPossible[p][RADAR_NUM_MINES]; + int iNumHands = stageStats.fRadarPossible[p][RADAR_NUM_HANDS]; + + PROFILEMAN->AddStepTotals( (PlayerNumber)p, iNumTapsAndHolds, iNumJumps, iNumHolds, iNumMines, iNumHands ); + + // whether or not to save scores when the stage was failed // depends on if this is a course or not ... it's handled // below in the switch diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 7bb403467e..4d7fddcb6c 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -2133,7 +2133,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) if( GAMESTATE->IsPlayerEnabled(p) ) fMaxSurviveSeconds = max( fMaxSurviveSeconds, g_CurStageStats.fAliveSeconds[p] ); ASSERT( fMaxSurviveSeconds > 0 ); - m_textSurviveTime.SetText( "TIME: " + SecondsToTime(fMaxSurviveSeconds) ); + m_textSurviveTime.SetText( "TIME: " + SecondsToMMSSMsMs(fMaxSurviveSeconds) ); SET_XY_AND_ON_COMMAND( m_textSurviveTime ); } diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 1051dfe4c7..a72896ee9c 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -266,8 +266,6 @@ void ScreenSystemLayer::UpdateTimestampAndSkips() m_SkipBackground.SetDiffuse(RageColor(0,0,0,0.4f)); } - CString time(SecondsToTime(RageTimer::GetTimeSinceStart())); - /* Use our own timer, so we ignore `/tab. */ const float UpdateTime = SkipTimer.GetDeltaTime(); @@ -291,6 +289,8 @@ void ScreenSystemLayer::UpdateTimestampAndSkips() if(skip) { + CString time(SecondsToMMSSMsMs(RageTimer::GetTimeSinceStart())); + static const RageColor colors[] = { RageColor(0,0,0,0), /* unused */ RageColor(0.2f,0.2f,1,1), /* light blue */ @@ -306,7 +306,11 @@ void ScreenSystemLayer::UpdateTimestampAndSkips() } } - m_textTime.SetText( time ); + if(PREFSMAN->m_bTimestamping) + { + CString time(SecondsToMMSSMsMs(RageTimer::GetTimeSinceStart())); + m_textTime.SetText( time ); + } } void ScreenSystemLayer::Update( float fDeltaTime ) diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 267e7334ba..08870e9a02 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -736,7 +736,7 @@ float ScreenRanking::SetPage( PageToShow pts ) if( pts.pCourse->IsOni() ) { m_textPoints[l].SetText( ssprintf("%04d",hs.iScore) ); - m_textTime[l].SetText( SecondsToTime(hs.fSurviveSeconds) ); + m_textTime[l].SetText( SecondsToMMSSMsMs(hs.fSurviveSeconds) ); m_textScores[l].SetText( "" ); } else { m_textPoints[l].SetText( "" ); diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index 8a573020bb..aa3aa88151 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -403,9 +403,9 @@ void ScreenSelectCourse::AfterCourseChange() m_textNumSongs.SetText( ssprintf("%d", pCourse->GetEstimatedNumStages()) ); float fTotalSeconds; if( pCourse->GetTotalSeconds(fTotalSeconds) ) - m_textTime.SetText( SecondsToTime(fTotalSeconds) ); + m_textTime.SetText( SecondsToMMSSMsMs(fTotalSeconds) ); else - m_textTime.SetText( "xx:xx:xx" ); // The numbers format doesn't have a '?'. Is there a better solution? + m_textTime.SetText( "xx:xx.xx" ); // The numbers format doesn't have a '?'. Is there a better solution? m_Banner.LoadFromCourse( pCourse ); @@ -434,7 +434,7 @@ void ScreenSelectCourse::AfterCourseChange() { /* use survive time */ float fSurviveSeconds = hsl.GetTopScore().fSurviveSeconds; - CString s = SecondsToTime(fSurviveSeconds); + CString s = SecondsToMMSSMsMs(fSurviveSeconds); /* dim the inital unsignificant digits */ /*XXX we'd like to have a dimmed ':' and '.', but