From 1833d67aa9579f21f98d2187f9fa97735ce581e1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 26 Mar 2005 03:30:08 +0000 Subject: [PATCH] TIMER_SECONDS: int -> float --- stepmania/src/MenuTimer.cpp | 12 ++++++------ stepmania/src/MenuTimer.h | 2 +- stepmania/src/ScreenNameEntry.cpp | 2 +- stepmania/src/ScreenWithMenuElements.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stepmania/src/MenuTimer.cpp b/stepmania/src/MenuTimer.cpp index ce9a641119..a3f4985fc3 100644 --- a/stepmania/src/MenuTimer.cpp +++ b/stepmania/src/MenuTimer.cpp @@ -15,8 +15,8 @@ static const ThemeMetric WARNING_BEEP_START ("MenuTimer","WarningBeepStart" #define WARNING_COMMAND(i) THEME->GetMetricA ("MenuTimer", ssprintf("WarningCommand%i",i)) static const ThemeMetric ON_COMMAND ("MenuTimer","OnCommand"); -static const int TIMER_SECONDS = 99; -static const int MAX_STALL_SECONDS = 30; +static const float TIMER_PAUSE_SECONDS = 99; +static const float MAX_STALL_SECONDS = 30; MenuTimer::MenuTimer() { @@ -34,7 +34,7 @@ MenuTimer::MenuTimer() this->AddChild( &m_textDigit1 ); this->AddChild( &m_textDigit2 ); - SetSeconds( TIMER_SECONDS ); + SetSeconds( TIMER_PAUSE_SECONDS ); m_soundBeep.Load( THEME->GetPathS("MenuTimer","tick") ); } @@ -132,15 +132,15 @@ void MenuTimer::Stall() m_fStallSecondsLeft -= ToAdd; } -void MenuTimer::SetSeconds( int iSeconds ) +void MenuTimer::SetSeconds( float fSeconds ) { - m_fSecondsLeft = (float)iSeconds; + m_fSecondsLeft = fSeconds; CLAMP( m_fSecondsLeft, 0, 99 ); m_textDigit1.RunCommands( ON_COMMAND ); m_textDigit2.RunCommands( ON_COMMAND ); - SetText( iSeconds ); + SetText( (int)fSeconds ); } void MenuTimer::Start() diff --git a/stepmania/src/MenuTimer.h b/stepmania/src/MenuTimer.h index 8ecc602aaf..d83f9b6ce4 100644 --- a/stepmania/src/MenuTimer.h +++ b/stepmania/src/MenuTimer.h @@ -17,7 +17,7 @@ public: virtual void Update( float fDeltaTime ); - void SetSeconds( int iTimerSeconds ); + void SetSeconds( float fSeconds ); void Start(); // resume countdown from paused void Pause(); // don't count down void Stop(); // set to "00" and pause diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index de4f52f42d..ed3b1d8524 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -38,7 +38,7 @@ #define NUM_CHARS_TO_DRAW_BEHIND THEME->GetMetricI("ScreenNameEntry","NumCharsToDrawBehind") #define NUM_CHARS_TO_DRAW_TOTAL THEME->GetMetricI("ScreenNameEntry","NumCharsToDrawTotal") #define FAKE_BEATS_PER_SEC THEME->GetMetricF("ScreenNameEntry","FakeBeatsPerSec") -#define TIMER_SECONDS THEME->GetMetricI("ScreenNameEntry","TimerSeconds") +#define TIMER_SECONDS THEME->GetMetricF("ScreenNameEntry","TimerSeconds") #define MAX_RANKING_NAME_LENGTH THEME->GetMetricI(m_sName,"MaxRankingNameLength") #define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen") #define PLAYER_X( p, styleType ) THEME->GetMetricF(m_sName,ssprintf("PlayerP%d%sX",p+1,StyleTypeToString(styleType).c_str())) diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index e1f70941cc..ece2015613 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -11,7 +11,7 @@ #include "GameSoundManager.h" #include "AnnouncerManager.h" -#define TIMER_SECONDS THEME->GetMetricI(m_sName,"TimerSeconds") +#define TIMER_SECONDS THEME->GetMetricF(m_sName,"TimerSeconds") #define TIMER_STEALTH THEME->GetMetricB(m_sName,"TimerStealth") #define STYLE_ICON THEME->GetMetricB(m_sName,"StyleIcon") #define MEMORY_CARD_ICONS THEME->GetMetricB(m_sName,"MemoryCardIcons")