Fix the other mMod corner case.

This commit is contained in:
Jason Felds
2011-07-03 13:57:22 -04:00
parent 91e8758e54
commit b115a875de
3 changed files with 17 additions and 6 deletions
+8 -2
View File
@@ -454,13 +454,19 @@ void Player::Init(
FOREACH_CONST( TrailEntry, GAMESTATE->m_pCurTrail[pn]->m_vEntries, e )
{
float fMaxForEntry;
e->pSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxForEntry );
if (M_MOD_HIGH_CAP > 0)
e->pSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxForEntry, M_MOD_HIGH_CAP );
else
e->pSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxForEntry );
fMaxBPM = max( fMaxForEntry, fMaxBPM );
}
}
else
{
GAMESTATE->m_pCurSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxBPM );
if (M_MOD_HIGH_CAP > 0)
GAMESTATE->m_pCurSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxBPM, M_MOD_HIGH_CAP );
else
GAMESTATE->m_pCurSong->m_SongTiming.GetActualBPM( fThrowAway, fMaxBPM );
}
}
+2 -2
View File
@@ -20,14 +20,14 @@ TimingData::TimingData(float fOffset) :
{
}
void TimingData::GetActualBPM( float &fMinBPMOut, float &fMaxBPMOut ) const
void TimingData::GetActualBPM( float &fMinBPMOut, float &fMaxBPMOut, float highest ) const
{
fMinBPMOut = FLT_MAX;
fMaxBPMOut = 0;
FOREACH_CONST( BPMSegment, m_BPMSegments, seg )
{
const float fBPM = seg->GetBPM();
fMaxBPMOut = max( fBPM, fMaxBPMOut );
fMaxBPMOut = clamp(max( fBPM, fMaxBPMOut ), 0, highest);
fMinBPMOut = min( fBPM, fMinBPMOut );
}
}
+7 -2
View File
@@ -4,6 +4,7 @@
#include "NoteTypes.h"
#include "TimingSegments.h"
#include "PrefsManager.h"
#include <float.h> // max float
struct lua_State;
/** @brief Compare a TimingData segment's properties with one another. */
@@ -24,11 +25,15 @@ public:
* @param fOffset the offset from the 0th beat. */
TimingData(float fOffset);
/**
* @brief Gets the actual BPM of the song.
* @brief Gets the actual BPM of the song,
* while respecting a limit.
*
* The high limit is due to the implementation of mMods.
* @param fMinBPMOut the minimium specified BPM.
* @param fMaxBPMOut the maximum specified BPM.
* @param highest the highest allowed max BPM.
*/
void GetActualBPM( float &fMinBPMOut, float &fMaxBPMOut ) const;
void GetActualBPM( float &fMinBPMOut, float &fMaxBPMOut, float highest = FLT_MAX ) const;
/**
* @brief Retrieve the BPM at the given row.
* @param iNoteRow the row in question.