From 2ab5a4ddb8ff9c2739f7b9544a5f03cb2a5b2e03 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 12 Jun 2011 03:37:10 -0400 Subject: [PATCH] Mostly 64 - 32 float warning fixes. --- src/Actor.cpp | 6 +++--- src/AdjustSync.cpp | 2 +- src/ArrowEffects.cpp | 7 ++++++- src/BeginnerHelper.cpp | 4 ++-- src/LifeMeterBar.cpp | 2 +- src/RageSoundReader_Pan.cpp | 2 +- src/ScreenTestFonts.cpp | 2 +- src/ScreenTestSound.cpp | 4 ++-- src/ScreenUnlockStatus.cpp | 2 +- src/TimingData.cpp | 12 ++++++------ 10 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/Actor.cpp b/src/Actor.cpp index 3191d98d56..d7e8f3f4b2 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -105,9 +105,9 @@ void Actor::InitState() #endif m_fSecsIntoEffect = 0; m_fEffectDelta = 0; - m_fEffectRampUp = 0.5; + m_fEffectRampUp = 0.5f; m_fEffectHoldAtHalf = 0; - m_fEffectRampDown = 0.5; + m_fEffectRampDown = 0.5f; m_fEffectHoldAtZero = 0; m_fEffectOffset = 0; m_EffectClock = CLOCK_TIMER; @@ -118,7 +118,7 @@ void Actor::InitState() m_bVisible = true; m_fShadowLengthX = 0; m_fShadowLengthY = 0; - m_ShadowColor = RageColor(0,0,0,0.5); + m_ShadowColor = RageColor(0,0,0,0.5f); m_bIsAnimating = true; m_fHibernateSecondsLeft = 0; m_iDrawOrder = 0; diff --git a/src/AdjustSync.cpp b/src/AdjustSync.cpp index bee582b4bf..bc0425293d 100644 --- a/src/AdjustSync.cpp +++ b/src/AdjustSync.cpp @@ -256,7 +256,7 @@ void AdjustSync::AutosyncTempo() // keep only a fraction of the data, such as the 80% with the lowest // error. However, throwing away the ones with high error should // be enough in most cases. - float fFilteredError = 0.0; + float fFilteredError = 0; s_iStepsFiltered = s_vAutosyncTempoData.size(); FilterHighErrorPoints( s_vAutosyncTempoData, fSlope, fIntercept, ERROR_TOO_HIGH ); s_iStepsFiltered -= s_vAutosyncTempoData.size(); diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index fb8da38fb5..5b6dd64b08 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -60,6 +60,8 @@ static ThemeMetric MINI_PERCENT_BASE( "ArrowEffects", "MiniPercentBase" ) static ThemeMetric MINI_PERCENT_GATE( "ArrowEffects", "MiniPercentGate" ); static ThemeMetric DIZZY_HOLD_HEADS( "ArrowEffects", "DizzyHoldHeads" ); +float ArrowGetPercentVisible( const PlayerState* pPlayerState, float fYPosWithoutReverse ); + static float GetNoteFieldHeight( const PlayerState* pPlayerState ) { return SCREEN_HEIGHT + fabsf(pPlayerState->m_PlayerOptions.GetCurrent().m_fPerspectiveTilt)*200; @@ -236,7 +238,10 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float if( bShowEffects ) fBeatsUntilStep = pCurSteps->m_Timing.GetDisplayedBeat(fNoteBeat) - pCurSteps->m_Timing.GetDisplayedBeat(fSongBeat); float fYOffsetBeatSpacing = fBeatsUntilStep; - float fSpeedMultiplier = bShowEffects ? pCurSteps->m_Timing.GetDisplayedSpeedPercent( position.m_fSongBeatVisible, position.m_fMusicSecondsVisible ) : 1.0; + float fSpeedMultiplier = bShowEffects ? + pCurSteps->m_Timing.GetDisplayedSpeedPercent( + position.m_fSongBeatVisible, + position.m_fMusicSecondsVisible ) : 1.0f; fYOffset += fSpeedMultiplier * fYOffsetBeatSpacing * (1-pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing); } diff --git a/src/BeginnerHelper.cpp b/src/BeginnerHelper.cpp index 9bc73247ba..e6361729cf 100644 --- a/src/BeginnerHelper.cpp +++ b/src/BeginnerHelper.cpp @@ -242,7 +242,7 @@ void BeginnerHelper::DrawPrimitives() DISPLAY->SetLighting( true ); DISPLAY->SetLightDirectional( 0, - RageColor(0.5,0.5,0.5,1), + RageColor(0.5f,0.5f,0.5f,1), RageColor(1,1,1,1), RageColor(0,0,0,1), RageVector3(0, 0, 1) ); @@ -271,7 +271,7 @@ void BeginnerHelper::DrawPrimitives() DISPLAY->SetLighting( true ); DISPLAY->SetLightDirectional( 0, - RageColor(0.5,0.5,0.5,1), + RageColor(0.5f,0.5f,0.5f,1), RageColor(1,1,1,1), RageColor(0,0,0,1), RageVector3(0, 0, 1) ); diff --git a/src/LifeMeterBar.cpp b/src/LifeMeterBar.cpp index 8256732b89..bbc101058a 100644 --- a/src/LifeMeterBar.cpp +++ b/src/LifeMeterBar.cpp @@ -172,7 +172,7 @@ void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) switch( score ) { case HNS_Held: fDeltaLife = +0; break; - case HNS_LetGo: fDeltaLife = -1.0; break; + case HNS_LetGo: fDeltaLife = -1.0f; break; default: ASSERT(0); } diff --git a/src/RageSoundReader_Pan.cpp b/src/RageSoundReader_Pan.cpp index ee592c2fff..3b8d505154 100644 --- a/src/RageSoundReader_Pan.cpp +++ b/src/RageSoundReader_Pan.cpp @@ -5,7 +5,7 @@ RageSoundReader_Pan::RageSoundReader_Pan( RageSoundReader *pSource ): RageSoundReader_Filter( pSource ) { - m_fPan = 0.0; + m_fPan = 0; } diff --git a/src/ScreenTestFonts.cpp b/src/ScreenTestFonts.cpp index 8d163e22ec..708a2d711a 100644 --- a/src/ScreenTestFonts.cpp +++ b/src/ScreenTestFonts.cpp @@ -49,7 +49,7 @@ void ScreenTestFonts::Init() font.SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y+100 ); font.LoadFromFont( THEME->GetPathF("Common", "normal") ); - font.SetZoom(.5); + font.SetZoom(.5f); this->AddChild(&font); txt.SetName( "Text" ); diff --git a/src/ScreenTestSound.cpp b/src/ScreenTestSound.cpp index b27f93a87f..813f5cf6fa 100644 --- a/src/ScreenTestSound.cpp +++ b/src/ScreenTestSound.cpp @@ -17,7 +17,7 @@ void ScreenTestSound::Init() HEEEEEEEEELP.SetXY(450, 400); HEEEEEEEEELP.LoadFromFont( THEME->GetPathF("Common","normal") ); - HEEEEEEEEELP.SetZoom(.5); + HEEEEEEEEELP.SetZoom(.5f); HEEEEEEEEELP.SetText( "p Play\n" "s Stop\n" @@ -29,7 +29,7 @@ void ScreenTestSound::Init() { this->AddChild(&s[i].txt); s[i].txt.LoadFromFont( THEME->GetPathF("Common","normal") ); - s[i].txt.SetZoom(.5); + s[i].txt.SetZoom(.5f); } s[0].txt.SetXY(150, 100); diff --git a/src/ScreenUnlockStatus.cpp b/src/ScreenUnlockStatus.cpp index e06c7dfa95..502e5d76bf 100644 --- a/src/ScreenUnlockStatus.cpp +++ b/src/ScreenUnlockStatus.cpp @@ -127,7 +127,7 @@ void ScreenUnlockStatus::Init() break; default: text->SetText( "" ); - text->SetDiffuse( RageColor(0.5,0,0,1) ); + text->SetDiffuse( RageColor(0.5f,0,0,1) ); break; } diff --git a/src/TimingData.cpp b/src/TimingData.cpp index f65c00122e..660b5e50c0 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -821,10 +821,10 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float int iLastRow = 0; float fLastTime = -m_fBeat0OffsetInSeconds; - float fBPS = GetBPMAtRow(0) / 60.0; + float fBPS = GetBPMAtRow(0) / 60.0f; float bIsWarping = false; - float fWarpDestination = 0.0; + float fWarpDestination = 0; for( ;; ) { @@ -923,10 +923,10 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const int iLastRow = 0; float fLastTime = -m_fBeat0OffsetInSeconds; - float fBPS = GetBPMAtRow(0) / 60.0; + float fBPS = GetBPMAtRow(0) / 60.0f; float bIsWarping = false; - float fWarpDestination = 0.0; + float fWarpDestination = 0; for( ;; ) { @@ -1004,7 +1004,7 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const float TimingData::GetDisplayedBeat( float fBeat ) const { vector::const_iterator it = m_ScrollSegments.begin(), end = m_ScrollSegments.end(); - float fOutBeat = 0.0; + float fOutBeat = 0; for( ; it != end; it++ ) { if( it+1 == end || fBeat <= (it+1)->GetBeat() ) @@ -1508,7 +1508,7 @@ float TimingData::GetDisplayedSpeedPercent( float fSongBeat, float fMusicSeconds if( ( index == 0 && m_SpeedSegments[0].GetLength() > 0.0 ) && fCurTime < fStartTime ) { - return 1.0; + return 1.0f; } else if( fEndTime >= fCurTime && ( index > 0 || m_SpeedSegments[0].GetLength() > 0.0 ) ) {