From 9a2566dacc2c030d06264a57e663e0ea3616e8af Mon Sep 17 00:00:00 2001 From: ansstuff Date: Sun, 20 Jan 2013 20:25:19 +0000 Subject: [PATCH] * Taseditor: no "Autopause at the end of the Movie" when Recording * Taseditor: fixed bug with adding new item to History Log --- src/drivers/win/taseditor/history.cpp | 16 ++++++++-------- src/drivers/win/taseditor/playback.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/drivers/win/taseditor/history.cpp b/src/drivers/win/taseditor/history.cpp index 2de0f4de..0af5d27f 100644 --- a/src/drivers/win/taseditor/history.cpp +++ b/src/drivers/win/taseditor/history.cpp @@ -436,24 +436,24 @@ void HISTORY::redo() // ---------------------------- void HISTORY::AddItemToHistory(SNAPSHOT &snap, int cur_branch) { + history_cursor_pos++; + history_total_items = history_cursor_pos + 1; // history uses conveyor of items (vector with fixed size) to aviod frequent reallocations caused by vector resizing, which would be awfully expensive with such large objects as SNAPSHOT and BOOKMARK if (history_total_items >= history_size) { - // reached the end of available history_size - move history_start_pos (thus deleting oldest snapshot) - history_cursor_pos = history_size-1; + // reached the end of available history_size + // move history_start_pos (thus deleting oldest snapshot) history_start_pos = (history_start_pos + 1) % history_size; - } else - { - // didn't reach the end of history yet - history_cursor_pos++; - history_total_items = history_cursor_pos+1; - UpdateHistoryList(); + // and restore history_cursor_pos and history_total_items + history_cursor_pos--; + history_total_items--; } // write data int real_pos = (history_start_pos + history_cursor_pos) % history_size; snapshots[real_pos] = snap; backup_bookmarks[real_pos].free(); backup_current_branch[real_pos] = cur_branch; + UpdateHistoryList(); RedrawHistoryList(); } void HISTORY::AddItemToHistory(SNAPSHOT &snap, int cur_branch, BOOKMARK &bookm) diff --git a/src/drivers/win/taseditor/playback.cpp b/src/drivers/win/taseditor/playback.cpp index 40436d1a..dc1cd826 100644 --- a/src/drivers/win/taseditor/playback.cpp +++ b/src/drivers/win/taseditor/playback.cpp @@ -177,7 +177,7 @@ void PLAYBACK::update() // pause when seeking hits pause_frame if (pause_frame && currFrameCounter + 1 >= pause_frame) SeekingStop(); - else if (currFrameCounter >= GetLostPosition() && currFrameCounter >= currMovieData.getNumRecords() - 1 && must_autopause_at_the_end && taseditor_config.autopause_at_finish) + else if (currFrameCounter >= GetLostPosition() && currFrameCounter >= currMovieData.getNumRecords() - 1 && must_autopause_at_the_end && taseditor_config.autopause_at_finish && !TaseditorIsRecording()) // pause at the end of the movie PauseEmulation();