simplify, fix ReCalculateRadarValuesAndLastBeat not updating on future
calls because m_fFirstBeat/LastBeat aren't reset to -1
This commit is contained in:
+10
-14
@@ -770,6 +770,9 @@ void Song::TranslateTitles()
|
|||||||
|
|
||||||
void Song::ReCalculateRadarValuesAndLastBeat()
|
void Song::ReCalculateRadarValuesAndLastBeat()
|
||||||
{
|
{
|
||||||
|
float fFirstBeat = 999999; /* inf */
|
||||||
|
float fLastBeat = 0;
|
||||||
|
|
||||||
for( unsigned i=0; i<m_vpSteps.size(); i++ )
|
for( unsigned i=0; i<m_vpSteps.size(); i++ )
|
||||||
{
|
{
|
||||||
Steps* pSteps = m_vpSteps[i];
|
Steps* pSteps = m_vpSteps[i];
|
||||||
@@ -790,11 +793,9 @@ void Song::ReCalculateRadarValuesAndLastBeat()
|
|||||||
pSteps->SetRadarValues( v );
|
pSteps->SetRadarValues( v );
|
||||||
|
|
||||||
|
|
||||||
/* Calculate first/last beat.
|
/* Many songs have stray, empty song patterns. Ignore them, so
|
||||||
*
|
|
||||||
* Many songs have stray, empty song patterns. Ignore them, so
|
|
||||||
* they don't force the first beat of the whole song to 0. */
|
* they don't force the first beat of the whole song to 0. */
|
||||||
if(tempNoteData.GetLastRow() == 0)
|
if( tempNoteData.GetLastRow() == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Don't set first/last beat based on lights. They often start very
|
// Don't set first/last beat based on lights. They often start very
|
||||||
@@ -802,17 +803,12 @@ void Song::ReCalculateRadarValuesAndLastBeat()
|
|||||||
if( pSteps->m_StepsType == STEPS_TYPE_LIGHTS_CABINET )
|
if( pSteps->m_StepsType == STEPS_TYPE_LIGHTS_CABINET )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float fFirstBeat = tempNoteData.GetFirstBeat();
|
fFirstBeat = min( fFirstBeat, tempNoteData.GetFirstBeat() );
|
||||||
float fLastBeat = tempNoteData.GetLastBeat();
|
fLastBeat = max( fLastBeat, tempNoteData.GetLastBeat() );
|
||||||
if( m_fFirstBeat == -1 )
|
|
||||||
m_fFirstBeat = fFirstBeat;
|
|
||||||
else
|
|
||||||
m_fFirstBeat = min( m_fFirstBeat, fFirstBeat );
|
|
||||||
if( m_fLastBeat == -1 )
|
|
||||||
m_fLastBeat = fLastBeat;
|
|
||||||
else
|
|
||||||
m_fLastBeat = max( m_fLastBeat, fLastBeat );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_fFirstBeat = fFirstBeat;
|
||||||
|
m_fLastBeat = fLastBeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Song::GetSteps(
|
void Song::GetSteps(
|
||||||
|
|||||||
Reference in New Issue
Block a user