Taseditor bugfixes
This commit is contained in:
parent
c0d73203db
commit
51c7544b13
|
@ -225,7 +225,7 @@ BEGIN
|
||||||
MENUITEM "Save &Compact", ID_FILE_SAVECOMPACT, INACTIVE
|
MENUITEM "Save &Compact", ID_FILE_SAVECOMPACT, INACTIVE
|
||||||
MENUITEM "&Recent", ID_TASEDIT_FILE_RECENT
|
MENUITEM "&Recent", ID_TASEDIT_FILE_RECENT
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Import", ID_FILE_IMPORTFM2
|
MENUITEM "&Import", ID_FILE_IMPORT
|
||||||
MENUITEM "&Export to FM2", ID_FILE_EXPORTFM2
|
MENUITEM "&Export to FM2", ID_FILE_EXPORTFM2
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Close\tAlt+F4", ID_TASEDIT_FILE_CLOSE
|
MENUITEM "&Close\tAlt+F4", ID_TASEDIT_FILE_CLOSE
|
||||||
|
|
|
@ -180,7 +180,6 @@
|
||||||
#define IDB_BITMAP18 181
|
#define IDB_BITMAP18 181
|
||||||
#define IDB_BITMAP19 182
|
#define IDB_BITMAP19 182
|
||||||
#define IDB_BRANCH_SPRITESHEET 184
|
#define IDB_BRANCH_SPRITESHEET 184
|
||||||
#define IDD_DIALOG4 185
|
|
||||||
#define IDD_TASEDIT_EXPORT 185
|
#define IDD_TASEDIT_EXPORT 185
|
||||||
#define MENU_RESET 200
|
#define MENU_RESET 200
|
||||||
#define BUTTON_ROMS 200
|
#define BUTTON_ROMS 200
|
||||||
|
@ -648,7 +647,7 @@
|
||||||
#define ID_Menu40175 40175
|
#define ID_Menu40175 40175
|
||||||
#define ID_Menu40176 40176
|
#define ID_Menu40176 40176
|
||||||
#define ID_EDIT_TRUNCATE 40177
|
#define ID_EDIT_TRUNCATE 40177
|
||||||
#define ID_FILE_IMPORTFM2 40178
|
#define ID_FILE_IMPORT 40178
|
||||||
#define ID_FILE_NEWPROJECT 40179
|
#define ID_FILE_NEWPROJECT 40179
|
||||||
#define ID_FILE_OPEN_PROJECT 40180
|
#define ID_FILE_OPEN_PROJECT 40180
|
||||||
#define ID_FILE_OPENPROJECT 40181
|
#define ID_FILE_OPENPROJECT 40181
|
||||||
|
|
|
@ -767,22 +767,22 @@ void OpenProject()
|
||||||
{
|
{
|
||||||
if (!AskSaveProject()) return;
|
if (!AskSaveProject()) return;
|
||||||
|
|
||||||
const char TPfilter[]="TASEdit Project (*.tas)\0*.tas\0\0";
|
const char filter[] = "TASEdit Project (*.tas)\0*.tas\0\0";
|
||||||
|
|
||||||
OPENFILENAME ofn;
|
OPENFILENAME ofn;
|
||||||
memset(&ofn,0,sizeof(ofn));
|
memset(&ofn, 0, sizeof(ofn));
|
||||||
ofn.lStructSize=sizeof(ofn);
|
ofn.lStructSize = sizeof(ofn);
|
||||||
ofn.hwndOwner = hwndTasEdit;
|
ofn.hwndOwner = hwndTasEdit;
|
||||||
ofn.hInstance=fceu_hInstance;
|
ofn.hInstance = fceu_hInstance;
|
||||||
ofn.lpstrTitle="Open TASEdit Project...";
|
ofn.lpstrTitle = "Open TASEdit Project...";
|
||||||
ofn.lpstrFilter=TPfilter;
|
ofn.lpstrFilter = filter;
|
||||||
|
|
||||||
char nameo[2048];
|
char nameo[2048];
|
||||||
strcpy(nameo, mass_replace(GetRomName(),"|",".").c_str()); //convert | to . for archive filenames
|
strcpy(nameo, mass_replace(GetRomName(), "|", ".").c_str()); //convert | to . for archive filenames
|
||||||
|
|
||||||
ofn.lpstrFile=nameo;
|
ofn.lpstrFile = nameo;
|
||||||
ofn.nMaxFile = 2048;
|
ofn.nMaxFile = 2048;
|
||||||
ofn.Flags=OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST;
|
ofn.Flags = OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST;
|
||||||
string initdir = FCEU_GetPath(FCEUMKF_MOVIE);
|
string initdir = FCEU_GetPath(FCEUMKF_MOVIE);
|
||||||
ofn.lpstrInitialDir = initdir.c_str();
|
ofn.lpstrInitialDir = initdir.c_str();
|
||||||
|
|
||||||
|
@ -805,9 +805,14 @@ void OpenProject()
|
||||||
project.LoadProject(project.GetProjectFile());
|
project.LoadProject(project.GetProjectFile());
|
||||||
// update fourscore status
|
// update fourscore status
|
||||||
if (last_fourscore && !currMovieData.fourscore)
|
if (last_fourscore && !currMovieData.fourscore)
|
||||||
|
{
|
||||||
tasedit_list.RemoveFourscore();
|
tasedit_list.RemoveFourscore();
|
||||||
else if (!last_fourscore && currMovieData.fourscore)
|
FCEUD_SetInput(currMovieData.fourscore, currMovieData.microphone, (ESI)currMovieData.ports[0], (ESI)currMovieData.ports[1], (ESIFC)currMovieData.ports[2]);
|
||||||
|
} else if (!last_fourscore && currMovieData.fourscore)
|
||||||
|
{
|
||||||
tasedit_list.AddFourscore();
|
tasedit_list.AddFourscore();
|
||||||
|
FCEUD_SetInput(currMovieData.fourscore, currMovieData.microphone, (ESI)currMovieData.ports[0], (ESI)currMovieData.ports[1], (ESIFC)currMovieData.ports[2]);
|
||||||
|
}
|
||||||
RedrawTasedit();
|
RedrawTasedit();
|
||||||
RedrawWindowCaption();
|
RedrawWindowCaption();
|
||||||
}
|
}
|
||||||
|
@ -1009,6 +1014,7 @@ void Export()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// dump to disk
|
||||||
temp_md.dump(osRecordingMovie, false);
|
temp_md.dump(osRecordingMovie, false);
|
||||||
delete osRecordingMovie;
|
delete osRecordingMovie;
|
||||||
osRecordingMovie = 0;
|
osRecordingMovie = 0;
|
||||||
|
@ -1146,7 +1152,7 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
case ID_FILE_SAVEPROJECTAS:
|
case ID_FILE_SAVEPROJECTAS:
|
||||||
SaveProjectAs();
|
SaveProjectAs();
|
||||||
break;
|
break;
|
||||||
case ID_FILE_IMPORTFM2:
|
case ID_FILE_IMPORT:
|
||||||
Import();
|
Import();
|
||||||
break;
|
break;
|
||||||
case ID_FILE_EXPORTFM2:
|
case ID_FILE_EXPORTFM2:
|
||||||
|
@ -1291,8 +1297,8 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
if (new_size != TasEdit_undo_levels)
|
if (new_size != TasEdit_undo_levels)
|
||||||
{
|
{
|
||||||
TasEdit_undo_levels = new_size;
|
TasEdit_undo_levels = new_size;
|
||||||
history.init(TasEdit_undo_levels);
|
history.reset();
|
||||||
selection.init(TasEdit_undo_levels);
|
selection.reset();
|
||||||
// hot changes were cleared, so update list
|
// hot changes were cleared, so update list
|
||||||
tasedit_list.RedrawList();
|
tasedit_list.RedrawList();
|
||||||
}
|
}
|
||||||
|
@ -1591,6 +1597,10 @@ void EnterTasEdit()
|
||||||
}
|
}
|
||||||
// switch to tasedit mode
|
// switch to tasedit mode
|
||||||
movieMode = MOVIEMODE_TASEDIT;
|
movieMode = MOVIEMODE_TASEDIT;
|
||||||
|
currMovieData.ports[0] = SI_GAMEPAD;
|
||||||
|
currMovieData.ports[1] = SI_GAMEPAD;
|
||||||
|
//force the input configuration stored in the movie to apply
|
||||||
|
FCEUD_SetInput(currMovieData.fourscore, currMovieData.microphone, (ESI)currMovieData.ports[0], (ESI)currMovieData.ports[1], (ESIFC)currMovieData.ports[2]);
|
||||||
// init variables
|
// init variables
|
||||||
recorder.init();
|
recorder.init();
|
||||||
tasedit_list.init();
|
tasedit_list.init();
|
||||||
|
@ -1598,8 +1608,8 @@ void EnterTasEdit()
|
||||||
project.init();
|
project.init();
|
||||||
bookmarks.init();
|
bookmarks.init();
|
||||||
screenshot_display.init();
|
screenshot_display.init();
|
||||||
history.init(TasEdit_undo_levels);
|
history.init();
|
||||||
selection.init(TasEdit_undo_levels);
|
selection.init();
|
||||||
SetFocus(history.hwndHistoryList); // set focus only once, to show selection cursor
|
SetFocus(history.hwndHistoryList); // set focus only once, to show selection cursor
|
||||||
SetFocus(tasedit_list.hwndList);
|
SetFocus(tasedit_list.hwndList);
|
||||||
FCEU_DispMessage("Tasedit engaged", 0);
|
FCEU_DispMessage("Tasedit engaged", 0);
|
||||||
|
@ -1625,7 +1635,7 @@ bool ExitTasEdit()
|
||||||
// release memory
|
// release memory
|
||||||
tasedit_list.free();
|
tasedit_list.free();
|
||||||
markers.free();
|
markers.free();
|
||||||
greenzone.clearGreenzone();
|
greenzone.free();
|
||||||
bookmarks.free();
|
bookmarks.free();
|
||||||
screenshot_display.free();
|
screenshot_display.free();
|
||||||
history.free();
|
history.free();
|
||||||
|
|
|
@ -21,7 +21,7 @@ void BOOKMARK::init()
|
||||||
not_empty = false;
|
not_empty = false;
|
||||||
flash_type = flash_phase = 0;
|
flash_type = flash_phase = 0;
|
||||||
snapshot.jump_frame = -1;
|
snapshot.jump_frame = -1;
|
||||||
parent_branch = -1; // -1 = root
|
parent_branch = -1; // -1 = root (cloud)
|
||||||
}
|
}
|
||||||
|
|
||||||
void BOOKMARK::set()
|
void BOOKMARK::set()
|
||||||
|
|
|
@ -88,21 +88,8 @@ void BOOKMARKS::init()
|
||||||
BranchPrevY.resize(TOTAL_BOOKMARKS+1);
|
BranchPrevY.resize(TOTAL_BOOKMARKS+1);
|
||||||
BranchCurrX.resize(TOTAL_BOOKMARKS+1);
|
BranchCurrX.resize(TOTAL_BOOKMARKS+1);
|
||||||
BranchCurrY.resize(TOTAL_BOOKMARKS+1);
|
BranchCurrY.resize(TOTAL_BOOKMARKS+1);
|
||||||
for (int i = TOTAL_BOOKMARKS; i >= 0; i--)
|
|
||||||
{
|
|
||||||
BranchX[i] = BranchPrevX[i] = BranchCurrX[i] = EMPTY_BRANCHES_X;
|
|
||||||
BranchY[i] = BranchPrevY[i] = BranchCurrY[i] = EMPTY_BRANCHES_Y_BASE + EMPTY_BRANCHES_Y_FACTOR * ((i + TOTAL_BOOKMARKS - 1) % TOTAL_BOOKMARKS);
|
|
||||||
}
|
|
||||||
CursorX = CursorPrevX = CloudX = CloudPrevX = BRANCHES_CLOUD_X;
|
|
||||||
CursorY = CursorPrevY = BRANCHES_CLOUD_Y;
|
|
||||||
reset();
|
|
||||||
current_branch = -1; // -1 = root
|
|
||||||
changes_since_current_branch = false;
|
|
||||||
fireball_size = 0;
|
|
||||||
|
|
||||||
// set cloud_time and current_pos_time
|
reset();
|
||||||
SetCurrentPosTime();
|
|
||||||
strcpy(cloud_time, current_pos_time);
|
|
||||||
|
|
||||||
// init bookmarks
|
// init bookmarks
|
||||||
bookmarks_array.resize(TOTAL_BOOKMARKS);
|
bookmarks_array.resize(TOTAL_BOOKMARKS);
|
||||||
|
@ -145,6 +132,24 @@ void BOOKMARKS::init()
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
void BOOKMARKS::reset()
|
void BOOKMARKS::reset()
|
||||||
|
{
|
||||||
|
for (int i = TOTAL_BOOKMARKS; i >= 0; i--)
|
||||||
|
{
|
||||||
|
BranchX[i] = BranchPrevX[i] = BranchCurrX[i] = EMPTY_BRANCHES_X;
|
||||||
|
BranchY[i] = BranchPrevY[i] = BranchCurrY[i] = EMPTY_BRANCHES_Y_BASE + EMPTY_BRANCHES_Y_FACTOR * ((i + TOTAL_BOOKMARKS - 1) % TOTAL_BOOKMARKS);
|
||||||
|
}
|
||||||
|
CursorX = CursorPrevX = CloudX = CloudPrevX = BRANCHES_CLOUD_X;
|
||||||
|
CursorY = CursorPrevY = BRANCHES_CLOUD_Y;
|
||||||
|
reset_vars();
|
||||||
|
current_branch = -1; // -1 = root
|
||||||
|
changes_since_current_branch = false;
|
||||||
|
fireball_size = 0;
|
||||||
|
|
||||||
|
// set cloud_time and current_pos_time
|
||||||
|
SetCurrentPosTime();
|
||||||
|
strcpy(cloud_time, current_pos_time);
|
||||||
|
}
|
||||||
|
void BOOKMARKS::reset_vars()
|
||||||
{
|
{
|
||||||
transition_phase = animation_frame = 0;
|
transition_phase = animation_frame = 0;
|
||||||
mouse_x = mouse_y = -1;
|
mouse_x = mouse_y = -1;
|
||||||
|
@ -561,7 +566,7 @@ bool BOOKMARKS::load(EMUFILE *is)
|
||||||
if (bookmarks_array[i].load(is)) return true;
|
if (bookmarks_array[i].load(is)) return true;
|
||||||
}
|
}
|
||||||
// all ok
|
// all ok
|
||||||
reset();
|
reset_vars();
|
||||||
RedrawBookmarksCaption();
|
RedrawBookmarksCaption();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,8 +89,9 @@ class BOOKMARKS
|
||||||
public:
|
public:
|
||||||
BOOKMARKS();
|
BOOKMARKS();
|
||||||
void init();
|
void init();
|
||||||
void reset();
|
|
||||||
void free();
|
void free();
|
||||||
|
void reset();
|
||||||
|
void reset_vars();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
void save(EMUFILE *os);
|
void save(EMUFILE *os);
|
||||||
|
|
|
@ -23,14 +23,27 @@ GREENZONE::GREENZONE()
|
||||||
|
|
||||||
void GREENZONE::init()
|
void GREENZONE::init()
|
||||||
{
|
{
|
||||||
clearGreenzone();
|
|
||||||
reset();
|
reset();
|
||||||
next_cleaning_time = clock() + TIME_BETWEEN_CLEANINGS;
|
next_cleaning_time = clock() + TIME_BETWEEN_CLEANINGS;
|
||||||
}
|
}
|
||||||
|
void GREENZONE::free()
|
||||||
|
{
|
||||||
|
int size = savestates.size();
|
||||||
|
for (int i = 0; i < size; ++i)
|
||||||
|
{
|
||||||
|
ClearSavestate(i);
|
||||||
|
}
|
||||||
|
savestates.resize(0);
|
||||||
|
greenZoneCount = 0;
|
||||||
|
lag_history.resize(0);
|
||||||
|
// reset lua_colorings
|
||||||
|
// reset monitorings
|
||||||
|
|
||||||
|
}
|
||||||
void GREENZONE::reset()
|
void GREENZONE::reset()
|
||||||
{
|
{
|
||||||
|
free();
|
||||||
lag_history.resize(currMovieData.getNumRecords());
|
lag_history.resize(currMovieData.getNumRecords());
|
||||||
|
|
||||||
}
|
}
|
||||||
void GREENZONE::update()
|
void GREENZONE::update()
|
||||||
{
|
{
|
||||||
|
@ -169,21 +182,6 @@ void GREENZONE::ClearSavestate(int index)
|
||||||
savestates[index].swap(tmp);
|
savestates[index].swap(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GREENZONE::clearGreenzone()
|
|
||||||
{
|
|
||||||
int size = savestates.size();
|
|
||||||
for (int i = 0; i < size; ++i)
|
|
||||||
{
|
|
||||||
ClearSavestate(i);
|
|
||||||
}
|
|
||||||
savestates.resize(0);
|
|
||||||
greenZoneCount = 0;
|
|
||||||
lag_history.resize(0);
|
|
||||||
// reset lua_colorings
|
|
||||||
// reset monitorings
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void GREENZONE::save(EMUFILE *os)
|
void GREENZONE::save(EMUFILE *os)
|
||||||
{
|
{
|
||||||
int frame, size;
|
int frame, size;
|
||||||
|
@ -226,7 +224,7 @@ void GREENZONE::save(EMUFILE *os)
|
||||||
// returns true if couldn't load
|
// returns true if couldn't load
|
||||||
bool GREENZONE::load(EMUFILE *is)
|
bool GREENZONE::load(EMUFILE *is)
|
||||||
{
|
{
|
||||||
clearGreenzone();
|
free();
|
||||||
int frame = 0, prev_frame = -1, size = 0;
|
int frame = 0, prev_frame = -1, size = 0;
|
||||||
int last_tick = 0;
|
int last_tick = 0;
|
||||||
// read "GREENZONE" string
|
// read "GREENZONE" string
|
||||||
|
|
|
@ -17,12 +17,12 @@ public:
|
||||||
GREENZONE();
|
GREENZONE();
|
||||||
void init();
|
void init();
|
||||||
void reset();
|
void reset();
|
||||||
|
void free();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
void save(EMUFILE *os);
|
void save(EMUFILE *os);
|
||||||
bool load(EMUFILE *is);
|
bool load(EMUFILE *is);
|
||||||
|
|
||||||
void clearGreenzone();
|
|
||||||
void TryDumpIncremental(bool lagFlag = true);
|
void TryDumpIncremental(bool lagFlag = true);
|
||||||
|
|
||||||
bool loadTasSavestate(int frame);
|
bool loadTasSavestate(int frame);
|
||||||
|
|
|
@ -7,6 +7,7 @@ extern bool TASEdit_bind_markers;
|
||||||
extern bool TASEdit_enable_hot_changes;
|
extern bool TASEdit_enable_hot_changes;
|
||||||
extern bool TASEdit_branch_full_movie;
|
extern bool TASEdit_branch_full_movie;
|
||||||
extern bool TASEdit_combine_consecutive_rec;
|
extern bool TASEdit_combine_consecutive_rec;
|
||||||
|
extern int TasEdit_undo_levels;
|
||||||
|
|
||||||
LRESULT APIENTRY HistoryListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
LRESULT APIENTRY HistoryListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
WNDPROC hwndHistoryList_oldWndProc;
|
WNDPROC hwndHistoryList_oldWndProc;
|
||||||
|
@ -61,7 +62,7 @@ INPUT_HISTORY::INPUT_HISTORY()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void INPUT_HISTORY::init(int new_size)
|
void INPUT_HISTORY::init()
|
||||||
{
|
{
|
||||||
// prepare the history listview
|
// prepare the history listview
|
||||||
hwndHistoryList = GetDlgItem(hwndTasEdit, IDC_HISTORYLIST);
|
hwndHistoryList = GetDlgItem(hwndTasEdit, IDC_HISTORYLIST);
|
||||||
|
@ -73,13 +74,21 @@ void INPUT_HISTORY::init(int new_size)
|
||||||
lvc.cx = 500;
|
lvc.cx = 500;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
ListView_InsertColumn(hwndHistoryList, 0, &lvc);
|
ListView_InsertColumn(hwndHistoryList, 0, &lvc);
|
||||||
|
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
void INPUT_HISTORY::free()
|
||||||
|
{
|
||||||
|
input_snapshots.resize(0);
|
||||||
|
history_total_items = 0;
|
||||||
|
}
|
||||||
|
void INPUT_HISTORY::reset()
|
||||||
|
{
|
||||||
|
free();
|
||||||
// init vars
|
// init vars
|
||||||
if (new_size > 0)
|
history_size = TasEdit_undo_levels + 1;
|
||||||
history_size = new_size + 1;
|
|
||||||
undo_hint_pos = old_undo_hint_pos = undo_hint_time = -1;
|
undo_hint_pos = old_undo_hint_pos = undo_hint_time = -1;
|
||||||
old_show_undo_hint = show_undo_hint = false;
|
old_show_undo_hint = show_undo_hint = false;
|
||||||
// clear snapshots history
|
|
||||||
free();
|
|
||||||
input_snapshots.resize(history_size);
|
input_snapshots.resize(history_size);
|
||||||
history_start_pos = 0;
|
history_start_pos = 0;
|
||||||
history_cursor_pos = -1;
|
history_cursor_pos = -1;
|
||||||
|
@ -89,16 +98,9 @@ void INPUT_HISTORY::init(int new_size)
|
||||||
strcat(inp.description, modCaptions[0]);
|
strcat(inp.description, modCaptions[0]);
|
||||||
inp.jump_frame = -1;
|
inp.jump_frame = -1;
|
||||||
AddInputSnapshotToHistory(inp);
|
AddInputSnapshotToHistory(inp);
|
||||||
|
|
||||||
UpdateHistoryList();
|
UpdateHistoryList();
|
||||||
RedrawHistoryList();
|
RedrawHistoryList();
|
||||||
}
|
}
|
||||||
void INPUT_HISTORY::free()
|
|
||||||
{
|
|
||||||
input_snapshots.resize(0);
|
|
||||||
history_total_items = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void INPUT_HISTORY::update()
|
void INPUT_HISTORY::update()
|
||||||
{
|
{
|
||||||
// update undo_hint
|
// update undo_hint
|
||||||
|
|
|
@ -48,9 +48,9 @@ class INPUT_HISTORY
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
INPUT_HISTORY();
|
INPUT_HISTORY();
|
||||||
void init(int new_size = 0);
|
void init();
|
||||||
void free();
|
void free();
|
||||||
|
void reset();
|
||||||
void update(); // called every frame
|
void update(); // called every frame
|
||||||
|
|
||||||
void save(EMUFILE *os);
|
void save(EMUFILE *os);
|
||||||
|
|
|
@ -10,6 +10,10 @@ MARKERS::MARKERS()
|
||||||
}
|
}
|
||||||
|
|
||||||
void MARKERS::init()
|
void MARKERS::init()
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
void MARKERS::reset()
|
||||||
{
|
{
|
||||||
free();
|
free();
|
||||||
update();
|
update();
|
||||||
|
|
|
@ -9,6 +9,7 @@ class MARKERS
|
||||||
public:
|
public:
|
||||||
MARKERS();
|
MARKERS();
|
||||||
void init();
|
void init();
|
||||||
|
void reset();
|
||||||
void free();
|
void free();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//Specification file for SCREENSHOT_DISPLAY class
|
//Specification file for SCREENSHOT_DISPLAY class
|
||||||
|
|
||||||
#define SCR_BMP_PHASE_MAX 12
|
#define SCR_BMP_PHASE_MAX 10
|
||||||
#define SCR_BMP_PHASE_ALPHA_MAX 10
|
#define SCR_BMP_PHASE_ALPHA_MAX 8
|
||||||
#define SCR_BMP_DX 7
|
#define SCR_BMP_DX 7
|
||||||
|
|
||||||
#define DISPLAY_UPDATE_TICK 40 // update at 25FPS
|
#define DISPLAY_UPDATE_TICK 40 // update at 25FPS
|
||||||
|
|
|
@ -157,6 +157,7 @@ void TASEDIT_LIST::init()
|
||||||
listItems = ListView_GetCountPerPage(hwndList);
|
listItems = ListView_GetCountPerPage(hwndList);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
reset();
|
||||||
}
|
}
|
||||||
void TASEDIT_LIST::free()
|
void TASEDIT_LIST::free()
|
||||||
{
|
{
|
||||||
|
@ -167,7 +168,11 @@ void TASEDIT_LIST::free()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
void TASEDIT_LIST::reset()
|
||||||
|
{
|
||||||
|
// scroll to the beginning
|
||||||
|
ListView_EnsureVisible(hwndList, 0, FALSE);
|
||||||
|
}
|
||||||
void TASEDIT_LIST::update()
|
void TASEDIT_LIST::update()
|
||||||
{
|
{
|
||||||
//update the number of items in the list
|
//update the number of items in the list
|
||||||
|
@ -181,6 +186,7 @@ void TASEDIT_LIST::update()
|
||||||
|
|
||||||
void TASEDIT_LIST::save(EMUFILE *os)
|
void TASEDIT_LIST::save(EMUFILE *os)
|
||||||
{
|
{
|
||||||
|
update();
|
||||||
// write "LIST" string
|
// write "LIST" string
|
||||||
os->fwrite(list_save_id, LIST_ID_LEN);
|
os->fwrite(list_save_id, LIST_ID_LEN);
|
||||||
// write current top item
|
// write current top item
|
||||||
|
@ -204,8 +210,6 @@ bool TASEDIT_LIST::load(EMUFILE *is)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
error:
|
error:
|
||||||
// scroll to the beginning
|
|
||||||
ListView_EnsureVisible(hwndList, 0, FALSE);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
@ -90,6 +90,7 @@ public:
|
||||||
TASEDIT_LIST();
|
TASEDIT_LIST();
|
||||||
void init();
|
void init();
|
||||||
void free();
|
void free();
|
||||||
|
void reset();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
void save(EMUFILE *os);
|
void save(EMUFILE *os);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
char selection_save_id[SELECTION_ID_LEN] = "SELECTION";
|
char selection_save_id[SELECTION_ID_LEN] = "SELECTION";
|
||||||
|
|
||||||
extern HWND hwndTasEdit;
|
extern HWND hwndTasEdit;
|
||||||
|
extern int TasEdit_undo_levels;
|
||||||
|
|
||||||
extern MARKERS markers;
|
extern MARKERS markers;
|
||||||
extern TASEDIT_LIST tasedit_list;
|
extern TASEDIT_LIST tasedit_list;
|
||||||
|
@ -23,7 +24,7 @@ TASEDIT_SELECTION::TASEDIT_SELECTION()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void TASEDIT_SELECTION::init(int new_size)
|
void TASEDIT_SELECTION::init()
|
||||||
{
|
{
|
||||||
hwndPrevMarker = GetDlgItem(hwndTasEdit, TASEDIT_PREV_MARKER);
|
hwndPrevMarker = GetDlgItem(hwndTasEdit, TASEDIT_PREV_MARKER);
|
||||||
hwndNextMarker = GetDlgItem(hwndTasEdit, TASEDIT_NEXT_MARKER);
|
hwndNextMarker = GetDlgItem(hwndTasEdit, TASEDIT_NEXT_MARKER);
|
||||||
|
@ -31,19 +32,9 @@ void TASEDIT_SELECTION::init(int new_size)
|
||||||
hwndFindNextMarker = GetDlgItem(hwndTasEdit, TASEDIT_FIND_NEXT_MARKER);
|
hwndFindNextMarker = GetDlgItem(hwndTasEdit, TASEDIT_FIND_NEXT_MARKER);
|
||||||
hwndTextSelection = GetDlgItem(hwndTasEdit, IDC_TEXT_SELECTION);
|
hwndTextSelection = GetDlgItem(hwndTasEdit, IDC_TEXT_SELECTION);
|
||||||
hwndTextClipboard = GetDlgItem(hwndTasEdit, IDC_TEXT_CLIPBOARD);
|
hwndTextClipboard = GetDlgItem(hwndTasEdit, IDC_TEXT_CLIPBOARD);
|
||||||
// init vars
|
|
||||||
if (new_size > 0)
|
|
||||||
history_size = new_size + 1;
|
|
||||||
// clear selections history
|
|
||||||
free();
|
|
||||||
selections_history.resize(history_size);
|
|
||||||
history_start_pos = 0;
|
|
||||||
history_cursor_pos = -1;
|
|
||||||
// create initial selection
|
|
||||||
AddNewSelectionToHistory();
|
|
||||||
track_selection_changes = true;
|
|
||||||
reset();
|
|
||||||
|
|
||||||
|
reset();
|
||||||
|
|
||||||
if (clipboard_selection.empty())
|
if (clipboard_selection.empty())
|
||||||
CheckClipboard();
|
CheckClipboard();
|
||||||
RedrawTextClipboard();
|
RedrawTextClipboard();
|
||||||
|
@ -56,12 +47,25 @@ void TASEDIT_SELECTION::free()
|
||||||
temp_selection.clear();
|
temp_selection.clear();
|
||||||
}
|
}
|
||||||
void TASEDIT_SELECTION::reset()
|
void TASEDIT_SELECTION::reset()
|
||||||
|
{
|
||||||
|
free();
|
||||||
|
// init vars
|
||||||
|
history_size = TasEdit_undo_levels + 1;
|
||||||
|
selections_history.resize(history_size);
|
||||||
|
history_start_pos = 0;
|
||||||
|
history_cursor_pos = -1;
|
||||||
|
// create initial selection
|
||||||
|
ClearSelection();
|
||||||
|
AddNewSelectionToHistory();
|
||||||
|
track_selection_changes = true;
|
||||||
|
reset_vars();
|
||||||
|
}
|
||||||
|
void TASEDIT_SELECTION::reset_vars()
|
||||||
{
|
{
|
||||||
old_prev_marker_button_state = prev_marker_button_state = false;
|
old_prev_marker_button_state = prev_marker_button_state = false;
|
||||||
old_next_marker_button_state = next_marker_button_state = false;
|
old_next_marker_button_state = next_marker_button_state = false;
|
||||||
must_redraw_text = true;
|
must_redraw_text = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TASEDIT_SELECTION::update()
|
void TASEDIT_SELECTION::update()
|
||||||
{
|
{
|
||||||
// keep selection within movie limits
|
// keep selection within movie limits
|
||||||
|
@ -271,7 +275,7 @@ bool TASEDIT_SELECTION::load(EMUFILE *is)
|
||||||
if (loadSelection(clipboard_selection, is)) goto error;
|
if (loadSelection(clipboard_selection, is)) goto error;
|
||||||
// all ok
|
// all ok
|
||||||
EnforceSelectionToList();
|
EnforceSelectionToList();
|
||||||
reset();
|
reset_vars();
|
||||||
return false;
|
return false;
|
||||||
error:
|
error:
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -6,9 +6,10 @@ class TASEDIT_SELECTION
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TASEDIT_SELECTION();
|
TASEDIT_SELECTION();
|
||||||
void init(int new_size = 0);
|
void init();
|
||||||
void free();
|
void free();
|
||||||
void reset();
|
void reset();
|
||||||
|
void reset_vars();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
void RedrawTextClipboard();
|
void RedrawTextClipboard();
|
||||||
|
|
|
@ -92,7 +92,7 @@ bool TASEDIT_PROJECT::LoadProject(std::string PFN)
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
FCEU_printf("Error loading markers\n");
|
FCEU_printf("Error loading markers\n");
|
||||||
markers.init();
|
markers.reset();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// try to load bookmarks
|
// try to load bookmarks
|
||||||
|
@ -101,7 +101,7 @@ bool TASEDIT_PROJECT::LoadProject(std::string PFN)
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
FCEU_printf("Error loading bookmarks\n");
|
FCEU_printf("Error loading bookmarks\n");
|
||||||
bookmarks.init();
|
bookmarks.reset();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// try to load greenzone
|
// try to load greenzone
|
||||||
|
@ -110,7 +110,7 @@ bool TASEDIT_PROJECT::LoadProject(std::string PFN)
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
FCEU_printf("Error loading greenzone\n");
|
FCEU_printf("Error loading greenzone\n");
|
||||||
greenzone.init();
|
greenzone.reset();
|
||||||
playback.StartFromZero(); // reset playback to frame 0
|
playback.StartFromZero(); // reset playback to frame 0
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
@ -120,7 +120,7 @@ bool TASEDIT_PROJECT::LoadProject(std::string PFN)
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
FCEU_printf("Error loading history\n");
|
FCEU_printf("Error loading history\n");
|
||||||
history.init();
|
history.reset();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// try to load selection
|
// try to load selection
|
||||||
|
@ -129,7 +129,7 @@ bool TASEDIT_PROJECT::LoadProject(std::string PFN)
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
FCEU_printf("Error loading selection\n");
|
FCEU_printf("Error loading selection\n");
|
||||||
selection.init();
|
selection.reset();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// update and try to load list
|
// update and try to load list
|
||||||
|
@ -138,6 +138,7 @@ bool TASEDIT_PROJECT::LoadProject(std::string PFN)
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
FCEU_printf("Error loading list\n");
|
FCEU_printf("Error loading list\n");
|
||||||
|
tasedit_list.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
playback.reset();
|
playback.reset();
|
||||||
|
|
|
@ -884,7 +884,7 @@ bool FCEUI_LoadMovie(const char *fname, bool _read_only, bool tasedit, int _paus
|
||||||
FCEUI_SetVidSystem(0);
|
FCEUI_SetVidSystem(0);
|
||||||
|
|
||||||
//force the input configuration stored in the movie to apply
|
//force the input configuration stored in the movie to apply
|
||||||
FCEUD_SetInput(currMovieData.fourscore,currMovieData.microphone,(ESI)currMovieData.ports[0],(ESI)currMovieData.ports[1],(ESIFC)currMovieData.ports[2]);
|
FCEUD_SetInput(currMovieData.fourscore, currMovieData.microphone, (ESI)currMovieData.ports[0], (ESI)currMovieData.ports[1], (ESIFC)currMovieData.ports[2]);
|
||||||
|
|
||||||
//stuff that should only happen when we're ready to positively commit to the replay
|
//stuff that should only happen when we're ready to positively commit to the replay
|
||||||
if(tasedit)
|
if(tasedit)
|
||||||
|
|
Loading…
Reference in New Issue