diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 05bd20caf4..a4cfd94924 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -350,7 +350,7 @@ static float ArrowGetPercentVisible( PlayerNumber pn, int iCol, float fYOffset, if( fAppearances[PlayerOptions::APPEARANCE_BLINK] > 0 ) { float f = sinf(RageTimer::GetTimeSinceStart()*10); - f = froundf( f, 0.3333f ); + f = Quantize( f, 0.3333f ); fVisibleAdjust += SCALE( f, 0, 1, -1, 0 ); } if( fAppearances[PlayerOptions::APPEARANCE_RANDOMVANISH] > 0) diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index b152f58bad..cb045e7885 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -112,7 +112,7 @@ public: float fPercentBetweenStrips = 1.0f/NUM_STRIPS; // round this so that the chamber overflows align if( NUM_CHAMBERS > 10 ) - fPercentBetweenStrips = froundf( fPercentBetweenStrips, fChamberWidthInPercent ); + fPercentBetweenStrips = Quantize( fPercentBetweenStrips, fChamberWidthInPercent ); float fPercentOffset = fmodf( GAMESTATE->m_fSongBeat/4+1000, fPercentBetweenStrips ); ASSERT( fPercentOffset >= 0 && fPercentOffset <= fPercentBetweenStrips ); diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index a5f74d8254..c976d80408 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -863,7 +863,7 @@ void NoteDataUtil::Wide( NoteData &inout, float fStartBeat, float fEndBeat ) inout.ConvertHoldNotesTo4s(); /* Start on an even beat. */ - fStartBeat = froundf( fStartBeat, 2 ); + fStartBeat = Quantize( fStartBeat, 2 ); const int first_row = BeatToNoteRow( fStartBeat ); const int last_row = min( BeatToNoteRow(fEndBeat), inout.GetLastRow() ); @@ -949,7 +949,7 @@ void NoteDataUtil::InsertIntelligentTaps( bool bRequireNoteAtEndOfWindow = true; /* Start on a multiple of fBeatInterval. */ - fStartBeat = froundf( fStartBeat, fWindowStrideBeats ); + fStartBeat = Quantize( fStartBeat, fWindowStrideBeats ); // Insert a beat in the middle of every fBeatInterval. const int first_row = BeatToNoteRow( fStartBeat ); @@ -1098,7 +1098,7 @@ void NoteDataUtil::Echo( NoteData &inout, float fStartBeat, float fEndBeat ) // add 8th note tap "echos" after all taps int iEchoTrack = -1; - fStartBeat = froundf( fStartBeat, 0.5 ); + fStartBeat = Quantize( fStartBeat, 0.5 ); const int first_row = BeatToNoteRow( fStartBeat ); const int last_row = min( BeatToNoteRow(fEndBeat), inout.GetLastRow() ); @@ -1304,8 +1304,8 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteTyp { int iOldIndex = i; float fOldBeat = NoteRowToBeat( iOldIndex ); - float fNewBeat1 = froundf( fOldBeat, fSnapInterval1 ); - float fNewBeat2 = froundf( fOldBeat, fSnapInterval2 ); + float fNewBeat1 = Quantize( fOldBeat, fSnapInterval1 ); + float fNewBeat2 = Quantize( fOldBeat, fSnapInterval2 ); bool bNewBeat1IsCloser = fabsf(fNewBeat1-fOldBeat) < fabsf(fNewBeat2-fOldBeat); float fNewBeat = bNewBeat1IsCloser ? fNewBeat1 : fNewBeat2; diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index f62466fbc5..68d2b101e2 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -369,7 +369,7 @@ void NoteDisplay::SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAni // one tick off in general const float fFraction = fNoteBeatFraction - 0.25f/fAnimationLengthInBeats; const float fInterval = 1.f / fAnimationLengthInBeats; - fPercentIntoAnimation += froundf(fFraction,fInterval); + fPercentIntoAnimation += Quantize(fFraction,fInterval); } // just in case somehow we're majorly negative with the subtraction diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 9cc20e618c..2a2304270f 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -447,7 +447,7 @@ void NoteField::DrawPrimitives() // Draw beat bars // { - float fStartDrawingMeasureBars = max( 0, froundf(fFirstBeatToDraw-0.25f,0.25f) ); + float fStartDrawingMeasureBars = max( 0, Quantize(fFirstBeatToDraw-0.25f,0.25f) ); for( float f=fStartDrawingMeasureBars; fm_fSongBeat ); // Round hold start and end to the nearest snap interval - fStartBeat = froundf( fStartBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); - fEndBeat = froundf( fEndBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); + fStartBeat = Quantize( fStartBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); + fEndBeat = Quantize( fEndBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); // create a new hold note HoldNote newHN( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) ); @@ -856,7 +856,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ GAMESTATE->m_fSongBeat += fBeatsToMove; GAMESTATE->m_fSongBeat = max( GAMESTATE->m_fSongBeat, 0 ); - GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); + GAMESTATE->m_fSongBeat = Quantize( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); m_soundChangeLine.Play(); } break; @@ -1207,7 +1207,7 @@ void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType t // Add a tap float fBeat = GAMESTATE->m_fSongBeat; - fBeat = froundf( fBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); + fBeat = Quantize( fBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); const int iRow = BeatToNoteRow( fBeat ); if( iRow < 0 ) @@ -1301,7 +1301,7 @@ void ScreenEdit::TransitionToEdit() m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0) ); /* Make sure we're snapped. */ - GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); + GAMESTATE->m_fSongBeat = Quantize( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); /* Playing and recording have lead-ins, which may start before beat 0; * make sure we don't stay there if we escaped out early. */