Taseditor: probably figured good "lost_position" logic, finally

This commit is contained in:
ansstuff 2012-05-07 11:35:33 +00:00
parent af1fe3aeef
commit 54d119e002
1 changed files with 3 additions and 13 deletions

View File

@ -263,13 +263,7 @@ void PLAYBACK::UnpauseEmulation()
} }
void PLAYBACK::RestorePosition() void PLAYBACK::RestorePosition()
{ {
if (pause_frame) if (lost_position_frame && lost_position_frame > currFrameCounter + 1)
{
// continue seeking
if (taseditor_config.turbo_seek)
turbo = true;
UnpauseEmulation();
} else if (lost_position_frame && lost_position_frame > currFrameCounter + 1)
{ {
// start seeking from here to lost_position_frame // start seeking from here to lost_position_frame
pause_frame = lost_position_frame; pause_frame = lost_position_frame;
@ -277,9 +271,6 @@ void PLAYBACK::RestorePosition()
if (taseditor_config.turbo_seek) if (taseditor_config.turbo_seek)
turbo = true; turbo = true;
UnpauseEmulation(); UnpauseEmulation();
// delete lost_position_frame
piano_roll.RedrawRow(lost_position_frame - 1);
lost_position_frame = 0;
} }
} }
void PLAYBACK::MiddleButtonClick() void PLAYBACK::MiddleButtonClick()
@ -317,8 +308,7 @@ void PLAYBACK::MiddleButtonClick()
turbo = true; turbo = true;
} }
} }
UnpauseEmulation(); // in case RestorePosition doesn't unpause it UnpauseEmulation();
RestorePosition();
} }
} else } else
{ {
@ -497,13 +487,13 @@ void PLAYBACK::CancelSeeking()
{ {
if (pause_frame) if (pause_frame)
{ {
SeekingStop();
// also invalidate lost_position_frame if user cancelled seeking to it // also invalidate lost_position_frame if user cancelled seeking to it
if (lost_position_frame == pause_frame) if (lost_position_frame == pause_frame)
{ {
piano_roll.RedrawRow(lost_position_frame - 1); piano_roll.RedrawRow(lost_position_frame - 1);
lost_position_frame = 0; lost_position_frame = 0;
} }
SeekingStop();
} }
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------