From 82999aa2a95f2e96cb090a9628ccfd28b27d5633 Mon Sep 17 00:00:00 2001 From: ansstuff Date: Mon, 23 Apr 2012 15:07:27 +0000 Subject: [PATCH] * Taseditor: removed "View->Show Lag Frames", "View->Highlight Markers", "Config->Superimpose affects copy/paste", "Config->Deselect on doubleclick", "Config->Mute Turbo" options * Taseditor: "Config->Branches restore entire Movie" now works differently * Taseditor: History always restores Markers * Mute Turbo is on by default --- src/drivers/win/config.cpp | 4 - src/drivers/win/res.rc | 37 +++--- src/drivers/win/resource.h | 7 -- src/drivers/win/sound.cpp | 2 +- src/drivers/win/taseditor/bookmarks.cpp | 114 +++++++----------- src/drivers/win/taseditor/branches.cpp | 4 + src/drivers/win/taseditor/history.cpp | 68 ++++++----- src/drivers/win/taseditor/history.h | 2 +- src/drivers/win/taseditor/piano_roll.cpp | 21 ++-- src/drivers/win/taseditor/snapshot.cpp | 9 +- src/drivers/win/taseditor/splicer.cpp | 6 +- .../win/taseditor/taseditor_config.cpp | 4 - src/drivers/win/taseditor/taseditor_config.h | 4 - .../win/taseditor/taseditor_window.cpp | 29 ----- 14 files changed, 117 insertions(+), 194 deletions(-) diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index eeee4611..5d9015dd 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -312,8 +312,6 @@ static CFGSTRUCT fceuconfig[] = { AC(taseditor_config.findnote_wndy), AC(taseditor_config.follow_playback), AC(taseditor_config.turbo_seek), - AC(taseditor_config.show_lag_frames), - AC(taseditor_config.show_markers), AC(taseditor_config.show_branch_screenshots), AC(taseditor_config.show_branch_descr), AC(taseditor_config.bind_markers), @@ -321,7 +319,6 @@ static CFGSTRUCT fceuconfig[] = { AC(taseditor_config.combine_consecutive), AC(taseditor_config.use_1p_rec), AC(taseditor_config.columnset_by_keys), - AC(taseditor_config.superimpose_affects_paste), AC(taseditor_config.branch_full_movie), AC(taseditor_config.branch_only_when_rec), AC(taseditor_config.view_branches_tree), @@ -346,7 +343,6 @@ static CFGSTRUCT fceuconfig[] = { AC(taseditor_config.savecompact_selection), AC(taseditor_config.findnote_matchcase), AC(taseditor_config.findnote_search_up), - AC(taseditor_config.deselect_on_doubleclick), AC(taseditor_config.draw_input), AC(taseditor_config.silent_autosave), AC(taseditor_config.autopause_at_finish), diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index cfab308a..70383648 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -228,7 +228,7 @@ BEGIN MENUITEM "Save Compact", ID_FILE_SAVECOMPACT,MFT_STRING,MFS_ENABLED MENUITEM "Recent", ID_FILE_RECENT,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR - MENUITEM "Import", ID_FILE_IMPORT,MFT_STRING,MFS_ENABLED + MENUITEM "Import input", ID_FILE_IMPORT,MFT_STRING,MFS_ENABLED MENUITEM "Export to FM2", ID_FILE_EXPORTFM2,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR MENUITEM "Close\tAlt+F4", ID_FILE_CLOSE,MFT_STRING,MFS_ENABLED @@ -262,8 +262,6 @@ BEGIN BEGIN MENUITEM "Find Note window\tCtrl+F", ID_VIEW_FINDNOTE,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR - MENUITEM "Show Lag Frames", ID_VIEW_SHOW_LAG_FRAMES,MFT_STRING,MFS_ENABLED - MENUITEM "Highlight Markers", ID_VIEW_SHOW_MARKERS,MFT_STRING,MFS_ENABLED MENUITEM "Display Branch Screenshots", ID_VIEW_SHOWBRANCHSCREENSHOTS,MFT_STRING,MFS_ENABLED MENUITEM "Display Branch Descriptions", ID_VIEW_SHOWBRANCHTOOLTIPS,MFT_STRING,MFS_ENABLED MENUITEM "Enable Hot Changes", ID_VIEW_ENABLEHOTCHANGES,MFT_STRING,MFS_ENABLED @@ -277,24 +275,21 @@ BEGIN MENUITEM "Set max Undo levels", ID_CONFIG_SETMAXUNDOLEVELS,MFT_STRING,MFS_ENABLED MENUITEM "Set Autosave period", ID_CONFIG_SETAUTOSAVEPERIOD,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR - MENUITEM "Branches work only when Recording", ID_CONFIG_BRANCHESWORKONLYWHENRECORDING,MFT_STRING,MFS_ENABLED - MENUITEM "Branches restore entire Movie", ID_CONFIG_BRANCHESRESTOREFULLMOVIE,MFT_STRING,MFS_ENABLED - MENUITEM "HUD in Branch screenshots", ID_CONFIG_HUDINBRANCHSCREENSHOTS,MFT_STRING,MFS_ENABLED - MENUITEM MFT_SEPARATOR - MENUITEM "Bind Markers to Input", ID_CONFIG_BINDMARKERSTOINPUT,MFT_STRING,MFS_ENABLED - MENUITEM "Empty new Marker Notes", ID_CONFIG_EMPTYNEWMARKERNOTES,MFT_STRING,MFS_ENABLED + MENUITEM "Silent Autosave", ID_CONFIG_SILENTAUTOSAVE,MFT_STRING,MFS_ENABLED + MENUITEM "Autofire Pattern skips Lag", ID_CONFIG_COLUMNSETPATTERNSKIPSLAG,MFT_STRING,MFS_ENABLED + MENUITEM "Draw Input by dragging", ID_CONFIG_DRAWINPUTBYDRAGGING,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR MENUITEM "Combine consecutive Recordings/Draws", ID_CONFIG_COMBINECONSECUTIVERECORDINGS,MFT_STRING,MFS_ENABLED MENUITEM "Use 1P keys for all single Recordings", ID_CONFIG_USE1PFORRECORDING,MFT_STRING,MFS_ENABLED MENUITEM "Use Input keys for Column Set", ID_CONFIG_USEINPUTKEYSFORCOLUMNSET,MFT_STRING,MFS_ENABLED - MENUITEM "Superimpose affects copy/paste", ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR - MENUITEM "Autofire Pattern skips Lag", ID_CONFIG_COLUMNSETPATTERNSKIPSLAG,MFT_STRING,MFS_ENABLED - MENUITEM "Deselect on doubleclick", ID_CONFIG_DESELECTONDOUBLECLICK,MFT_STRING,MFS_ENABLED - MENUITEM "Draw Input by dragging", ID_CONFIG_DRAWINPUTBYDRAGGING,MFT_STRING,MFS_ENABLED + MENUITEM "Bind Markers to Input", ID_CONFIG_BINDMARKERSTOINPUT,MFT_STRING,MFS_ENABLED + MENUITEM "Empty new Marker Notes", ID_CONFIG_EMPTYNEWMARKERNOTES,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "Branches work only when Recording", ID_CONFIG_BRANCHESWORKONLYWHENRECORDING,MFT_STRING,MFS_ENABLED + MENUITEM "Branches restore entire Movie", ID_CONFIG_BRANCHESRESTOREFULLMOVIE,MFT_STRING,MFS_ENABLED + MENUITEM "HUD in Branch screenshots", ID_CONFIG_HUDINBRANCHSCREENSHOTS,MFT_STRING,MFS_ENABLED MENUITEM MFT_SEPARATOR - MENUITEM "Silent Autosave", ID_CONFIG_SILENTAUTOSAVE,MFT_STRING,MFS_ENABLED - MENUITEM "Mute Turbo", ID_CONFIG_MUTETURBO,MFT_STRING,MFS_ENABLED MENUITEM "Autopause at the end of Movie", ID_CONFIG_AUTOPAUSEATTHEENDOFMOVIE,MFT_STRING,MFS_ENABLED END POPUP "Help", 65535,MFT_STRING,MFS_ENABLED @@ -388,13 +383,13 @@ BEGIN MENUITEM "Remove Markers", ID_SELECTED_REMOVEMARKERS MENUITEM SEPARATOR MENUITEM "Deselect", ID_SELECTED_DESELECT - MENUITEM "Select between Markers", ID_SELECTED_SELECTMIDMARKERS + MENUITEM "Select between Markers\tCtrl+A", ID_SELECTED_SELECTMIDMARKERS MENUITEM SEPARATOR - MENUITEM "Clear", ID_CONTEXT_SELECTED_CLEARFRAMES - MENUITEM "Delete", ID_CONTEXT_SELECTED_DELETEFRAMES - MENUITEM "Insert", ID_CONTEXT_SELECTED_INSERTFRAMES - MENUITEM "Insert # of Frames", ID_CONTEXT_SELECTED_INSERTFRAMES2 - MENUITEM "Clone", ID_SELECTED_CLONE + MENUITEM "Clear\tDel", ID_CONTEXT_SELECTED_CLEARFRAMES + MENUITEM "Delete\tCtrl+Del", ID_CONTEXT_SELECTED_DELETEFRAMES + MENUITEM "Clone\tCtrl+Ins", ID_SELECTED_CLONE + MENUITEM "Insert\tCtrl+Shift+Ins", ID_CONTEXT_SELECTED_INSERTFRAMES + MENUITEM "Insert # of Frames\tIns", ID_CONTEXT_SELECTED_INSERTFRAMES2 MENUITEM SEPARATOR MENUITEM "Truncate movie", ID_CONTEXT_SELECTED_TRUNCATE END diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index acf6d381..43289e21 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -896,8 +896,6 @@ #define IDC_C_WATCH_Separa 40416 #define ID_GAME_USECONFIG 40417 #define FCEUX_CONTEXT_GUICONFIG 40418 -#define ID_VIEW_SHOW_LAG_FRAMES 40420 -#define ID_VIEW_SHOW_TWEAK_COUNT 40421 #define ID_SELECTED_INSERTFRAMES 40422 #define ID_CONTEXT_SELECTED_INSERTFRAME 40423 #define ID_SELECTED_INSERTFRAMES40424 40424 @@ -906,7 +904,6 @@ #define ACCEL_CTRL_P 40430 #define ID_CONFIG_SETGREENZONECAPACITY 40432 #define ACCEL_CTRL_INSERT 40433 -#define ID_CONFIG_MUTETURBO 40435 #define ID_DISPLAY_RERECORDCOUNTER 40436 #define ID_DISPLAY_MOVIESTATUSICON 40437 #define ID_AVI_DISPLAYHUD 40438 @@ -919,7 +916,6 @@ #define ID_CONTEXT_SELECTED_CLEARSELECTION 40446 #define ID_CONTEXT_SELECTED_CLEARFRAMES 40447 #define ID_VIEW_SHOW 40448 -#define ID_VIEW_SHOW_MARKERS 40449 #define ID_EDIT_CLEAR 40450 #define ID_EDIT_INSERTFRAMES 40451 #define ID_EDIT_INSERT 40452 @@ -958,8 +954,6 @@ #define ID_CONFIG_COMBINECONSECUTIVERECORDINGS 40492 #define ACCEL_SHIFT_V 40493 #define ID_EDIT_PASTEINSERT 40495 -#define ID_CONFIG_SUPERIMPOSEAFFECTSCOPY 40496 -#define ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE 40497 #define ID_SELECTED_SETMARKER 40498 #define ID_SELECTED_CLEARMARKER 40499 #define ID_SELECTED_REMOVEMARKER40500 40500 @@ -996,7 +990,6 @@ #define ID_CONFIG_COLUMNSETPATTERNSKIPSLAG 40535 #define ID_EDIT_DESELECT 40536 #define ID_SELECTED_DESELECT 40537 -#define ID_CONFIG_DESELECTONDOUBLECLICK 40538 #define ID_CONFIG_DRAWINPUTBYDRAGGING 40539 #define ID_CONFIG_DOUBLECLICKONFRAME 40540 #define ACCEL_CTRL_UP 40541 diff --git a/src/drivers/win/sound.cpp b/src/drivers/win/sound.cpp index 61e115c8..7e72fda4 100644 --- a/src/drivers/win/sound.cpp +++ b/src/drivers/win/sound.cpp @@ -38,7 +38,7 @@ static int bits; #include "oakra.h" OAKRA_Module_OutputDS *dsout; -bool muteTurbo=false; +bool muteTurbo = true; //prototypes void UpdateSoundChannelQualityMode(HWND hwndDlg); //Updates the sound channel volume sliders, disables and renames them for low quality diff --git a/src/drivers/win/taseditor/bookmarks.cpp b/src/drivers/win/taseditor/bookmarks.cpp index 13a61d3d..f19a48b1 100644 --- a/src/drivers/win/taseditor/bookmarks.cpp +++ b/src/drivers/win/taseditor/bookmarks.cpp @@ -259,7 +259,6 @@ void BOOKMARKS::set(int slot) popup_display.screenshot_currently_shown = ITEM_UNDER_MOUSE_NONE; history.RegisterBookmarkSet(slot, backup_copy, old_current_branch); - project.SetProjectChanged(); must_check_item_under_mouse = true; FCEU_DispMessage("Branch %d saved.", 0, slot); } @@ -289,78 +288,46 @@ void BOOKMARKS::deploy(int slot) if (!bookmarks_array[slot].not_empty) return; int jump_frame = bookmarks_array[slot].snapshot.jump_frame; - int old_current_branch = branches.GetCurrentBranch(); bool markers_changed = false; - // revert current movie to the snapshot state + // update Markers + if (taseditor_config.bind_markers) + { + if (bookmarks_array[slot].snapshot.MarkersDifferFromCurrent()) + { + bookmarks_array[slot].snapshot.copyToMarkers(); + markers_changed = true; + } + } + // revert current movie data to the Bookmarked state if (taseditor_config.branch_full_movie) { - // update Markers - if (taseditor_config.bind_markers) - { - if (bookmarks_array[slot].snapshot.MarkersDifferFromCurrent()) - { - bookmarks_array[slot].snapshot.copyToMarkers(); - project.SetProjectChanged(); - markers_changed = true; - } - } - // update current movie - int first_change = bookmarks_array[slot].snapshot.findFirstChange(currMovieData); - if (first_change >= 0) - { - // restore entire movie - bookmarks_array[slot].snapshot.toMovie(currMovieData, first_change); - piano_roll.UpdateItemCount(); - selection.must_find_current_marker = playback.must_find_current_marker = true; - history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot, old_current_branch); - greenzone.Invalidate(first_change); - bookmarks_array[slot].deployed(); - } else if (markers_changed) - { - selection.must_find_current_marker = playback.must_find_current_marker = true; - history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot, old_current_branch); - piano_roll.RedrawList(); - bookmarks_array[slot].deployed(); - } else - { - // didn't restore anything - bookmarks_array[slot].jumped(); - } - } else if (jump_frame > 0) + bookmarks_array[slot].snapshot.toMovie(currMovieData); + } else { - // update Markers - if (taseditor_config.bind_markers) - { - if (bookmarks_array[slot].snapshot.MarkersDifferFromCurrent(jump_frame)) - { - bookmarks_array[slot].snapshot.copyToMarkers(jump_frame); - project.SetProjectChanged(); - markers_changed = true; - } - } - // update current movie - int first_change = bookmarks_array[slot].snapshot.findFirstChange(currMovieData, 0, jump_frame); - if (first_change >= 0 && first_change < jump_frame) - { - // restore movie up to and not including bookmarked frame (imitating old TASing method) - if (currMovieData.getNumRecords() <= jump_frame) currMovieData.records.resize(jump_frame+1); // but if old movie is shorter, include last frame as blank frame - bookmarks_array[slot].snapshot.toMovie(currMovieData, first_change, jump_frame-1); - piano_roll.UpdateItemCount(); - selection.must_find_current_marker = playback.must_find_current_marker = true; - history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot, old_current_branch); - greenzone.Invalidate(first_change); - bookmarks_array[slot].deployed(); - } else if (markers_changed) - { - selection.must_find_current_marker = playback.must_find_current_marker = true; - history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot, old_current_branch); - piano_roll.RedrawList(); - bookmarks_array[slot].deployed(); - } else - { - // didn't restore anything - bookmarks_array[slot].jumped(); - } + // restore movie up to and not including bookmarked frame (simulating old TASing method) + if (jump_frame) + bookmarks_array[slot].snapshot.toMovie(currMovieData, 0, jump_frame - 1); + else + currMovieData.truncateAt(0); + // add empty frame at the end (at jump_frame) + currMovieData.insertEmpty(-1, 1); + } + int first_change = history.RegisterBranching(slot, markers_changed); + if (first_change >= 0) + { + selection.must_find_current_marker = playback.must_find_current_marker = true; + piano_roll.UpdateItemCount(); + greenzone.Invalidate(first_change); + bookmarks_array[slot].deployed(); + } else if (markers_changed) + { + selection.must_find_current_marker = playback.must_find_current_marker = true; + piano_roll.RedrawList(); + bookmarks_array[slot].deployed(); + } else + { + // didn't restore anything + bookmarks_array[slot].jumped(); } // if greenzone reduced so much that we can't jump immediately - substitute target frame greenzone with our savestate @@ -378,6 +345,7 @@ void BOOKMARKS::deploy(int slot) greenzone.savestates[jump_frame] = bookmarks_array[slot].savestate; // switch current branch to this branch + int old_current_branch = branches.GetCurrentBranch(); branches.HandleBookmarkDeploy(slot); if (slot != old_current_branch && old_current_branch != ITEM_UNDER_MOUSE_CLOUD) { @@ -584,7 +552,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg) { if (!greenzone.savestates[frame].empty()) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(frame)) + if (greenzone.GetLagHistoryAtFrame(frame)) msg->clrTextBk = LAG_FRAMENUM_COLOR; else msg->clrTextBk = GREENZONE_FRAMENUM_COLOR; @@ -593,7 +561,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg) || (!greenzone.savestates[frame & EVERY4TH].empty() && (int)greenzone.savestates.size() > (frame | 0x3) + 1 && !greenzone.savestates[(frame | 0x3) + 1].empty()) || (!greenzone.savestates[frame & EVERY2ND].empty() && !greenzone.savestates[(frame | 0x1) + 1].empty())) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(frame)) + if (greenzone.GetLagHistoryAtFrame(frame)) msg->clrTextBk = PALE_LAG_FRAMENUM_COLOR; else msg->clrTextBk = PALE_GREENZONE_FRAMENUM_COLOR; @@ -615,7 +583,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg) { if (!greenzone.savestates[frame].empty()) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(frame)) + if (greenzone.GetLagHistoryAtFrame(frame)) msg->clrTextBk = LAG_INPUT_COLOR1; else msg->clrTextBk = GREENZONE_INPUT_COLOR1; @@ -624,7 +592,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg) || (!greenzone.savestates[frame & EVERY4TH].empty() && (int)greenzone.savestates.size() > (frame | 0x3) + 1 && !greenzone.savestates[(frame | 0x3) + 1].empty()) || (!greenzone.savestates[frame & EVERY2ND].empty() && !greenzone.savestates[(frame | 0x1) + 1].empty())) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(frame)) + if (greenzone.GetLagHistoryAtFrame(frame)) msg->clrTextBk = PALE_LAG_INPUT_COLOR1; else msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR1; diff --git a/src/drivers/win/taseditor/branches.cpp b/src/drivers/win/taseditor/branches.cpp index c1924d7e..096250a7 100644 --- a/src/drivers/win/taseditor/branches.cpp +++ b/src/drivers/win/taseditor/branches.cpp @@ -1056,6 +1056,8 @@ void BRANCHES::RecalculateBranchesTree() for (int i = 0; i < (int)Children[parent+1].size(); ++i) { GridY[Children[parent+1][i]] = pos; + if (Children[parent+1][i] == current_branch) + GridY[TOTAL_BOOKMARKS] = pos; pos -= 2; } } else if (GridY[t] < -MAX_GRID_Y_POS) @@ -1068,6 +1070,8 @@ void BRANCHES::RecalculateBranchesTree() for (int i = Children[parent+1].size()-1; i >= 0; i--) { GridY[Children[parent+1][i]] = pos; + if (Children[parent+1][i] == current_branch) + GridY[TOTAL_BOOKMARKS] = pos; pos += 2; } } diff --git a/src/drivers/win/taseditor/history.cpp b/src/drivers/win/taseditor/history.cpp index ebb68a52..2760dd9f 100644 --- a/src/drivers/win/taseditor/history.cpp +++ b/src/drivers/win/taseditor/history.cpp @@ -364,14 +364,11 @@ int HISTORY::jump(int new_pos) real_pos = (history_start_pos + history_cursor_pos) % history_size; // update Markers bool markers_changed = false; - if (taseditor_config.bind_markers) + if (snapshots[real_pos].MarkersDifferFromCurrent()) { - if (snapshots[real_pos].MarkersDifferFromCurrent()) - { - snapshots[real_pos].copyToMarkers(); - project.SetProjectChanged(); - markers_changed = true; - } + snapshots[real_pos].copyToMarkers(); + project.SetProjectChanged(); + markers_changed = true; } // update current movie data @@ -708,40 +705,47 @@ void HISTORY::RegisterBookmarkSet(int slot, BOOKMARK& backup_copy, int old_curre if (taseditor_config.enable_hot_changes) snap.copyHotChanges(&GetCurrentSnapshot()); AddItemToHistory(snap, old_current_branch, backup_copy); + project.SetProjectChanged(); } -void HISTORY::RegisterBranching(int mod_type, int first_change, int slot, int old_current_branch) +int HISTORY::RegisterBranching(int slot, bool markers_changed) { // create new snapshot SNAPSHOT snap; snap.init(currMovieData, taseditor_config.enable_hot_changes); - // fill description: modification type + time of the Branch - snap.mod_type = mod_type; - strcat(snap.description, modCaptions[snap.mod_type]); - strcat(snap.description, bookmarks.bookmarks_array[slot].snapshot.description); - snap.jump_frame = first_change; - snap.start_frame = first_change; - snap.end_frame = -1; - if (taseditor_config.enable_hot_changes) + // check if there are input differences from latest snapshot + int real_pos = (history_start_pos + history_cursor_pos) % history_size; + int first_changes = snap.findFirstChange(snapshots[real_pos]); + if (first_changes >= 0) { - if (mod_type < MODTYPE_BRANCH_MARKERS_0) - { - // input was changed + // differences found + // fill description: modification type + time of the Branch + snap.mod_type = MODTYPE_BRANCH_0 + slot; + strcat(snap.description, modCaptions[snap.mod_type]); + strcat(snap.description, bookmarks.bookmarks_array[slot].snapshot.description); + snap.jump_frame = first_changes; + snap.start_frame = first_changes; + snap.end_frame = -1; + if (taseditor_config.enable_hot_changes) // copy hotchanges of the Branch - if (taseditor_config.branch_full_movie) - { - snap.copyHotChanges(&bookmarks.bookmarks_array[slot].snapshot); - } else - { - // input was branched partially, so copy hotchanges only up to and not including jump_frame of the Branch - snap.copyHotChanges(&bookmarks.bookmarks_array[slot].snapshot, bookmarks.bookmarks_array[slot].snapshot.jump_frame); - } - } else - { - // input was not changed, only Markers were changed + snap.copyHotChanges(&bookmarks.bookmarks_array[slot].snapshot); + AddItemToHistory(snap, branches.GetCurrentBranch()); + project.SetProjectChanged(); + } else if (markers_changed) + { + // fill description: modification type + time of the Branch + snap.mod_type = MODTYPE_BRANCH_MARKERS_0 + slot; + strcat(snap.description, modCaptions[snap.mod_type]); + strcat(snap.description, bookmarks.bookmarks_array[slot].snapshot.description); + snap.jump_frame = bookmarks.bookmarks_array[slot].snapshot.jump_frame; + snap.start_frame = 0; + snap.end_frame = -1; + // input was not changed, only Markers were changed + if (taseditor_config.enable_hot_changes) snap.copyHotChanges(&GetCurrentSnapshot()); - } + AddItemToHistory(snap, branches.GetCurrentBranch()); + project.SetProjectChanged(); } - AddItemToHistory(snap, old_current_branch); + return first_changes; } void HISTORY::RegisterRecording(int frame_of_change) { diff --git a/src/drivers/win/taseditor/history.h b/src/drivers/win/taseditor/history.h index e4a938da..e25957dc 100644 --- a/src/drivers/win/taseditor/history.h +++ b/src/drivers/win/taseditor/history.h @@ -108,7 +108,7 @@ public: int RegisterPasteInsert(int start, SelectionFrames& inserted_set); void RegisterMarkersChange(int mod_type, int start = 0, int end =-1, const char* comment = 0); void RegisterBookmarkSet(int slot, BOOKMARK& backup_copy, int old_current_branch); - void RegisterBranching(int mod_type, int first_change, int slot, int old_current_branch); + int RegisterBranching(int slot, bool markers_changed); void RegisterRecording(int frame_of_change); void RegisterImport(MovieData& md, char* filename); int RegisterLuaChanges(const char* name, int start, bool InsertionDeletion_was_made); diff --git a/src/drivers/win/taseditor/piano_roll.cpp b/src/drivers/win/taseditor/piano_roll.cpp index 73a2c171..2aa0e563 100644 --- a/src/drivers/win/taseditor/piano_roll.cpp +++ b/src/drivers/win/taseditor/piano_roll.cpp @@ -1138,7 +1138,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) if (cell_y == history.GetUndoHint()) { // undo hint here - if (taseditor_config.show_markers && markers_manager.GetMarker(cell_y) && (drag_mode != DRAG_MODE_MARKER || marker_drag_framenum != cell_y)) + if (markers_manager.GetMarker(cell_y) && (drag_mode != DRAG_MODE_MARKER || marker_drag_framenum != cell_y)) { msg->clrTextBk = (taseditor_config.bind_markers) ? BINDMARKED_UNDOHINT_FRAMENUM_COLOR : MARKED_UNDOHINT_FRAMENUM_COLOR; } else @@ -1148,14 +1148,14 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) } else if (cell_y == currFrameCounter || cell_y == (playback.GetFlashingPauseFrame() - 1)) { // current frame - if (taseditor_config.show_markers && markers_manager.GetMarker(cell_y) && (drag_mode != DRAG_MODE_MARKER || marker_drag_framenum != cell_y)) + if (markers_manager.GetMarker(cell_y) && (drag_mode != DRAG_MODE_MARKER || marker_drag_framenum != cell_y)) { msg->clrTextBk = (taseditor_config.bind_markers) ? CUR_BINDMARKED_FRAMENUM_COLOR : CUR_MARKED_FRAMENUM_COLOR; } else { msg->clrTextBk = CUR_FRAMENUM_COLOR; } - } else if (taseditor_config.show_markers && markers_manager.GetMarker(cell_y) && (drag_mode != DRAG_MODE_MARKER || marker_drag_framenum != cell_y)) + } else if (markers_manager.GetMarker(cell_y) && (drag_mode != DRAG_MODE_MARKER || marker_drag_framenum != cell_y)) { // marked frame msg->clrTextBk = (taseditor_config.bind_markers) ? BINDMARKED_FRAMENUM_COLOR : MARKED_FRAMENUM_COLOR; @@ -1165,7 +1165,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) { if (!greenzone.savestates[cell_y].empty()) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(cell_y)) + if (greenzone.GetLagHistoryAtFrame(cell_y)) msg->clrTextBk = LAG_FRAMENUM_COLOR; else msg->clrTextBk = GREENZONE_FRAMENUM_COLOR; @@ -1174,7 +1174,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) || (!greenzone.savestates[cell_y & EVERY4TH].empty() && (int)greenzone.savestates.size() > (cell_y | 0x3) + 1 && !greenzone.savestates[(cell_y | 0x3) + 1].empty()) || (!greenzone.savestates[cell_y & EVERY2ND].empty() && !greenzone.savestates[(cell_y | 0x1) + 1].empty())) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(cell_y)) + if (greenzone.GetLagHistoryAtFrame(cell_y)) msg->clrTextBk = PALE_LAG_FRAMENUM_COLOR; else msg->clrTextBk = PALE_GREENZONE_FRAMENUM_COLOR; @@ -1205,7 +1205,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) { if (!greenzone.savestates[cell_y].empty()) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(cell_y)) + if (greenzone.GetLagHistoryAtFrame(cell_y)) msg->clrTextBk = LAG_INPUT_COLOR1; else msg->clrTextBk = GREENZONE_INPUT_COLOR1; @@ -1214,7 +1214,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) || (!greenzone.savestates[cell_y & EVERY4TH].empty() && (int)greenzone.savestates.size() > (cell_y | 0x3) + 1 && !greenzone.savestates[(cell_y | 0x3) + 1].empty()) || (!greenzone.savestates[cell_y & EVERY2ND].empty() && !greenzone.savestates[(cell_y | 0x1) + 1].empty())) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(cell_y)) + if (greenzone.GetLagHistoryAtFrame(cell_y)) msg->clrTextBk = PALE_LAG_INPUT_COLOR1; else msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR1; @@ -1244,7 +1244,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) { if (!greenzone.savestates[cell_y].empty()) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(cell_y)) + if (greenzone.GetLagHistoryAtFrame(cell_y)) msg->clrTextBk = LAG_INPUT_COLOR2; else msg->clrTextBk = GREENZONE_INPUT_COLOR2; @@ -1253,7 +1253,7 @@ LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg) || (!greenzone.savestates[cell_y & EVERY4TH].empty() && (int)greenzone.savestates.size() > (cell_y | 0x3) + 1 && !greenzone.savestates[(cell_y | 0x3) + 1].empty()) || (!greenzone.savestates[cell_y & EVERY2ND].empty() && !greenzone.savestates[(cell_y | 0x1) + 1].empty())) { - if (taseditor_config.show_lag_frames && greenzone.GetLagHistoryAtFrame(cell_y)) + if (greenzone.GetLagHistoryAtFrame(cell_y)) msg->clrTextBk = PALE_LAG_INPUT_COLOR2; else msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR2; @@ -1549,9 +1549,6 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) } } piano_roll.StartDraggingMarker(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), row_index, column_index); - // also clear selection - if (taseditor_config.deselect_on_doubleclick) - selection.ClearSelection(); } else { if (fwKeys & MK_SHIFT) diff --git a/src/drivers/win/taseditor/snapshot.cpp b/src/drivers/win/taseditor/snapshot.cpp index 507534ac..a7c2e3c2 100644 --- a/src/drivers/win/taseditor/snapshot.cpp +++ b/src/drivers/win/taseditor/snapshot.cpp @@ -114,9 +114,9 @@ MARKERS& SNAPSHOT::GetMarkers() void SNAPSHOT::toMovie(MovieData& md, int start, int end) { - if (end < 0) end = size-1; + if (end < 0 || end >= size) end = size - 1; // write input data to movie data - md.records.resize(size); + md.records.resize(end + 1); switch(input_type) { case INPUT_TYPE_FOURSCORE: @@ -486,7 +486,10 @@ int SNAPSHOT::findFirstChange(MovieData& md, int start, int end) } } // if sizes differ, return last frame from the lesser of them - if (size != md.getNumRecords()) return end; + if (size < md.getNumRecords() && end >= size-1) + return size-1; + else if (size > md.getNumRecords() && end >= md.getNumRecords()-1) + return md.getNumRecords()-1; return -1; // no changes were found } diff --git a/src/drivers/win/taseditor/splicer.cpp b/src/drivers/win/taseditor/splicer.cpp index 89447e81..7082cbd9 100644 --- a/src/drivers/win/taseditor/splicer.cpp +++ b/src/drivers/win/taseditor/splicer.cpp @@ -481,7 +481,7 @@ bool SPLICER::Paste() ++pos; } - if (!taseditor_config.superimpose_affects_paste || taseditor_config.superimpose == SUPERIMPOSE_UNCHECKED) + if (taseditor_config.superimpose == SUPERIMPOSE_UNCHECKED) { currMovieData.records[pos].joysticks[0] = 0; currMovieData.records[pos].joysticks[1] = 0; @@ -497,7 +497,7 @@ bool SPLICER::Paste() { case '|': // Joystick mark // flush buttons to movie data - if (taseditor_config.superimpose_affects_paste && (taseditor_config.superimpose == SUPERIMPOSE_CHECKED || (taseditor_config.superimpose == SUPERIMPOSE_INDETERMINATE && new_buttons == 0))) + if (taseditor_config.superimpose == SUPERIMPOSE_CHECKED || (taseditor_config.superimpose == SUPERIMPOSE_INDETERMINATE && new_buttons == 0)) { flash_joy[joy] |= (new_buttons & (~currMovieData.records[pos].joysticks[joy])); // highlight buttons that are new currMovieData.records[pos].joysticks[joy] |= new_buttons; @@ -523,7 +523,7 @@ bool SPLICER::Paste() ++frame; } // before going to next frame, flush buttons to movie data - if (taseditor_config.superimpose_affects_paste && (taseditor_config.superimpose == SUPERIMPOSE_CHECKED || (taseditor_config.superimpose == SUPERIMPOSE_INDETERMINATE && new_buttons == 0))) + if (taseditor_config.superimpose == SUPERIMPOSE_CHECKED || (taseditor_config.superimpose == SUPERIMPOSE_INDETERMINATE && new_buttons == 0)) { flash_joy[joy] |= (new_buttons & (~currMovieData.records[pos].joysticks[joy])); // highlight buttons that are new currMovieData.records[pos].joysticks[joy] |= new_buttons; diff --git a/src/drivers/win/taseditor/taseditor_config.cpp b/src/drivers/win/taseditor/taseditor_config.cpp index a235f1f9..3f25b924 100644 --- a/src/drivers/win/taseditor/taseditor_config.cpp +++ b/src/drivers/win/taseditor/taseditor_config.cpp @@ -35,8 +35,6 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG() findnote_wndy = 0; follow_playback = true; turbo_seek = false; - show_lag_frames = true; - show_markers = true; show_branch_screenshots = true; show_branch_descr = true; enable_hot_changes = true; @@ -48,7 +46,6 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG() use_1p_rec = true; columnset_by_keys = false; superimpose = 0; // SUPERIMPOSE_UNCHECKED - superimpose_affects_paste = true; branch_full_movie = true; branch_only_when_rec = false; view_branches_tree = false; @@ -69,7 +66,6 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG() findnote_matchcase = false; findnote_search_up = false; enable_auto_function = true; - deselect_on_doubleclick = true; draw_input = true; silent_autosave = true; autopause_at_finish = true; diff --git a/src/drivers/win/taseditor/taseditor_config.h b/src/drivers/win/taseditor/taseditor_config.h index 4928b50f..0c5dc0b5 100644 --- a/src/drivers/win/taseditor/taseditor_config.h +++ b/src/drivers/win/taseditor/taseditor_config.h @@ -33,8 +33,6 @@ public: int findnote_wndy; bool follow_playback; bool turbo_seek; - bool show_lag_frames; - bool show_markers; bool show_branch_screenshots; bool show_branch_descr; bool enable_hot_changes; @@ -46,7 +44,6 @@ public: bool use_1p_rec; bool columnset_by_keys; int superimpose; - bool superimpose_affects_paste; bool branch_full_movie; bool branch_only_when_rec; bool view_branches_tree; @@ -67,7 +64,6 @@ public: bool findnote_matchcase; bool findnote_search_up; bool enable_auto_function; - bool deselect_on_doubleclick; bool draw_input; bool silent_autosave; bool autopause_at_finish; diff --git a/src/drivers/win/taseditor/taseditor_window.cpp b/src/drivers/win/taseditor/taseditor_window.cpp index c2d70150..0168f1ec 100644 --- a/src/drivers/win/taseditor/taseditor_window.cpp +++ b/src/drivers/win/taseditor/taseditor_window.cpp @@ -51,7 +51,6 @@ extern HISTORY history; extern POPUP_DISPLAY popup_display; extern bool turbo; -extern bool muteTurbo; extern bool must_call_manual_lua_function; extern char* GetKeyComboName(int c); @@ -564,8 +563,6 @@ void TASEDITOR_WINDOW::UpdateCheckedItems() CheckDlgButton(hwndTasEditor, IDC_USEPATTERN, taseditor_config.pattern_recording?BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndTasEditor, IDC_RUN_AUTO, taseditor_config.enable_auto_function?BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndTasEditor, CHECK_TURBO_SEEK, taseditor_config.turbo_seek?BST_CHECKED : BST_UNCHECKED); - CheckMenuItem(hmenu, ID_VIEW_SHOW_LAG_FRAMES, taseditor_config.show_lag_frames?MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, ID_VIEW_SHOW_MARKERS, taseditor_config.show_markers?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_VIEW_SHOWBRANCHSCREENSHOTS, taseditor_config.show_branch_screenshots?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_VIEW_SHOWBRANCHTOOLTIPS, taseditor_config.show_branch_descr?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_VIEW_JUMPWHENMAKINGUNDO, taseditor_config.jump_to_undo?MF_CHECKED : MF_UNCHECKED); @@ -579,12 +576,9 @@ void TASEDITOR_WINDOW::UpdateCheckedItems() CheckMenuItem(hmenu, ID_CONFIG_COMBINECONSECUTIVERECORDINGS, taseditor_config.combine_consecutive?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_USE1PFORRECORDING, taseditor_config.use_1p_rec?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_USEINPUTKEYSFORCOLUMNSET, taseditor_config.columnset_by_keys?MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE, taseditor_config.superimpose_affects_paste?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_COLUMNSETPATTERNSKIPSLAG, taseditor_config.pattern_skips_lag?MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, ID_CONFIG_DESELECTONDOUBLECLICK, taseditor_config.deselect_on_doubleclick?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_DRAWINPUTBYDRAGGING, taseditor_config.draw_input?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_SILENTAUTOSAVE, taseditor_config.silent_autosave?MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(hmenu, ID_CONFIG_MUTETURBO, muteTurbo?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_CONFIG_AUTOPAUSEATTHEENDOFMOVIE, taseditor_config.autopause_at_finish?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hmenu, ID_HELP_TOOLTIPS, taseditor_config.tooltips?MF_CHECKED : MF_UNCHECKED); } @@ -1033,17 +1027,6 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara if (playback.pause_frame) turbo = taseditor_config.turbo_seek; break; - case ID_VIEW_SHOW_LAG_FRAMES: - taseditor_config.show_lag_frames ^= 1; - taseditor_window.UpdateCheckedItems(); - piano_roll.RedrawList(); - bookmarks.RedrawBookmarksList(); - break; - case ID_VIEW_SHOW_MARKERS: - taseditor_config.show_markers ^= 1; - taseditor_window.UpdateCheckedItems(); - piano_roll.RedrawList(); // no need to redraw Bookmarks, as Markers are only shown in Piano Roll - break; case ID_VIEW_SHOWBRANCHSCREENSHOTS: taseditor_config.show_branch_screenshots ^= 1; taseditor_window.UpdateCheckedItems(); @@ -1152,18 +1135,10 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara taseditor_config.columnset_by_keys ^= 1; taseditor_window.UpdateCheckedItems(); break; - case ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE: - taseditor_config.superimpose_affects_paste ^= 1; - taseditor_window.UpdateCheckedItems(); - break; case ID_CONFIG_COLUMNSETPATTERNSKIPSLAG: taseditor_config.pattern_skips_lag ^= 1; taseditor_window.UpdateCheckedItems(); break; - case ID_CONFIG_DESELECTONDOUBLECLICK: - taseditor_config.deselect_on_doubleclick ^= 1; - taseditor_window.UpdateCheckedItems(); - break; case ID_CONFIG_DRAWINPUTBYDRAGGING: taseditor_config.draw_input ^= 1; taseditor_window.UpdateCheckedItems(); @@ -1172,10 +1147,6 @@ BOOL CALLBACK WndprocTasEditor(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara taseditor_config.silent_autosave ^= 1; taseditor_window.UpdateCheckedItems(); break; - case ID_CONFIG_MUTETURBO: - muteTurbo ^= 1; - taseditor_window.UpdateCheckedItems(); - break; case ID_CONFIG_AUTOPAUSEATTHEENDOFMOVIE: taseditor_config.autopause_at_finish ^= 1; taseditor_window.UpdateCheckedItems();