[splittiming] Draw certain text based on switch.

Note: the diff for this hates the indentation.
This commit is contained in:
Jason Felds
2011-05-12 22:34:16 -04:00
parent 29e0bd3d2f
commit 3a348123ca
+75 -66
View File
@@ -833,25 +833,31 @@ void NoteField::DrawPrimitives()
} }
} }
// Tickcount text if( GAMESTATE->m_bIsEditorStepTiming )
FOREACH_CONST( TickcountSegment, timing.m_TickcountSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) // Tickcount text
FOREACH_CONST( TickcountSegment, timing.m_TickcountSegments, seg )
{ {
float fBeat = NoteRowToBeat(seg->m_iStartRow); if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
if( IS_ON_SCREEN(fBeat) ) {
DrawTickcountText( fBeat, seg->m_iTicks ); float fBeat = NoteRowToBeat(seg->m_iStartRow);
if( IS_ON_SCREEN(fBeat) )
DrawTickcountText( fBeat, seg->m_iTicks );
}
} }
} }
// Combo text if( GAMESTATE->m_bIsEditorStepTiming )
FOREACH_CONST( ComboSegment, timing.m_ComboSegments, seg )
{ {
if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw ) // Combo text
FOREACH_CONST( ComboSegment, timing.m_ComboSegments, seg )
{ {
float fBeat = NoteRowToBeat(seg->m_iStartRow); if( seg->m_iStartRow >= iFirstRowToDraw && seg->m_iStartRow <= iLastRowToDraw )
if( IS_ON_SCREEN(fBeat) ) {
DrawComboText( fBeat, seg->m_iCombo ); float fBeat = NoteRowToBeat(seg->m_iStartRow);
if( IS_ON_SCREEN(fBeat) )
DrawComboText( fBeat, seg->m_iCombo );
}
} }
} }
@@ -887,70 +893,73 @@ void NoteField::DrawPrimitives()
} }
} }
// BGChange text if( !GAMESTATE->m_bIsEditorStepTiming )
switch( GAMESTATE->m_EditMode )
{ {
case EditMode_Home: // BGChange text
case EditMode_CourseMods: switch( GAMESTATE->m_EditMode )
case EditMode_Practice: {
break; case EditMode_Home:
case EditMode_Full: case EditMode_CourseMods:
{ case EditMode_Practice:
vector<BackgroundChange>::iterator iter[NUM_BackgroundLayer]; break;
FOREACH_BackgroundLayer( i ) case EditMode_Full:
iter[i] = GAMESTATE->m_pCurSong->GetBackgroundChanges(i).begin();
while( 1 )
{ {
float fLowestBeat = FLT_MAX; vector<BackgroundChange>::iterator iter[NUM_BackgroundLayer];
vector<BackgroundLayer> viLowestIndex;
FOREACH_BackgroundLayer( i ) FOREACH_BackgroundLayer( i )
{ iter[i] = GAMESTATE->m_pCurSong->GetBackgroundChanges(i).begin();
if( iter[i] == GAMESTATE->m_pCurSong->GetBackgroundChanges(i).end() )
continue;
float fBeat = iter[i]->m_fStartBeat; while( 1 )
if( fBeat < fLowestBeat )
{
fLowestBeat = fBeat;
viLowestIndex.clear();
viLowestIndex.push_back( i );
}
else if( fBeat == fLowestBeat )
{
viLowestIndex.push_back( i );
}
}
if( viLowestIndex.empty() )
{ {
float fLowestBeat = FLT_MAX;
vector<BackgroundLayer> viLowestIndex;
FOREACH_BackgroundLayer( i ) FOREACH_BackgroundLayer( i )
ASSERT( iter[i] == GAMESTATE->m_pCurSong->GetBackgroundChanges(i).end() );
break;
}
if( IS_ON_SCREEN(fLowestBeat) )
{
vector<RString> vsBGChanges;
FOREACH_CONST( BackgroundLayer, viLowestIndex, i )
{ {
ASSERT( iter[*i] != GAMESTATE->m_pCurSong->GetBackgroundChanges(*i).end() ); if( iter[i] == GAMESTATE->m_pCurSong->GetBackgroundChanges(i).end() )
const BackgroundChange& change = *iter[*i]; continue;
RString s = change.GetTextDescription();
if( *i!=0 ) float fBeat = iter[i]->m_fStartBeat;
s = ssprintf("%d: ",*i) + s; if( fBeat < fLowestBeat )
vsBGChanges.push_back( s ); {
fLowestBeat = fBeat;
viLowestIndex.clear();
viLowestIndex.push_back( i );
}
else if( fBeat == fLowestBeat )
{
viLowestIndex.push_back( i );
}
} }
DrawBGChangeText( fLowestBeat, join("\n",vsBGChanges) );
if( viLowestIndex.empty() )
{
FOREACH_BackgroundLayer( i )
ASSERT( iter[i] == GAMESTATE->m_pCurSong->GetBackgroundChanges(i).end() );
break;
}
if( IS_ON_SCREEN(fLowestBeat) )
{
vector<RString> vsBGChanges;
FOREACH_CONST( BackgroundLayer, viLowestIndex, i )
{
ASSERT( iter[*i] != GAMESTATE->m_pCurSong->GetBackgroundChanges(*i).end() );
const BackgroundChange& change = *iter[*i];
RString s = change.GetTextDescription();
if( *i!=0 )
s = ssprintf("%d: ",*i) + s;
vsBGChanges.push_back( s );
}
DrawBGChangeText( fLowestBeat, join("\n",vsBGChanges) );
}
FOREACH_CONST( BackgroundLayer, viLowestIndex, i )
iter[*i]++;
} }
FOREACH_CONST( BackgroundLayer, viLowestIndex, i )
iter[*i]++;
} }
} break;
break; default:
default: ASSERT(0);
ASSERT(0); }
} }
// Draw marker bars // Draw marker bars