This commit is contained in:
Alberto Ramos
2011-07-19 23:42:32 -06:00
parent 796b81890b
commit 3b475db699
+8 -1
View File
@@ -237,15 +237,19 @@ void TimingData::SetTickcountAtRow( int iRow, int iTicks )
{
LOG->Trace( "TimingData::SetTickcountAtRow( '%i' , '%i' )", iRow, iTicks );
unsigned i;
unsigned i = 0;
vector<TimingSegment *> &ticks = this->allTimingSegments[SEGMENT_TICKCOUNT];
for( i=0; i<ticks.size(); i++ )
if( ticks[i]->GetRow() >= iRow )
break;
// this thing causes an invalid parameter crash
TickcountSegment *ts = static_cast<TickcountSegment *>(ticks[i]);
LOG->Trace( "Done with that thing again" );
if( i == ticks.size() || ts->GetRow() != iRow )
{
LOG->Trace( "New TickSegment" );
// No TickcountSegment here. Make a new segment if required.
if (i == 0 ||
static_cast<TickcountSegment *>(ticks[i-1])->GetTicks() != iTicks )
@@ -253,12 +257,15 @@ void TimingData::SetTickcountAtRow( int iRow, int iTicks )
}
else // TickcountSegment being modified is m_TickcountSegments[i]
{
LOG->Trace( "Editing TickSegment" );
if (i > 0 &&
static_cast<TickcountSegment *>(ticks[i-1])->GetTicks() == iTicks )
ticks.erase( ticks.begin()+i, ticks.begin()+i+1 );
else
ts->SetTicks(iTicks);
}
LOG->Trace( "DONE" );
}
void TimingData::SetComboAtRow( int iRow, int iCombo, int iMiss )