Skip to content

Commit

Permalink
[#59] TrackEditor: Improvements and bugfixes (Part 84.1: Fixed)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-nestorovic committed Jun 3, 2024
1 parent cb3bcbe commit 56640ce
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Main/src/Image_TrackRW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,9 +977,11 @@
void CImage::CTrackReader::CParseEventList::RemoveConsecutiveBeforeEnd(TLogTime tEndMax){
// removes all ParseEvents that touch or overlap just before the End time
auto it=FindByEnd(tEndMax);
if (it && it->second->tEnd>tEndMax)
while (it && it->second->tEnd>tEndMax) // 'while' for Event having the same EndTime
it--;
TLogTime tStart=tEndMax;
if (!it)
return;
TLogTime tStart = tEndMax = it->second->tEnd;
while (it){
const auto &pe=*(it--)->second;
if (tStart<=pe.tEnd){ // touching or overlapping?
Expand Down Expand Up @@ -1209,9 +1211,11 @@
p->value=MFM::DecodeByte(w);
crc=CFloppyImage::GetCrc16Ccitt( crc, &p++->value, 1 );
}
peData.Finalize( currentTime, p-peData.byteInfos );
const auto nDataBytes=p-peData.byteInfos;
peData.Finalize( currentTime, nDataBytes );
if (!*this){
pOutParseEvents->Add( peData );
if (pOutParseEvents && nDataBytes)
pOutParseEvents->Add( peData );
return result;
}
// - comparing Data Field's CRC
Expand Down

0 comments on commit 56640ce

Please sign in to comment.