diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index d7d0f689..b1feeaeb 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -1493,7 +1493,7 @@ END IDD_TASEDITOR_SAVECOMPACT DIALOGEX 0, 0, 122, 134 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" +CAPTION "Save Compact" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Save",IDOK,7,114,50,14 diff --git a/src/drivers/win/taseditor.cpp b/src/drivers/win/taseditor.cpp index 073468ae..a30a334c 100644 --- a/src/drivers/win/taseditor.cpp +++ b/src/drivers/win/taseditor.cpp @@ -600,7 +600,11 @@ void Import() char drv[512], dir[512], name[1024], ext[512]; splitpath(nameo, drv, dir, name, ext); strcat(name, ext); - history.RegisterImport(md, name); + int result = history.RegisterImport(md, name); + if (result >= 0) + greenzone.InvalidateAndCheck(result); + else + MessageBox(taseditor_window.hwndTasEditor, "Imported movie has the same input.\nNo changes were made.", "TAS Editor", MB_OK); } else { FCEUD_PrintError("Error loading movie data!"); diff --git a/src/drivers/win/taseditor/greenzone.cpp b/src/drivers/win/taseditor/greenzone.cpp index 909a237b..67dddbd3 100644 --- a/src/drivers/win/taseditor/greenzone.cpp +++ b/src/drivers/win/taseditor/greenzone.cpp @@ -14,6 +14,7 @@ Greenzone - Access zone * also stores the frame-by-frame log of lag appearance * saves and loads the data from a project file. On error: truncates Greenzone to last successfully read savestate * regularly checks if there's a savestate of current emulation state, if there's no such savestate in array then creates one and updates lag info for previous frame +* implements the working of "Auto-adjust Input due to lag" * regularly runs gradual cleaning of the savestates array (for memory saving), deleting oldest savestates * on demand: (when movie input was changed) truncates the size of Greenzone, deleting savestates that became irrelevant because of new input. After truncating it may also move Playback cursor (which must always reside within Greenzone) and may launch Playback seeking * stores resources: save id, properties of gradual cleaning, timing of cleaning @@ -435,7 +436,6 @@ void GREENZONE::InvalidateAndCheck(int after) { if (after >= 0) { - project.SetProjectChanged(); if (greenZoneCount > after+1) { greenZoneCount = after+1; @@ -466,7 +466,6 @@ void GREENZONE::Invalidate(int after) { if (after >= 0) { - project.SetProjectChanged(); if (greenZoneCount > after+1) { greenZoneCount = after+1; diff --git a/src/drivers/win/taseditor/history.cpp b/src/drivers/win/taseditor/history.cpp index 00023ebf..b69f731b 100644 --- a/src/drivers/win/taseditor/history.cpp +++ b/src/drivers/win/taseditor/history.cpp @@ -660,6 +660,7 @@ int HISTORY::RegisterChanges(int mod_type, int start, int end, const char* comme } } branches.ChangesMadeSinceBranch(); + project.SetProjectChanged(); } return first_changes; } @@ -693,6 +694,7 @@ int HISTORY::RegisterInsertNum(int start, int frames) snap.inheritHotChanges_InsertNum(&snapshots[real_pos], start, frames, true); AddItemToHistory(snap); branches.ChangesMadeSinceBranch(); + project.SetProjectChanged(); } return first_changes; } @@ -724,6 +726,7 @@ int HISTORY::RegisterPasteInsert(int start, SelectionFrames& inserted_set) snap.inheritHotChanges_PasteInsert(&snapshots[real_pos], inserted_set); AddItemToHistory(snap); branches.ChangesMadeSinceBranch(); + project.SetProjectChanged(); } return first_changes; } @@ -899,8 +902,9 @@ void HISTORY::RegisterRecording(int frame_of_change) AddItemToHistory(snap); } branches.ChangesMadeSinceBranch(); + project.SetProjectChanged(); } -void HISTORY::RegisterImport(MovieData& md, char* filename) +int HISTORY::RegisterImport(MovieData& md, char* filename) { // create new snapshot SNAPSHOT snap; @@ -930,11 +934,8 @@ void HISTORY::RegisterImport(MovieData& md, char* filename) piano_roll.UpdateItemCount(); branches.ChangesMadeSinceBranch(); project.SetProjectChanged(); - greenzone.InvalidateAndCheck(first_changes); - } else - { - MessageBox(taseditor_window.hwndTasEditor, "Imported movie has the same input.\nNo changes were made.", "TAS Editor", MB_OK); } + return first_changes; } int HISTORY::RegisterLuaChanges(const char* name, int start, bool InsertionDeletion_was_made) { @@ -999,6 +1000,7 @@ int HISTORY::RegisterLuaChanges(const char* name, int start, bool InsertionDelet } AddItemToHistory(snap); branches.ChangesMadeSinceBranch(); + project.SetProjectChanged(); } return first_changes; } diff --git a/src/drivers/win/taseditor/history.h b/src/drivers/win/taseditor/history.h index 800d9f3d..ddf925b8 100644 --- a/src/drivers/win/taseditor/history.h +++ b/src/drivers/win/taseditor/history.h @@ -112,7 +112,7 @@ public: void RegisterBookmarkSet(int slot, BOOKMARK& backup_copy, int old_current_branch); int RegisterBranching(int slot, bool markers_changed); void RegisterRecording(int frame_of_change); - void RegisterImport(MovieData& md, char* filename); + int RegisterImport(MovieData& md, char* filename); int RegisterLuaChanges(const char* name, int start, bool InsertionDeletion_was_made); int GetCategoryOfOperation(int mod_type);