* Tasedit: refactoring

* fixed recording bug where "length" tag appeared in fm2s
* changed default mapping of Frame Advance to Tilde
* Config->Silent autosave
* Tasedit: Lua panel
* 5 new Lua functions: emu.paused(), taseditor.setplayback(int frame), taseditor.stopseeking(), taseditor.registerauto(), taseditor.registermanual()
This commit is contained in:
ansstuff 2012-01-08 18:19:49 +00:00
parent 0194d9b872
commit c6c04b577b
44 changed files with 2315 additions and 1850 deletions

View File

@ -48,7 +48,7 @@
#elif DOS #elif DOS
#define SCAN_GRAVE 0x29 #define SCAN_TILDE 0x29
#define SCAN_1 0x02 #define SCAN_1 0x02
#define SCAN_2 0x03 #define SCAN_2 0x03
#define SCAN_3 0x04 #define SCAN_3 0x04

View File

@ -38,6 +38,7 @@
#include "movieoptions.h" #include "movieoptions.h"
#include "ramwatch.h" #include "ramwatch.h"
#include "debugger.h" #include "debugger.h"
#include "taseditlib/taseditor_config.h"
#include "../../state.h" //adelikat: For bool backupSavestates #include "../../state.h" //adelikat: For bool backupSavestates
@ -69,42 +70,7 @@ extern bool oldInputDisplay;
extern bool fullSaveStateLoads; extern bool fullSaveStateLoads;
extern int frameSkipAmt; extern int frameSkipAmt;
extern bool TASEdit_follow_playback; extern TASEDITOR_CONFIG taseditor_config;
extern bool TASEdit_turbo_seek;
extern bool TASEdit_show_lag_frames;
extern bool TASEdit_show_markers;
extern bool TASEdit_show_branch_screenshots;
extern bool TASEdit_show_branch_tooltips;
extern bool TASEdit_bind_markers;
extern bool TASEdit_empty_marker_notes;
extern bool TASEdit_combine_consecutive_rec;
extern bool TASEdit_use_1p_rec;
extern bool TASEdit_columnset_by_keys;
extern bool TASEdit_keyboard_for_listview;
extern bool TASEdit_superimpose_affects_paste;
extern bool TASEdit_branch_full_movie;
extern bool TASEdit_branch_only_when_rec;
extern bool TASEdit_view_branches_tree;
extern bool TASEdit_branch_scr_hud;
extern bool TASEdit_restore_position;
extern int TASEdit_superimpose;
extern bool TASEdit_enable_hot_changes;
extern int TASEdit_greenzone_capacity;
extern int TasEdit_undo_levels;
extern int TASEdit_autosave_period;
extern bool TASEdit_jump_to_undo;
extern bool TASEdit_follow_note_context;
extern int TASEdit_last_export_type;
extern bool TASEdit_last_export_subtitles;
extern bool TASEdit_savecompact_binary;
extern bool TASEdit_savecompact_markers;
extern bool TASEdit_savecompact_bookmarks;
extern bool TASEdit_savecompact_greenzone;
extern bool TASEdit_savecompact_history;
extern bool TASEdit_savecompact_list;
extern bool TASEdit_savecompact_selection;
extern bool TASEdit_findnote_matchcase;
extern bool TASEdit_findnote_search_up;
extern char* recent_projects[]; extern char* recent_projects[];
//window positions and sizes: //window positions and sizes:
@ -122,8 +88,6 @@ extern int Monitor_wndx, Monitor_wndy;
extern int Tracer_wndx, Tracer_wndy; extern int Tracer_wndx, Tracer_wndy;
extern int CDLogger_wndx, CDLogger_wndy; extern int CDLogger_wndx, CDLogger_wndy;
extern int GGConv_wndx, GGConv_wndy; extern int GGConv_wndx, GGConv_wndy;
extern int TasEdit_wndx, TasEdit_wndy;
extern int FindNote_wndx, FindNote_wndy;
extern int MetaPosX,MetaPosY; extern int MetaPosX,MetaPosY;
extern int MLogPosX,MLogPosY; extern int MLogPosX,MLogPosY;
@ -319,10 +283,6 @@ static CFGSTRUCT fceuconfig[] = {
AC(CDLogger_wndy), AC(CDLogger_wndy),
AC(GGConv_wndx), AC(GGConv_wndx),
AC(GGConv_wndy), AC(GGConv_wndy),
AC(TasEdit_wndx),
AC(TasEdit_wndy),
AC(FindNote_wndx),
AC(FindNote_wndy),
AC(TextHookerPosX), AC(TextHookerPosX),
AC(TextHookerPosY), AC(TextHookerPosY),
AC(MetaPosX), AC(MetaPosX),
@ -337,42 +297,47 @@ static CFGSTRUCT fceuconfig[] = {
AC(AFoff), AC(AFoff),
AC(AutoFireOffset), AC(AutoFireOffset),
AC(DesynchAutoFire), AC(DesynchAutoFire),
AC(TASEdit_follow_playback), AC(taseditor_config.wndx),
AC(TASEdit_turbo_seek), AC(taseditor_config.wndy),
AC(TASEdit_show_lag_frames), AC(taseditor_config.findnote_wndx),
AC(TASEdit_show_markers), AC(taseditor_config.findnote_wndy),
AC(TASEdit_show_branch_screenshots), AC(taseditor_config.follow_playback),
AC(TASEdit_show_branch_tooltips), AC(taseditor_config.turbo_seek),
AC(TASEdit_bind_markers), AC(taseditor_config.show_lag_frames),
AC(TASEdit_empty_marker_notes), AC(taseditor_config.show_markers),
AC(TASEdit_combine_consecutive_rec), AC(taseditor_config.show_branch_screenshots),
AC(TASEdit_use_1p_rec), AC(taseditor_config.show_branch_tooltips),
AC(TASEdit_columnset_by_keys), AC(taseditor_config.bind_markers),
AC(TASEdit_keyboard_for_listview), AC(taseditor_config.empty_marker_notes),
AC(TASEdit_superimpose_affects_paste), AC(taseditor_config.combine_consecutive_rec),
AC(TASEdit_branch_full_movie), AC(taseditor_config.use_1p_rec),
AC(TASEdit_branch_only_when_rec), AC(taseditor_config.columnset_by_keys),
AC(TASEdit_view_branches_tree), AC(taseditor_config.keyboard_for_listview),
AC(TASEdit_branch_scr_hud), AC(taseditor_config.superimpose_affects_paste),
AC(TASEdit_restore_position), AC(taseditor_config.branch_full_movie),
AC(TASEdit_superimpose), AC(taseditor_config.branch_only_when_rec),
AC(TASEdit_enable_hot_changes), AC(taseditor_config.view_branches_tree),
AC(TASEdit_greenzone_capacity), AC(taseditor_config.branch_scr_hud),
AC(TasEdit_undo_levels), AC(taseditor_config.restore_position),
AC(TASEdit_autosave_period), AC(taseditor_config.superimpose),
AC(TASEdit_jump_to_undo), AC(taseditor_config.enable_auto_function),
AC(TASEdit_follow_note_context), AC(taseditor_config.enable_hot_changes),
AC(TASEdit_last_export_type), AC(taseditor_config.greenzone_capacity),
AC(TASEdit_last_export_subtitles), AC(taseditor_config.undo_levels),
AC(TASEdit_savecompact_binary), AC(taseditor_config.autosave_period),
AC(TASEdit_savecompact_markers), AC(taseditor_config.jump_to_undo),
AC(TASEdit_savecompact_bookmarks), AC(taseditor_config.follow_note_context),
AC(TASEdit_savecompact_greenzone), AC(taseditor_config.last_export_type),
AC(TASEdit_savecompact_history), AC(taseditor_config.last_export_subtitles),
AC(TASEdit_savecompact_list), AC(taseditor_config.savecompact_binary),
AC(TASEdit_savecompact_selection), AC(taseditor_config.savecompact_markers),
AC(TASEdit_findnote_matchcase), AC(taseditor_config.savecompact_bookmarks),
AC(TASEdit_findnote_search_up), AC(taseditor_config.savecompact_greenzone),
AC(taseditor_config.savecompact_history),
AC(taseditor_config.savecompact_list),
AC(taseditor_config.savecompact_selection),
AC(taseditor_config.findnote_matchcase),
AC(taseditor_config.findnote_search_up),
AC(lagCounterDisplay), AC(lagCounterDisplay),
AC(oldInputDisplay), AC(oldInputDisplay),
AC(movieSubtitles), AC(movieSubtitles),

View File

@ -543,7 +543,7 @@ ButtConfig fkbmap[0x48]=
MK(1),MK(2),MK(3),MK(4),MK(5),MK(6),MK(7),MK(8),MK(9),MK(0), MK(1),MK(2),MK(3),MK(4),MK(5),MK(6),MK(7),MK(8),MK(9),MK(0),
MK(MINUS),MK(EQUAL),MK(BACKSLASH),MK(BACKSPACE), MK(MINUS),MK(EQUAL),MK(BACKSLASH),MK(BACKSPACE),
MK(ESCAPE),MK(Q),MK(W),MK(E),MK(R),MK(T),MK(Y),MK(U),MK(I),MK(O), MK(ESCAPE),MK(Q),MK(W),MK(E),MK(R),MK(T),MK(Y),MK(U),MK(I),MK(O),
MK(P),MK(GRAVE),MK(BRACKET_LEFT),MK(ENTER), MK(P),MK(TILDE),MK(BRACKET_LEFT),MK(ENTER),
MK(LEFTCONTROL),MK(A),MK(S),MK(D),MK(F),MK(G),MK(H),MK(J),MK(K), MK(LEFTCONTROL),MK(A),MK(S),MK(D),MK(F),MK(G),MK(H),MK(J),MK(K),
MK(L),MK(SEMICOLON),MK(APOSTROPHE),MK(BRACKET_RIGHT),MK(INSERT), MK(L),MK(SEMICOLON),MK(APOSTROPHE),MK(BRACKET_RIGHT),MK(INSERT),
MK(LEFTSHIFT),MK(Z),MK(X),MK(C),MK(V),MK(B),MK(N),MK(M),MK(COMMA), MK(LEFTSHIFT),MK(Z),MK(X),MK(C),MK(V),MK(B),MK(N),MK(M),MK(COMMA),

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define SCAN_GRAVE 0x29 #define SCAN_TILDE 0x29
#define SCAN_1 0x02 #define SCAN_1 0x02
#define SCAN_2 0x03 #define SCAN_2 0x03
#define SCAN_3 0x04 #define SCAN_3 0x04

View File

@ -70,6 +70,7 @@
#include "video.h" #include "video.h"
#include "utils/xstring.h" #include "utils/xstring.h"
#include <string.h> #include <string.h>
#include "taseditlib/taseditor_window.h"
//--------------------------- //---------------------------
//mbg merge 6/29/06 - new aboutbox //mbg merge 6/29/06 - new aboutbox
@ -307,8 +308,8 @@ int BlockingCheck()
{ {
//other accelerator capable dialogs could be added here //other accelerator capable dialogs could be added here
extern HWND hwndMemWatch; extern HWND hwndMemWatch;
extern HWND hwndTasEdit; extern TASEDITOR_WINDOW taseditor_window;
extern HWND hwndFindNote;
int handled = 0; int handled = 0;
if(hCheat) if(hCheat)
@ -337,15 +338,15 @@ int BlockingCheck()
if(!handled && hwndTasEdit) if(!handled && taseditor_window.hwndTasEditor)
{ {
if(IsChild(hwndTasEdit, msg.hwnd)) if(IsChild(taseditor_window.hwndTasEditor, msg.hwnd))
handled = TranslateAccelerator(hwndTasEdit,fceu_hAccel,&msg); handled = TranslateAccelerator(taseditor_window.hwndTasEditor, fceu_hAccel, &msg);
} }
if(!handled && hwndFindNote) if(!handled && taseditor_window.hwndFindNote)
{ {
if(IsChild(hwndFindNote, msg.hwnd)) if(IsChild(taseditor_window.hwndFindNote, msg.hwnd))
handled = IsDialogMessage(hwndFindNote, &msg); handled = IsDialogMessage(taseditor_window.hwndFindNote, &msg);
} }
/* //adelikat - Currently no accel keys are used in the main window. Uncomment this block to activate them. /* //adelikat - Currently no accel keys are used in the main window. Uncomment this block to activate them.
if(!handled) if(!handled)

View File

@ -24,7 +24,7 @@ static struct
{ {
{ EMUCMD_RESET, SCAN_R | CMD_KEY_CTRL, }, { EMUCMD_RESET, SCAN_R | CMD_KEY_CTRL, },
{ EMUCMD_PAUSE, SCAN_PAUSE, }, { EMUCMD_PAUSE, SCAN_PAUSE, },
{ EMUCMD_FRAME_ADVANCE, SCAN_BACKSLASH, }, { EMUCMD_FRAME_ADVANCE, SCAN_TILDE, },
{ EMUCMD_SCREENSHOT, SCAN_F12, }, { EMUCMD_SCREENSHOT, SCAN_F12, },
{ EMUCMD_HIDE_MENU_TOGGLE, SCAN_ESCAPE }, { EMUCMD_HIDE_MENU_TOGGLE, SCAN_ESCAPE },
{ EMUCMD_SPEED_SLOWER, SCAN_MINUS, }, { EMUCMD_SPEED_SLOWER, SCAN_MINUS, },
@ -73,7 +73,7 @@ static struct
{ EMUCMD_RELOAD, SCAN_F1 | CMD_KEY_CTRL , }, { EMUCMD_RELOAD, SCAN_F1 | CMD_KEY_CTRL , },
{ EMUCMD_MISC_UNDOREDOSAVESTATE, SCAN_Z | CMD_KEY_CTRL, }, { EMUCMD_MISC_UNDOREDOSAVESTATE, SCAN_Z | CMD_KEY_CTRL, },
{ EMUCMD_MISC_TOGGLEFULLSCREEN, SCAN_ENTER | CMD_KEY_ALT, }, { EMUCMD_MISC_TOGGLEFULLSCREEN, SCAN_ENTER | CMD_KEY_ALT, },
{ EMUCMD_TASEDIT_REWIND, SCAN_GRAVE, }, { EMUCMD_TASEDIT_REWIND, SCAN_ESCAPE, },
{ EMUCMD_RERECORD_DISPLAY_TOGGLE, SCAN_M, }, { EMUCMD_RERECORD_DISPLAY_TOGGLE, SCAN_M, },
}; };

View File

@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
// Icon with lowest ID value placed first to ensure application icon // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems. // remains consistent on all systems.
IDI_ICON3 ICON "res\\tasedit-icon.ico" IDI_ICON3 ICON "res\\taseditor-icon.ico"
IDI_ICON4 ICON "res\\tasedit-icon32.ico" IDI_ICON4 ICON "res\\taseditor-icon32.ico"
ICON_1 ICON "res/ICON_1.ico" ICON_1 ICON "res/ICON_1.ico"
ICON_2 ICON "res/ICON_2.ico" ICON_2 ICON "res/ICON_2.ico"
@ -240,7 +240,7 @@ BEGIN
MENUITEM "Selection Redo\tCtrl+W", ID_EDIT_SELECTIONREDO MENUITEM "Selection Redo\tCtrl+W", ID_EDIT_SELECTIONREDO
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Select &All", ID_EDIT_SELECTALL MENUITEM "Select &All", ID_EDIT_SELECTALL
MENUITEM "Select mid &Markers\tCtrl+A", ID_EDIT_SELECTMIDMARKERS MENUITEM "Select between &Markers\tCtrl+A", ID_EDIT_SELECTMIDMARKERS
MENUITEM "Reselect Clipboard\tCtrl+B", ID_EDIT_RESELECTCLIPBOARD MENUITEM "Reselect Clipboard\tCtrl+B", ID_EDIT_RESELECTCLIPBOARD
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "&Copy\tCtrl+C", ID_TASEDIT_COPY MENUITEM "&Copy\tCtrl+C", ID_TASEDIT_COPY
@ -284,13 +284,14 @@ BEGIN
MENUITEM "&Empty new Marker Notes", ID_CONFIG_EMPTYNEWMARKERNOTES MENUITEM "&Empty new Marker Notes", ID_CONFIG_EMPTYNEWMARKERNOTES
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "&Combine consecutive Recordings", ID_CONFIG_COMBINECONSECUTIVERECORDINGS MENUITEM "&Combine consecutive Recordings", ID_CONFIG_COMBINECONSECUTIVERECORDINGS
MENUITEM "&Use 1P keys for all single Recordings", ID_CONFIG_USE1PFORRECORDING MENUITEM "Use 1&P keys for all single Recordings", ID_CONFIG_USE1PFORRECORDING
MENUITEM "Use &Input keys for ColumnSet", ID_CONFIG_USEINPUTKEYSFORCOLUMNSET MENUITEM "Use &Input keys for ColumnSet", ID_CONFIG_USEINPUTKEYSFORCOLUMNSET
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Allow &keyboard controls in Listview", ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW MENUITEM "Allow &keyboard controls in Listview", ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW
MENUITEM "&Superimpose affects copy/paste", ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE MENUITEM "&Superimpose affects copy/paste", ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Mute &Turbo", ID_CONFIG_MUTETURBO MENUITEM "Mute &Turbo", ID_CONFIG_MUTETURBO
MENUITEM "Silent autosave", ID_CONFIG_SILENTAUTOSAVE
END END
POPUP "&Help" POPUP "&Help"
BEGIN BEGIN
@ -1385,46 +1386,49 @@ CAPTION "TAS Editor"
MENU TASEDITMENU MENU TASEDITMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
CONTROL "",IDC_PROGRESS_BUTTON,"Button",BS_OWNERDRAW,314,37,116,12
CONTROL "",IDC_BRANCHES_BUTTON,"Button",BS_OWNERDRAW,320,168,104,11
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER,6,15,299,362 CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER,6,15,299,362
GROUPBOX " Playback ",IDC_STATIC,310,1,123,62,BS_CENTER,WS_EX_RIGHT GROUPBOX " Playback ",IDC_STATIC,310,1,123,62,BS_CENTER,WS_EX_RIGHT
GROUPBOX " Recorder ",IDC_STATIC,310,64,123,46,BS_CENTER,WS_EX_RIGHT
GROUPBOX " Splicer ",IDC_STATIC,310,111,123,30,BS_CENTER,WS_EX_RIGHT
GROUPBOX " Bookmarks ",IDC_BOOKMARKS_BOX,310,170,123,103,BS_CENTER,WS_EX_RIGHT
GROUPBOX " Lua ",IDC_STATIC,310,142,123,26,BS_CENTER,WS_EX_RIGHT
GROUPBOX " History ",IDC_STATIC,310,273,123,99,BS_CENTER,WS_EX_RIGHT
PUSHBUTTON "<<",TASEDIT_REWIND_FULL,314,10,23,14,NOT WS_TABSTOP PUSHBUTTON "<<",TASEDIT_REWIND_FULL,314,10,23,14,NOT WS_TABSTOP
PUSHBUTTON "<",TASEDIT_REWIND,337,10,23,14,NOT WS_TABSTOP PUSHBUTTON "<",TASEDIT_REWIND,337,10,23,14,NOT WS_TABSTOP
PUSHBUTTON "||",TASEDIT_PLAYSTOP,360,10,23,14,NOT WS_TABSTOP PUSHBUTTON "||",TASEDIT_PLAYSTOP,360,10,23,14,NOT WS_TABSTOP
PUSHBUTTON ">",TASEDIT_FORWARD,383,10,23,14,NOT WS_TABSTOP PUSHBUTTON ">",TASEDIT_FORWARD,383,10,23,14,NOT WS_TABSTOP
PUSHBUTTON ">>",TASEDIT_FORWARD_FULL,406,10,23,14,NOT WS_TABSTOP PUSHBUTTON ">>",TASEDIT_FORWARD_FULL,406,10,23,14,NOT WS_TABSTOP
CONTROL "",IDC_PROGRESS_BUTTON,"Button",BS_OWNERDRAW,314,37,116,12
CONTROL "",IDC_BRANCHES_BUTTON,"Button",BS_OWNERDRAW,320,149,104,11
CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,314,40,115,6 CONTROL "",IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,314,40,115,6
CONTROL " Follow cursor",CHECK_FOLLOW_CURSOR,"Button",BS_AUTOCHECKBOX,316,26,56,12 CONTROL " Follow cursor",CHECK_FOLLOW_CURSOR,"Button",BS_AUTOCHECKBOX,316,26,56,12
CONTROL " Auto-restore last position",CHECK_AUTORESTORE_PLAYBACK, CONTROL " Auto-restore last position",CHECK_AUTORESTORE_PLAYBACK,
"Button",BS_AUTOCHECKBOX,316,49,105,12 "Button",BS_AUTOCHECKBOX,316,49,105,12
GROUPBOX " Recorder ",IDC_STATIC,310,64,123,48,BS_CENTER,WS_EX_RIGHT CONTROL "",IDC_BOOKMARKSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSCROLL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | NOT WS_VISIBLE | WS_BORDER,315,179,113,89
GROUPBOX " Splicer ",IDC_STATIC,310,113,123,35,BS_CENTER,WS_EX_RIGHT CONTROL "",IDC_HISTORYLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOLABELWRAP | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER,315,283,113,85
GROUPBOX " Bookmarks ",IDC_BOOKMARKS_BOX,310,150,123,103,BS_CENTER,WS_EX_RIGHT CONTROL " All",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,316,85,27,10
CONTROL "",IDC_BOOKMARKSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSCROLL | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | NOT WS_VISIBLE | WS_BORDER,315,160,113,89 CONTROL " 1P",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,372,85,25,10
CONTROL "",IDC_HISTORYLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOLABELWRAP | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER,315,265,113,102 CONTROL " 2P",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,402,85,24,10
CONTROL " All",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,316,86,27,10 CONTROL " 3P",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,372,97,25,10
CONTROL " 1P",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,372,86,25,10 CONTROL " 4P",IDC_RADIO6,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,402,97,24,10
CONTROL " 2P",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,402,86,24,10 CONTROL " Superimpose",IDC_SUPERIMPOSE,"Button",BS_AUTO3STATE,372,73,55,10
CONTROL " 3P",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,372,98,25,10
CONTROL " 4P",IDC_RADIO6,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,402,98,24,10
CONTROL " Superimpose",IDC_SUPERIMPOSE,"Button",BS_AUTO3STATE,372,74,55,10
GROUPBOX " History ",IDC_STATIC,310,255,123,116,BS_CENTER,WS_EX_RIGHT
PUSHBUTTON "<<",TASEDIT_PREV_MARKER,315,376,23,14,NOT WS_TABSTOP PUSHBUTTON "<<",TASEDIT_PREV_MARKER,315,376,23,14,NOT WS_TABSTOP
PUSHBUTTON "Similar",TASEDIT_FIND_BEST_SIMILAR_MARKER,338,376,34,14,NOT WS_TABSTOP PUSHBUTTON "Similar",TASEDIT_FIND_BEST_SIMILAR_MARKER,338,376,34,14,NOT WS_TABSTOP
PUSHBUTTON "More",TASEDIT_FIND_NEXT_SIMILAR_MARKER,372,376,34,14,NOT WS_TABSTOP PUSHBUTTON "More",TASEDIT_FIND_NEXT_SIMILAR_MARKER,372,376,34,14,NOT WS_TABSTOP
PUSHBUTTON ">>",TASEDIT_NEXT_MARKER,405,376,23,14,NOT WS_TABSTOP PUSHBUTTON ">>",TASEDIT_NEXT_MARKER,405,376,23,14,NOT WS_TABSTOP
CONTROL "",IDC_JUMP_PLAYBACK_BUTTON,"Button",BS_OWNERDRAW,5,1,59,13 CONTROL "",IDC_JUMP_PLAYBACK_BUTTON,"Button",BS_OWNERDRAW,5,1,59,13
EDITTEXT IDC_PLAYBACK_MARKER_EDIT,65,1,240,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP EDITTEXT IDC_PLAYBACK_MARKER_EDIT,65,1,240,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP
RTEXT "Marker 0",IDC_PLAYBACK_MARKER,3,3,60,10,0,WS_EX_RIGHT RTEXT "Marker 0",IDC_PLAYBACK_MARKER,4,3,58,10,0,WS_EX_RIGHT
CONTROL "",IDC_JUMP_SELECTION_BUTTON,"Button",BS_OWNERDRAW,5,377,59,13 CONTROL "",IDC_JUMP_SELECTION_BUTTON,"Button",BS_OWNERDRAW,5,377,59,13
EDITTEXT IDC_SELECTION_MARKER_EDIT,65,377,240,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP EDITTEXT IDC_SELECTION_MARKER_EDIT,65,377,240,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP
RTEXT "Marker 99999",IDC_SELECTION_MARKER,3,379,60,10,0,WS_EX_RIGHT RTEXT "Marker 99999",IDC_SELECTION_MARKER,4,379,58,10,0,WS_EX_RIGHT
CONTROL "",IDC_BRANCHES_BITMAP,"Static",SS_OWNERDRAW | SS_NOTIFY | SS_REALSIZEIMAGE | NOT WS_VISIBLE,315,160,113,89 CONTROL "",IDC_BRANCHES_BITMAP,"Static",SS_OWNERDRAW | SS_NOTIFY | SS_REALSIZEIMAGE | NOT WS_VISIBLE,315,179,113,89
CONTROL " Turbo seek",CHECK_TURBO_SEEK,"Button",BS_AUTOCHECKBOX,379,26,50,12 CONTROL " Turbo seek",CHECK_TURBO_SEEK,"Button",BS_AUTOCHECKBOX,379,26,50,12
LTEXT "Selection: 0 rows, 16 columns",IDC_TEXT_SELECTION,316,123,114,10 LTEXT "Selection: 0 rows, 16 columns",IDC_TEXT_SELECTION,316,119,114,10
LTEXT "Clipboard: 0 rows, 16 columns",IDC_TEXT_CLIPBOARD,316,134,114,10 LTEXT "Clipboard: 0 rows, 16 columns",IDC_TEXT_CLIPBOARD,315,129,114,10
CONTROL " Recording",IDC_RECORDING,"Button",BS_AUTO3STATE,316,74,49,10 CONTROL " Recording",IDC_RECORDING,"Button",BS_AUTO3STATE,316,73,49,10
PUSHBUTTON "Run function",TASEDIT_RUN_MANUAL,315,151,54,14,NOT WS_TABSTOP
CONTROL "Auto function",IDC_RUN_AUTO,"Button",BS_AUTO3STATE,375,153,55,10
END END
IDD_TASEDIT_ABOUT DIALOGEX 0, 0, 208, 70 IDD_TASEDIT_ABOUT DIALOGEX 0, 0, 208, 70

View File

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 894 B

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -439,6 +439,8 @@
#define IDC_EDIT2 1154 #define IDC_EDIT2 1154
#define IDC_PLAYBACK_MARKER_EDIT 1154 #define IDC_PLAYBACK_MARKER_EDIT 1154
#define IDC_JUMP_SELECTION_BUTTON 1155 #define IDC_JUMP_SELECTION_BUTTON 1155
#define TASEDIT_PREV_MARKER2 1156
#define TASEDIT_RUN_MANUAL 1156
#define CHECK_SOUND_MUTETURBO 1179 #define CHECK_SOUND_MUTETURBO 1179
#define IDC_EDIT_AUTHOR 1180 #define IDC_EDIT_AUTHOR 1180
#define MEMW_STATIC 1181 #define MEMW_STATIC 1181
@ -486,6 +488,8 @@
#define IDC_RAMLIST 1205 #define IDC_RAMLIST 1205
#define IDC_CHECK4 1205 #define IDC_CHECK4 1205
#define IDC_CHECK_BOOKMARKS 1205 #define IDC_CHECK_BOOKMARKS 1205
#define IDC_SUPERIMPOSE2 1205
#define IDC_RUN_AUTO 1205
#define IDC_C_SEARCH 1206 #define IDC_C_SEARCH 1206
#define IDC_CHECK5 1206 #define IDC_CHECK5 1206
#define IDC_CHECK_GREENZONE 1206 #define IDC_CHECK_GREENZONE 1206
@ -965,6 +969,7 @@
#define ID_EDIT_FINDNOTE 40513 #define ID_EDIT_FINDNOTE 40513
#define ID_CONFIG_REAPPEARINGFINDNOTEDIALOG 40514 #define ID_CONFIG_REAPPEARINGFINDNOTEDIALOG 40514
#define ID_VIEW_FINDNOTE 40515 #define ID_VIEW_FINDNOTE 40515
#define ID_CONFIG_SILENTAUTOSAVE 40516
#define IDC_DEBUGGER_ICONTRAY 55535 #define IDC_DEBUGGER_ICONTRAY 55535
#define MW_ValueLabel2 65423 #define MW_ValueLabel2 65423
#define MW_ValueLabel1 65426 #define MW_ValueLabel1 65426
@ -974,7 +979,7 @@
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 202 #define _APS_NEXT_RESOURCE_VALUE 202
#define _APS_NEXT_COMMAND_VALUE 40516 #define _APS_NEXT_COMMAND_VALUE 40517
#define _APS_NEXT_CONTROL_VALUE 1275 #define _APS_NEXT_CONTROL_VALUE 1275
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +1,16 @@
#define GREENZONE_CAPACITY_MIN 1
#define GREENZONE_CAPACITY_MAX 50000
#define GREENZONE_CAPACITY_DEFAULT 10000
#define UNDO_LEVELS_MIN 1
#define UNDO_LEVELS_MAX 999
#define UNDO_LEVELS_DEFAULT 99
#define AUTOSAVE_PERIOD_MIN 0 // 0 = no autosave
#define AUTOSAVE_PERIOD_MAX 60 // 1 hour
#define AUTOSAVE_PERIOD_DEFAULT 10 // in minutes
#define EXPORT_TYPE_1P 0
#define EXPORT_TYPE_2P 1
#define EXPORT_TYPE_FOURSCORE 2
#define MARKER_NOTE_EDIT_NONE 0 #define MARKER_NOTE_EDIT_NONE 0
#define MARKER_NOTE_EDIT_UPPER 1 #define MARKER_NOTE_EDIT_UPPER 1
#define MARKER_NOTE_EDIT_LOWER 2 #define MARKER_NOTE_EDIT_LOWER 2
enum ECONTEXTMENU void SingleClick(LPNMITEMACTIVATE info);
{ void DoubleClick(LPNMITEMACTIVATE info);
CONTEXTMENU_STRAY = 0,
CONTEXTMENU_SELECTED = 1,
};
bool EnterTasEdit(); bool EnterTasEdit();
void InitDialog(); void InitDialog();
bool ExitTasEdit(); bool ExitTasEdit();
void UpdateTasEdit(); void UpdateTasEdit();
void RedrawTasedit();
void RedrawWindowCaption();
void ToggleJoypadBit(int column_index, int row_index, UINT KeyFlags); void ToggleJoypadBit(int column_index, int row_index, UINT KeyFlags);
void OpenProject(); void OpenProject();
bool LoadProject(char* fullname); bool LoadProject(char* fullname);
void LoadRecentProject(int slot);
bool SaveProject(); bool SaveProject();
bool SaveProjectAs(); bool SaveProjectAs();
void SaveCompact(); void SaveCompact();
@ -59,6 +36,3 @@ void ClearTaseditInput();
void UpdateMarkerNote(); void UpdateMarkerNote();
void UpdateRecentProjectsMenu();
void UpdateRecentProjectsArray(const char* addString);
void RemoveRecentProject(unsigned int which);

View File

@ -1,14 +1,11 @@
//Implementation file of Bookmark class //Implementation file of Bookmark class
#include "taseditor_project.h"
#include "taseditproj.h"
#include "zlib.h" #include "zlib.h"
extern TASEDITOR_CONFIG taseditor_config;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern INPUT_HISTORY history; extern INPUT_HISTORY history;
extern bool TASEdit_branch_scr_hud;
extern bool TASEdit_enable_hot_changes;
extern uint8 *XBuf; extern uint8 *XBuf;
extern uint8 *XBackBuf; extern uint8 *XBackBuf;
@ -27,9 +24,9 @@ void BOOKMARK::init()
void BOOKMARK::set() void BOOKMARK::set()
{ {
// copy input and hotchanges // copy input and hotchanges
snapshot.init(currMovieData, TASEdit_enable_hot_changes); snapshot.init(currMovieData, taseditor_config.enable_hot_changes);
snapshot.jump_frame = currFrameCounter; snapshot.jump_frame = currFrameCounter;
if (TASEdit_enable_hot_changes) if (taseditor_config.enable_hot_changes)
snapshot.copyHotChanges(&history.GetCurrentSnapshot()); snapshot.copyHotChanges(&history.GetCurrentSnapshot());
// copy savestate // copy savestate
savestate = greenzone.savestates[currFrameCounter]; savestate = greenzone.savestates[currFrameCounter];
@ -37,7 +34,7 @@ void BOOKMARK::set()
uLongf comprlen = (SCREENSHOT_SIZE>>9)+12 + SCREENSHOT_SIZE; uLongf comprlen = (SCREENSHOT_SIZE>>9)+12 + SCREENSHOT_SIZE;
saved_screenshot.resize(comprlen); saved_screenshot.resize(comprlen);
// compress screenshot data // compress screenshot data
if (TASEdit_branch_scr_hud) if (taseditor_config.branch_scr_hud)
compress(&saved_screenshot[0], &comprlen, XBuf, SCREENSHOT_SIZE); compress(&saved_screenshot[0], &comprlen, XBuf, SCREENSHOT_SIZE);
else else
compress(&saved_screenshot[0], &comprlen, XBackBuf, SCREENSHOT_SIZE); compress(&saved_screenshot[0], &comprlen, XBackBuf, SCREENSHOT_SIZE);

View File

@ -1,32 +1,25 @@
//Implementation file of Bookmarks class //Implementation file of Bookmarks class
#include "taseditor_project.h"
#include "taseditproj.h"
#include "utils/xstring.h" #include "utils/xstring.h"
#include "zlib.h" #include "zlib.h"
#pragma comment(lib, "msimg32.lib") #pragma comment(lib, "msimg32.lib")
extern HWND hwndTasEdit;
LRESULT APIENTRY BookmarksListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY BookmarksListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT APIENTRY BranchesBitmapWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY BranchesBitmapWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
WNDPROC hwndBookmarksList_oldWndProc, hwndBranchesBitmap_oldWndProc; WNDPROC hwndBookmarksList_oldWndProc, hwndBranchesBitmap_oldWndProc;
extern SCREENSHOT_DISPLAY screenshot_display; extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
extern POPUP_DISPLAY popup_display;
extern PLAYBACK playback; extern PLAYBACK playback;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern TASEDIT_PROJECT project; extern TASEDITOR_PROJECT project;
extern INPUT_HISTORY history; extern INPUT_HISTORY history;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
extern MARKERS current_markers; extern MARKERS current_markers;
extern bool TASEdit_show_lag_frames;
extern bool TASEdit_bind_markers;
extern bool TASEdit_branch_full_movie;
extern bool TASEdit_branch_only_when_rec;
extern bool TASEdit_view_branches_tree;
extern void UpdateMarkerNote(); extern void UpdateMarkerNote();
// resources // resources
@ -59,16 +52,16 @@ BOOKMARKS::BOOKMARKS()
void BOOKMARKS::init() void BOOKMARKS::init()
{ {
free(); free();
hwndBookmarksList = GetDlgItem(hwndTasEdit, IDC_BOOKMARKSLIST); hwndBookmarksList = GetDlgItem(taseditor_window.hwndTasEditor, IDC_BOOKMARKSLIST);
hwndBookmarks = GetDlgItem(hwndTasEdit, IDC_BOOKMARKS_BOX); hwndBookmarks = GetDlgItem(taseditor_window.hwndTasEditor, IDC_BOOKMARKS_BOX);
hwndBranchesBitmap = GetDlgItem(hwndTasEdit, IDC_BRANCHES_BITMAP); hwndBranchesBitmap = GetDlgItem(taseditor_window.hwndTasEditor, IDC_BRANCHES_BITMAP);
// prepare bookmarks listview // prepare bookmarks listview
ListView_SetExtendedListViewStyleEx(hwndBookmarksList, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES); ListView_SetExtendedListViewStyleEx(hwndBookmarksList, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
// subclass the listview // subclass the listview
hwndBookmarksList_oldWndProc = (WNDPROC)SetWindowLong(hwndBookmarksList, GWL_WNDPROC, (LONG)BookmarksListWndProc); hwndBookmarksList_oldWndProc = (WNDPROC)SetWindowLong(hwndBookmarksList, GWL_WNDPROC, (LONG)BookmarksListWndProc);
// setup same images for the listview // setup same images for the listview
ListView_SetImageList(hwndBookmarksList, tasedit_list.himglist, LVSIL_SMALL); ListView_SetImageList(hwndBookmarksList, list.himglist, LVSIL_SMALL);
// setup columns // setup columns
LVCOLUMN lvc; LVCOLUMN lvc;
// icons column // icons column
@ -288,8 +281,8 @@ void BOOKMARKS::set(int slot)
bookmarks_array[slot].set(); bookmarks_array[slot].set();
// if this screenshot is currently shown - reinit and redraw it // if this screenshot is currently shown - reinit and redraw it
if (screenshot_display.screenshot_currently_shown == slot) if (popup_display.screenshot_currently_shown == slot)
screenshot_display.screenshot_currently_shown = ITEM_UNDER_MOUSE_NONE; popup_display.screenshot_currently_shown = ITEM_UNDER_MOUSE_NONE;
int parent; int parent;
// inherit current branch // inherit current branch
@ -384,7 +377,7 @@ void BOOKMARKS::set(int slot)
// switch current branch to this branch // switch current branch to this branch
if (slot != current_branch && current_branch >= 0) if (slot != current_branch && current_branch >= 0)
{ {
tasedit_list.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame); list.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame);
RedrawChangedBookmarks(bookmarks_array[current_branch].snapshot.jump_frame); RedrawChangedBookmarks(bookmarks_array[current_branch].snapshot.jump_frame);
} }
if (slot != current_branch || changes_since_current_branch) if (slot != current_branch || changes_since_current_branch)
@ -395,10 +388,10 @@ void BOOKMARKS::set(int slot)
if (previous_frame >= 0 && previous_frame != currFrameCounter) if (previous_frame >= 0 && previous_frame != currFrameCounter)
{ {
tasedit_list.RedrawRow(previous_frame); list.RedrawRow(previous_frame);
RedrawChangedBookmarks(previous_frame); RedrawChangedBookmarks(previous_frame);
} }
tasedit_list.RedrawRow(currFrameCounter); list.RedrawRow(currFrameCounter);
RedrawChangedBookmarks(currFrameCounter); RedrawChangedBookmarks(currFrameCounter);
FCEU_DispMessage("Branch %d saved.", 0, slot); FCEU_DispMessage("Branch %d saved.", 0, slot);
@ -412,14 +405,14 @@ void BOOKMARKS::jump(int slot)
int frame = bookmarks_array[slot].snapshot.jump_frame; int frame = bookmarks_array[slot].snapshot.jump_frame;
playback.jump(frame); playback.jump(frame);
if (playback.GetPauseFrame()) if (playback.GetPauseFrame())
tasedit_list.FollowPauseframe(); list.FollowPauseframe();
bookmarks_array[slot].jump(); bookmarks_array[slot].jump();
} }
} }
void BOOKMARKS::unleash(int slot) void BOOKMARKS::unleash(int slot)
{ {
if (TASEdit_branch_only_when_rec && movie_readonly) if (taseditor_config.branch_only_when_rec && movie_readonly)
{ {
jump(slot); jump(slot);
return; return;
@ -431,10 +424,10 @@ void BOOKMARKS::unleash(int slot)
bool markers_changed = false; bool markers_changed = false;
// revert current movie to the input_snapshot state // revert current movie to the input_snapshot state
if (TASEdit_branch_full_movie) if (taseditor_config.branch_full_movie)
{ {
// update Markers // update Markers
if (TASEdit_bind_markers) if (taseditor_config.bind_markers)
{ {
if (bookmarks_array[slot].snapshot.my_markers.checkMarkersDiff(current_markers)) if (bookmarks_array[slot].snapshot.my_markers.checkMarkersDiff(current_markers))
{ {
@ -449,7 +442,7 @@ void BOOKMARKS::unleash(int slot)
{ {
// restore entire movie // restore entire movie
bookmarks_array[slot].snapshot.toMovie(currMovieData, first_change); bookmarks_array[slot].snapshot.toMovie(currMovieData, first_change);
tasedit_list.update(); list.update();
selection.must_find_current_marker = playback.must_find_current_marker = true; selection.must_find_current_marker = playback.must_find_current_marker = true;
history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot); history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot);
greenzone.Invalidate(first_change); greenzone.Invalidate(first_change);
@ -458,7 +451,7 @@ void BOOKMARKS::unleash(int slot)
{ {
selection.must_find_current_marker = playback.must_find_current_marker = true; selection.must_find_current_marker = playback.must_find_current_marker = true;
history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot); history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot);
tasedit_list.RedrawList(); list.RedrawList();
bookmarks_array[slot].unleashed(); bookmarks_array[slot].unleashed();
} else } else
{ {
@ -468,7 +461,7 @@ void BOOKMARKS::unleash(int slot)
} else if (jump_frame > 0) } else if (jump_frame > 0)
{ {
// update Markers // update Markers
if (TASEdit_bind_markers) if (taseditor_config.bind_markers)
{ {
if (bookmarks_array[slot].snapshot.my_markers.checkMarkersDiff(current_markers, jump_frame)) if (bookmarks_array[slot].snapshot.my_markers.checkMarkersDiff(current_markers, jump_frame))
{ {
@ -484,7 +477,7 @@ void BOOKMARKS::unleash(int slot)
// restore movie up to and not including bookmarked frame (imitating old TASing method) // 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 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); bookmarks_array[slot].snapshot.toMovie(currMovieData, first_change, jump_frame-1);
tasedit_list.update(); list.update();
selection.must_find_current_marker = playback.must_find_current_marker = true; selection.must_find_current_marker = playback.must_find_current_marker = true;
history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot); history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot);
greenzone.Invalidate(first_change); greenzone.Invalidate(first_change);
@ -493,7 +486,7 @@ void BOOKMARKS::unleash(int slot)
{ {
selection.must_find_current_marker = playback.must_find_current_marker = true; selection.must_find_current_marker = playback.must_find_current_marker = true;
history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot); history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot);
tasedit_list.RedrawList(); list.RedrawList();
bookmarks_array[slot].unleashed(); bookmarks_array[slot].unleashed();
} else } else
{ {
@ -522,9 +515,9 @@ void BOOKMARKS::unleash(int slot)
// switch current branch to this branch // switch current branch to this branch
if (slot != current_branch && current_branch >= 0) if (slot != current_branch && current_branch >= 0)
{ {
tasedit_list.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame); list.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame);
RedrawChangedBookmarks(bookmarks_array[current_branch].snapshot.jump_frame); RedrawChangedBookmarks(bookmarks_array[current_branch].snapshot.jump_frame);
tasedit_list.RedrawRow(bookmarks_array[slot].snapshot.jump_frame); list.RedrawRow(bookmarks_array[slot].snapshot.jump_frame);
RedrawChangedBookmarks(bookmarks_array[slot].snapshot.jump_frame); RedrawChangedBookmarks(bookmarks_array[slot].snapshot.jump_frame);
} }
current_branch = slot; current_branch = slot;
@ -605,13 +598,13 @@ error:
void BOOKMARKS::RedrawBookmarksCaption() void BOOKMARKS::RedrawBookmarksCaption()
{ {
int prev_edit_mode = edit_mode; int prev_edit_mode = edit_mode;
if (TASEdit_branch_only_when_rec && movie_readonly) if (taseditor_config.branch_only_when_rec && movie_readonly)
{ {
edit_mode = EDIT_MODE_BOOKMARKS; edit_mode = EDIT_MODE_BOOKMARKS;
ShowWindow(hwndBranchesBitmap, SW_HIDE); ShowWindow(hwndBranchesBitmap, SW_HIDE);
ShowWindow(hwndBookmarksList, SW_SHOW); ShowWindow(hwndBookmarksList, SW_SHOW);
RedrawBookmarksList(); RedrawBookmarksList();
} else if (TASEdit_view_branches_tree) } else if (taseditor_config.view_branches_tree)
{ {
edit_mode = EDIT_MODE_BRANCHES; edit_mode = EDIT_MODE_BRANCHES;
ShowWindow(hwndBookmarksList, SW_HIDE); ShowWindow(hwndBookmarksList, SW_HIDE);
@ -937,12 +930,12 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
if (bookmarks_array[cell_y].flash_phase) if (bookmarks_array[cell_y].flash_phase)
msg->clrText = bookmark_flash_colors[bookmarks_array[cell_y].flash_type][bookmarks_array[cell_y].flash_phase]; msg->clrText = bookmark_flash_colors[bookmarks_array[cell_y].flash_type][bookmarks_array[cell_y].flash_phase];
if (cell_x == BOOKMARKS_COLUMN_FRAME || (TASEdit_branch_only_when_rec && movie_readonly && cell_x == BOOKMARKS_COLUMN_TIME)) if (cell_x == BOOKMARKS_COLUMN_FRAME || (taseditor_config.branch_only_when_rec && movie_readonly && cell_x == BOOKMARKS_COLUMN_TIME))
{ {
if (bookmarks_array[cell_y].not_empty) if (bookmarks_array[cell_y].not_empty)
{ {
// frame number // frame number
SelectObject(msg->nmcd.hdc, tasedit_list.hMainListFont); SelectObject(msg->nmcd.hdc, list.hMainListFont);
int frame = bookmarks_array[cell_y].snapshot.jump_frame; int frame = bookmarks_array[cell_y].snapshot.jump_frame;
if (frame == currFrameCounter || frame == (playback.GetPauseFrame() - 1)) if (frame == currFrameCounter || frame == (playback.GetPauseFrame() - 1))
{ {
@ -952,7 +945,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
{ {
if (!greenzone.savestates[frame].empty()) if (!greenzone.savestates[frame].empty())
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[frame]) if (taseditor_config.show_lag_frames && greenzone.lag_history[frame])
msg->clrTextBk = LAG_FRAMENUM_COLOR; msg->clrTextBk = LAG_FRAMENUM_COLOR;
else else
msg->clrTextBk = GREENZONE_FRAMENUM_COLOR; msg->clrTextBk = GREENZONE_FRAMENUM_COLOR;
@ -961,7 +954,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 & 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())) || (!greenzone.savestates[frame & EVERY2ND].empty() && !greenzone.savestates[(frame | 0x1) + 1].empty()))
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[frame]) if (taseditor_config.show_lag_frames && greenzone.lag_history[frame])
msg->clrTextBk = PALE_LAG_FRAMENUM_COLOR; msg->clrTextBk = PALE_LAG_FRAMENUM_COLOR;
else else
msg->clrTextBk = PALE_GREENZONE_FRAMENUM_COLOR; msg->clrTextBk = PALE_GREENZONE_FRAMENUM_COLOR;
@ -973,7 +966,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
if (bookmarks_array[cell_y].not_empty) if (bookmarks_array[cell_y].not_empty)
{ {
// frame number // frame number
SelectObject(msg->nmcd.hdc, tasedit_list.hMainListFont); SelectObject(msg->nmcd.hdc, list.hMainListFont);
int frame = bookmarks_array[cell_y].snapshot.jump_frame; int frame = bookmarks_array[cell_y].snapshot.jump_frame;
if (frame == currFrameCounter || frame == (playback.GetPauseFrame() - 1)) if (frame == currFrameCounter || frame == (playback.GetPauseFrame() - 1))
{ {
@ -983,7 +976,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
{ {
if (!greenzone.savestates[frame].empty()) if (!greenzone.savestates[frame].empty())
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[frame]) if (taseditor_config.show_lag_frames && greenzone.lag_history[frame])
msg->clrTextBk = LAG_INPUT_COLOR1; msg->clrTextBk = LAG_INPUT_COLOR1;
else else
msg->clrTextBk = GREENZONE_INPUT_COLOR1; msg->clrTextBk = GREENZONE_INPUT_COLOR1;
@ -992,7 +985,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 & 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())) || (!greenzone.savestates[frame & EVERY2ND].empty() && !greenzone.savestates[(frame | 0x1) + 1].empty()))
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[frame]) if (taseditor_config.show_lag_frames && greenzone.lag_history[frame])
msg->clrTextBk = PALE_LAG_INPUT_COLOR1; msg->clrTextBk = PALE_LAG_INPUT_COLOR1;
else else
msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR1; msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR1;
@ -1011,9 +1004,9 @@ void BOOKMARKS::LeftClick(LPNMITEMACTIVATE info)
int cell_y = info->iItem; int cell_y = info->iItem;
if (cell_y >= 0 && cell_x >= 0) if (cell_y >= 0 && cell_x >= 0)
{ {
if (cell_x <= BOOKMARKS_COLUMN_FRAME || (TASEdit_branch_only_when_rec && movie_readonly)) if (cell_x <= BOOKMARKS_COLUMN_FRAME || (taseditor_config.branch_only_when_rec && movie_readonly))
jump((cell_y + 1) % TOTAL_BOOKMARKS); jump((cell_y + 1) % TOTAL_BOOKMARKS);
else if (cell_x == BOOKMARKS_COLUMN_TIME && (!TASEdit_branch_only_when_rec || !movie_readonly)) else if (cell_x == BOOKMARKS_COLUMN_TIME && (!taseditor_config.branch_only_when_rec || !movie_readonly))
unleash((cell_y + 1) % TOTAL_BOOKMARKS); unleash((cell_y + 1) % TOTAL_BOOKMARKS);
} }
// remove selection // remove selection

View File

@ -1,16 +1,13 @@
//Implementation file of Greenzone class //Implementation file of Greenzone class
#include "taseditor_project.h"
#include "taseditproj.h"
#include "state.h" #include "state.h"
#include "zlib.h" #include "zlib.h"
extern TASEDIT_PROJECT project; extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_PROJECT project;
extern PLAYBACK playback; extern PLAYBACK playback;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
extern int TASEdit_greenzone_capacity;
extern bool TASEdit_restore_position;
char greenzone_save_id[GREENZONE_ID_LEN] = "GREENZONE"; char greenzone_save_id[GREENZONE_ID_LEN] = "GREENZONE";
char greenzone_skipsave_id[GREENZONE_ID_LEN] = "GREENZONX"; char greenzone_skipsave_id[GREENZONE_ID_LEN] = "GREENZONX";
@ -104,12 +101,12 @@ void GREENZONE::storeTasSavestate(int frame)
void GREENZONE::GreenzoneCleaning() void GREENZONE::GreenzoneCleaning()
{ {
int i = currFrameCounter - TASEdit_greenzone_capacity; int i = currFrameCounter - taseditor_config.greenzone_capacity;
bool changed = false; bool changed = false;
if (i < 0) goto finish; if (i < 0) goto finish;
int limit; int limit;
// 2x of 1/2 // 2x of 1/2
limit = i - 2 * TASEdit_greenzone_capacity; limit = i - 2 * taseditor_config.greenzone_capacity;
if (limit < -1) limit = -1; if (limit < -1) limit = -1;
for (; i > limit; i--) for (; i > limit; i--)
{ {
@ -121,7 +118,7 @@ void GREENZONE::GreenzoneCleaning()
} }
if (i < 0) goto finish; if (i < 0) goto finish;
// 4x of 1/4 // 4x of 1/4
limit = i - 4 * TASEdit_greenzone_capacity; limit = i - 4 * taseditor_config.greenzone_capacity;
if (limit < -1) limit = -1; if (limit < -1) limit = -1;
for (; i > limit; i--) for (; i > limit; i--)
{ {
@ -133,7 +130,7 @@ void GREENZONE::GreenzoneCleaning()
} }
if (i < 0) goto finish; if (i < 0) goto finish;
// 8x of 1/8 // 8x of 1/8
limit = i - 8 * TASEdit_greenzone_capacity; limit = i - 8 * taseditor_config.greenzone_capacity;
if (limit < -1) limit = -1; if (limit < -1) limit = -1;
for (; i > limit; i--) for (; i > limit; i--)
{ {
@ -145,7 +142,7 @@ void GREENZONE::GreenzoneCleaning()
} }
if (i < 0) goto finish; if (i < 0) goto finish;
// 16x of 1/16 // 16x of 1/16
limit = i - 16 * TASEdit_greenzone_capacity; limit = i - 16 * taseditor_config.greenzone_capacity;
if (limit < -1) limit = -1; if (limit < -1) limit = -1;
for (; i > limit; i--) for (; i > limit; i--)
{ {
@ -167,7 +164,7 @@ void GREENZONE::GreenzoneCleaning()
finish: finish:
if (changed) if (changed)
{ {
tasedit_list.RedrawList(); list.RedrawList();
bookmarks.RedrawBookmarksList(); bookmarks.RedrawBookmarksList();
} }
// shedule next cleaning // shedule next cleaning
@ -299,11 +296,11 @@ bool GREENZONE::load(EMUFILE *is)
if (read32le(&frame, is)) if (read32le(&frame, is))
{ {
currFrameCounter = frame; currFrameCounter = frame;
int greenzone_tail_frame = currFrameCounter - TASEdit_greenzone_capacity; int greenzone_tail_frame = currFrameCounter - taseditor_config.greenzone_capacity;
int greenzone_tail_frame2 = greenzone_tail_frame - 2 * TASEdit_greenzone_capacity; int greenzone_tail_frame2 = greenzone_tail_frame - 2 * taseditor_config.greenzone_capacity;
int greenzone_tail_frame4 = greenzone_tail_frame - 4 * TASEdit_greenzone_capacity; int greenzone_tail_frame4 = greenzone_tail_frame - 4 * taseditor_config.greenzone_capacity;
int greenzone_tail_frame8 = greenzone_tail_frame - 8 * TASEdit_greenzone_capacity; int greenzone_tail_frame8 = greenzone_tail_frame - 8 * taseditor_config.greenzone_capacity;
int greenzone_tail_frame16 = greenzone_tail_frame - 16 * TASEdit_greenzone_capacity; int greenzone_tail_frame16 = greenzone_tail_frame - 16 * taseditor_config.greenzone_capacity;
// read savestates // read savestates
while(1) while(1)
{ {
@ -383,7 +380,7 @@ void GREENZONE::InvalidateAndCheck(int after)
// either set playback cursor to the end of greenzone or run seeking to restore playback position // either set playback cursor to the end of greenzone or run seeking to restore playback position
if (currFrameCounter >= greenZoneCount) if (currFrameCounter >= greenZoneCount)
{ {
if (TASEdit_restore_position) if (taseditor_config.restore_position)
playback.restorePosition(); playback.restorePosition();
else else
playback.jump(greenZoneCount-1); playback.jump(greenZoneCount-1);
@ -391,7 +388,7 @@ void GREENZONE::InvalidateAndCheck(int after)
} }
} }
// redraw list even if greenzone didn't change // redraw list even if greenzone didn't change
tasedit_list.RedrawList(); list.RedrawList();
bookmarks.RedrawBookmarksList(); bookmarks.RedrawBookmarksList();
} }
// This version doesn't restore playback, may be used only by Branching and Recording functions! // This version doesn't restore playback, may be used only by Branching and Recording functions!
@ -407,7 +404,7 @@ void GREENZONE::Invalidate(int after)
} }
} }
// redraw list even if greenzone didn't change // redraw list even if greenzone didn't change
tasedit_list.RedrawList(); list.RedrawList();
bookmarks.RedrawBookmarksList(); bookmarks.RedrawBookmarksList();
} }

View File

@ -1,28 +1,22 @@
//Implementation file of Input History class (Undo feature) //Implementation file of Input History class (Undo feature)
#include "taseditor_project.h"
#include "taseditproj.h"
extern HWND hwndTasEdit;
extern bool TASEdit_bind_markers;
extern bool TASEdit_enable_hot_changes;
extern bool TASEdit_branch_full_movie;
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;
extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
extern MARKERS current_markers; extern MARKERS current_markers;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern PLAYBACK playback; extern PLAYBACK playback;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern TASEDIT_PROJECT project; extern TASEDITOR_PROJECT project;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
char history_save_id[HISTORY_ID_LEN] = "HISTORY"; char history_save_id[HISTORY_ID_LEN] = "HISTORY";
char history_skipsave_id[HISTORY_ID_LEN] = "HISTORX"; char history_skipsave_id[HISTORY_ID_LEN] = "HISTORX";
char modCaptions[40][20] = {" Init", char modCaptions[41][20] = {" Init",
" Change", " Change",
" Set", " Set",
" Unset", " Unset",
@ -61,7 +55,8 @@ char modCaptions[40][20] = {" Init",
" Marker Rename", " Marker Rename",
" LUA Marker Set", " LUA Marker Set",
" LUA Marker Unset", " LUA Marker Unset",
" LUA Marker Rename" }; " LUA Marker Rename",
" LUA Change" };
char joypadCaptions[4][5] = {"(1P)", "(2P)", "(3P)", "(4P)"}; char joypadCaptions[4][5] = {"(1P)", "(2P)", "(3P)", "(4P)"};
INPUT_HISTORY::INPUT_HISTORY() INPUT_HISTORY::INPUT_HISTORY()
@ -71,7 +66,7 @@ INPUT_HISTORY::INPUT_HISTORY()
void INPUT_HISTORY::init() void INPUT_HISTORY::init()
{ {
// prepare the history listview // prepare the history listview
hwndHistoryList = GetDlgItem(hwndTasEdit, IDC_HISTORYLIST); hwndHistoryList = GetDlgItem(taseditor_window.hwndTasEditor, IDC_HISTORYLIST);
ListView_SetExtendedListViewStyleEx(hwndHistoryList, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES); ListView_SetExtendedListViewStyleEx(hwndHistoryList, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
// subclass the listview // subclass the listview
hwndHistoryList_oldWndProc = (WNDPROC)SetWindowLong(hwndHistoryList, GWL_WNDPROC, (LONG)HistoryListWndProc); hwndHistoryList_oldWndProc = (WNDPROC)SetWindowLong(hwndHistoryList, GWL_WNDPROC, (LONG)HistoryListWndProc);
@ -80,8 +75,6 @@ void INPUT_HISTORY::init()
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() void INPUT_HISTORY::free()
{ {
@ -92,7 +85,7 @@ void INPUT_HISTORY::reset()
{ {
free(); free();
// init vars // init vars
history_size = TasEdit_undo_levels + 1; history_size = taseditor_config.undo_levels + 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;
input_snapshots.resize(history_size); input_snapshots.resize(history_size);
@ -100,7 +93,7 @@ void INPUT_HISTORY::reset()
history_cursor_pos = -1; history_cursor_pos = -1;
// create initial snapshot // create initial snapshot
INPUT_SNAPSHOT inp; INPUT_SNAPSHOT inp;
inp.init(currMovieData, TASEdit_enable_hot_changes); inp.init(currMovieData, taseditor_config.enable_hot_changes);
strcat(inp.description, modCaptions[0]); strcat(inp.description, modCaptions[0]);
inp.jump_frame = -1; inp.jump_frame = -1;
AddInputSnapshotToHistory(inp); AddInputSnapshotToHistory(inp);
@ -111,7 +104,7 @@ void INPUT_HISTORY::update()
{ {
// update undo_hint // update undo_hint
if (old_undo_hint_pos != undo_hint_pos && old_undo_hint_pos >= 0) if (old_undo_hint_pos != undo_hint_pos && old_undo_hint_pos >= 0)
tasedit_list.RedrawRow(old_undo_hint_pos); // not changing bookmarks list list.RedrawRow(old_undo_hint_pos); // not changing bookmarks list
old_undo_hint_pos = undo_hint_pos; old_undo_hint_pos = undo_hint_pos;
old_show_undo_hint = show_undo_hint; old_show_undo_hint = show_undo_hint;
show_undo_hint = false; show_undo_hint = false;
@ -123,7 +116,7 @@ void INPUT_HISTORY::update()
undo_hint_pos = -1; // finished hinting undo_hint_pos = -1; // finished hinting
} }
if (old_show_undo_hint != show_undo_hint) if (old_show_undo_hint != show_undo_hint)
tasedit_list.RedrawRow(undo_hint_pos); // not changing bookmarks list list.RedrawRow(undo_hint_pos); // not changing bookmarks list
@ -152,7 +145,7 @@ int INPUT_HISTORY::jump(int new_pos)
// update markers // update markers
bool markers_changed = false; bool markers_changed = false;
if (TASEdit_bind_markers) if (taseditor_config.bind_markers)
{ {
if (input_snapshots[real_pos].my_markers.checkMarkersDiff(current_markers)) if (input_snapshots[real_pos].my_markers.checkMarkersDiff(current_markers))
{ {
@ -175,12 +168,12 @@ int INPUT_HISTORY::jump(int new_pos)
current_markers.update(); current_markers.update();
selection.must_find_current_marker = playback.must_find_current_marker = true; selection.must_find_current_marker = playback.must_find_current_marker = true;
bookmarks.ChangesMadeSinceBranch(); bookmarks.ChangesMadeSinceBranch();
tasedit_list.RedrawList(); list.RedrawList();
tasedit_list.FollowUndo(); list.FollowUndo();
} else if (TASEdit_enable_hot_changes) } else if (taseditor_config.enable_hot_changes)
{ {
// when using Hot Changes, list should be always redrawn, because old changes become less hot // when using Hot Changes, list should be always redrawn, because old changes become less hot
tasedit_list.RedrawList(); list.RedrawList();
} }
return first_change; return first_change;
@ -243,7 +236,7 @@ int INPUT_HISTORY::RegisterChanges(int mod_type, int start, int end)
{ {
// create new input shanshot // create new input shanshot
INPUT_SNAPSHOT inp; INPUT_SNAPSHOT inp;
inp.init(currMovieData, TASEdit_enable_hot_changes); inp.init(currMovieData, taseditor_config.enable_hot_changes);
inp.mod_type = mod_type; inp.mod_type = mod_type;
// check if there are input differences from latest snapshot // check if there are input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size; int real_pos = (history_start_pos + history_cursor_pos) % history_size;
@ -288,7 +281,7 @@ int INPUT_HISTORY::RegisterChanges(int mod_type, int start, int end)
strcat(inp.description, framenum); strcat(inp.description, framenum);
} }
// set hotchanges // set hotchanges
if (TASEdit_enable_hot_changes) if (taseditor_config.enable_hot_changes)
{ {
// inherit previous hotchanges and set new changes // inherit previous hotchanges and set new changes
switch (mod_type) switch (mod_type)
@ -327,7 +320,7 @@ void INPUT_HISTORY::RegisterMarkersChange(int mod_type, int start, int end)
{ {
// create new input shanshot // create new input shanshot
INPUT_SNAPSHOT inp; INPUT_SNAPSHOT inp;
inp.init(currMovieData, TASEdit_enable_hot_changes); inp.init(currMovieData, taseditor_config.enable_hot_changes);
inp.mod_type = mod_type; inp.mod_type = mod_type;
// fill description: // fill description:
strcat(inp.description, modCaptions[mod_type]); strcat(inp.description, modCaptions[mod_type]);
@ -343,7 +336,7 @@ void INPUT_HISTORY::RegisterMarkersChange(int mod_type, int start, int end)
strcat(inp.description, "-"); strcat(inp.description, "-");
strcat(inp.description, framenum); strcat(inp.description, framenum);
} }
if (TASEdit_enable_hot_changes) if (taseditor_config.enable_hot_changes)
inp.copyHotChanges(&GetCurrentSnapshot()); inp.copyHotChanges(&GetCurrentSnapshot());
AddInputSnapshotToHistory(inp); AddInputSnapshotToHistory(inp);
bookmarks.ChangesMadeSinceBranch(); bookmarks.ChangesMadeSinceBranch();
@ -353,19 +346,19 @@ void INPUT_HISTORY::RegisterBranching(int mod_type, int first_change, int slot)
{ {
// create new input snapshot // create new input snapshot
INPUT_SNAPSHOT inp; INPUT_SNAPSHOT inp;
inp.init(currMovieData, TASEdit_enable_hot_changes); inp.init(currMovieData, taseditor_config.enable_hot_changes);
// fill description: modification type + time of the Branch // fill description: modification type + time of the Branch
inp.mod_type = mod_type; inp.mod_type = mod_type;
strcat(inp.description, modCaptions[mod_type]); strcat(inp.description, modCaptions[mod_type]);
strcat(inp.description, bookmarks.bookmarks_array[slot].snapshot.description); strcat(inp.description, bookmarks.bookmarks_array[slot].snapshot.description);
inp.jump_frame = first_change; inp.jump_frame = first_change;
if (TASEdit_enable_hot_changes) if (taseditor_config.enable_hot_changes)
{ {
if (mod_type < MODTYPE_BRANCH_MARKERS_0) if (mod_type < MODTYPE_BRANCH_MARKERS_0)
{ {
// input was changed // input was changed
// copy hotchanges of the Branch // copy hotchanges of the Branch
if (TASEdit_branch_full_movie) if (taseditor_config.branch_full_movie)
{ {
inp.copyHotChanges(&bookmarks.bookmarks_array[slot].snapshot); inp.copyHotChanges(&bookmarks.bookmarks_array[slot].snapshot);
} else } else
@ -385,13 +378,13 @@ void INPUT_HISTORY::RegisterRecording(int frame_of_change)
{ {
int real_pos = (history_start_pos + history_cursor_pos) % history_size; int real_pos = (history_start_pos + history_cursor_pos) % history_size;
INPUT_SNAPSHOT inp; INPUT_SNAPSHOT inp;
inp.init(currMovieData, TASEdit_enable_hot_changes); inp.init(currMovieData, taseditor_config.enable_hot_changes);
inp.fillJoypadsDiff(input_snapshots[real_pos], frame_of_change); inp.fillJoypadsDiff(input_snapshots[real_pos], frame_of_change);
inp.mod_type = MODTYPE_RECORD; inp.mod_type = MODTYPE_RECORD;
strcat(inp.description, modCaptions[MODTYPE_RECORD]); strcat(inp.description, modCaptions[MODTYPE_RECORD]);
char framenum[11]; char framenum[11];
// check if current snapshot is also Recording and maybe it is consecutive recording // check if current snapshot is also Recording and maybe it is consecutive recording
if (TASEdit_combine_consecutive_rec && input_snapshots[real_pos].mod_type == MODTYPE_RECORD && input_snapshots[real_pos].rec_end_frame+1 == frame_of_change && input_snapshots[real_pos].rec_joypad_diff_bits == inp.rec_joypad_diff_bits) if (taseditor_config.combine_consecutive_rec && input_snapshots[real_pos].mod_type == MODTYPE_RECORD && input_snapshots[real_pos].rec_end_frame+1 == frame_of_change && input_snapshots[real_pos].rec_joypad_diff_bits == inp.rec_joypad_diff_bits)
{ {
// clone this snapshot and continue chain of recorded frames // clone this snapshot and continue chain of recorded frames
inp.jump_frame = input_snapshots[real_pos].jump_frame; inp.jump_frame = input_snapshots[real_pos].jump_frame;
@ -413,7 +406,7 @@ void INPUT_HISTORY::RegisterRecording(int frame_of_change)
strcat(inp.description, "-"); strcat(inp.description, "-");
strcat(inp.description, framenum); strcat(inp.description, framenum);
// set hotchanges // set hotchanges
if (TASEdit_enable_hot_changes) if (taseditor_config.enable_hot_changes)
{ {
inp.copyHotChanges(&input_snapshots[real_pos]); inp.copyHotChanges(&input_snapshots[real_pos]);
inp.fillHotChanges(input_snapshots[real_pos], frame_of_change, frame_of_change); inp.fillHotChanges(input_snapshots[real_pos], frame_of_change, frame_of_change);
@ -441,7 +434,7 @@ void INPUT_HISTORY::RegisterRecording(int frame_of_change)
strcat(inp.description, " "); strcat(inp.description, " ");
strcat(inp.description, framenum); strcat(inp.description, framenum);
// set hotchanges // set hotchanges
if (TASEdit_enable_hot_changes) if (taseditor_config.enable_hot_changes)
{ {
inp.inheritHotChanges(&input_snapshots[real_pos]); inp.inheritHotChanges(&input_snapshots[real_pos]);
inp.fillHotChanges(input_snapshots[real_pos], frame_of_change, frame_of_change); inp.fillHotChanges(input_snapshots[real_pos], frame_of_change, frame_of_change);
@ -454,7 +447,7 @@ void INPUT_HISTORY::RegisterImport(MovieData& md, char* filename)
{ {
// create new input snapshot // create new input snapshot
INPUT_SNAPSHOT inp; INPUT_SNAPSHOT inp;
inp.init(md, TASEdit_enable_hot_changes, (currMovieData.fourscore)?FOURSCORE:NORMAL_2JOYPADS); inp.init(md, taseditor_config.enable_hot_changes, (currMovieData.fourscore)?FOURSCORE:NORMAL_2JOYPADS);
// check if there are input differences from latest snapshot // check if there are input differences from latest snapshot
int real_pos = (history_start_pos + history_cursor_pos) % history_size; int real_pos = (history_start_pos + history_cursor_pos) % history_size;
int first_changes = inp.findFirstChange(input_snapshots[real_pos]); int first_changes = inp.findFirstChange(input_snapshots[real_pos]);
@ -468,20 +461,20 @@ void INPUT_HISTORY::RegisterImport(MovieData& md, char* filename)
// add filename to description // add filename to description
strcat(inp.description, " "); strcat(inp.description, " ");
strncat(inp.description, filename, SNAPSHOT_DESC_MAX_LENGTH - strlen(inp.description) - 1); strncat(inp.description, filename, SNAPSHOT_DESC_MAX_LENGTH - strlen(inp.description) - 1);
if (TASEdit_enable_hot_changes) if (taseditor_config.enable_hot_changes)
{ {
// do not inherit old hotchanges, because imported input (most likely) doesn't have direct connection with recent edits, so old hotchanges are irrelevant and should not be copied // do not inherit old hotchanges, because imported input (most likely) doesn't have direct connection with recent edits, so old hotchanges are irrelevant and should not be copied
inp.fillHotChanges(input_snapshots[real_pos], first_changes); inp.fillHotChanges(input_snapshots[real_pos], first_changes);
} }
AddInputSnapshotToHistory(inp); AddInputSnapshotToHistory(inp);
inp.toMovie(currMovieData); inp.toMovie(currMovieData);
tasedit_list.update(); list.update();
bookmarks.ChangesMadeSinceBranch(); bookmarks.ChangesMadeSinceBranch();
project.SetProjectChanged(); project.SetProjectChanged();
greenzone.InvalidateAndCheck(first_changes); greenzone.InvalidateAndCheck(first_changes);
} else } else
{ {
MessageBox(hwndTasEdit, "Imported movie has the same input.\nNo changes were made.", "TAS Editor", MB_OK); MessageBox(taseditor_window.hwndTasEditor, "Imported movie has the same input.\nNo changes were made.", "TAS Editor", MB_OK);
} }
} }
@ -611,8 +604,8 @@ void INPUT_HISTORY::Click(LPNMITEMACTIVATE info)
int result = jump(item); int result = jump(item);
if (result >= 0) if (result >= 0)
{ {
tasedit_list.update(); list.update();
tasedit_list.FollowUndo(); list.FollowUndo();
greenzone.InvalidateAndCheck(result); greenzone.InvalidateAndCheck(result);
return; return;
} }

View File

@ -42,6 +42,7 @@
#define MODTYPE_LUA_MARKER_SET 37 #define MODTYPE_LUA_MARKER_SET 37
#define MODTYPE_LUA_MARKER_UNSET 38 #define MODTYPE_LUA_MARKER_UNSET 38
#define MODTYPE_LUA_MARKER_RENAME 39 #define MODTYPE_LUA_MARKER_RENAME 39
#define MODTYPE_LUA_CHANGE 40
#define HISTORY_NORMAL_COLOR 0x000000 #define HISTORY_NORMAL_COLOR 0x000000
#define HISTORY_INCOHERENT_COLOR 0x999999 #define HISTORY_INCOHERENT_COLOR 0x999999

View File

@ -1,14 +1,11 @@
//Implementation file of Input Snapshot class (Undo feature) //Implementation file of Input Snapshot class (Undo feature)
#include "taseditor_project.h"
#include "taseditproj.h"
#include "zlib.h" #include "zlib.h"
const int bytes_per_frame[NUM_SUPPORTED_INPUT_TYPES] = {2, 4}; // so 16bits for normal joypads, 32bits for fourscore const int bytes_per_frame[NUM_SUPPORTED_INPUT_TYPES] = {2, 4}; // so 16bits for normal joypads, 32bits for fourscore
extern void FCEU_printf(char *format, ...);
extern MARKERS current_markers; extern MARKERS current_markers;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
INPUT_SNAPSHOT::INPUT_SNAPSHOT() INPUT_SNAPSHOT::INPUT_SNAPSHOT()
{ {

View File

@ -43,7 +43,7 @@ public:
int GetHotChangeInfo(int frame, int absolute_button); int GetHotChangeInfo(int frame, int absolute_button);
int size; // in frames int size; // in frames
int input_type; // 0=normal, 1=fourscore; theoretically TASEdit can support other input types, although some stuff may be unintentionally hardcoded int input_type; // 0=normal, 1=fourscore; theoretically TAS Editor can support other input types, although some stuff may be unintentionally hardcoded
std::vector<uint8> joysticks; // Format: joy0-for-frame0, joy1-for-frame0, joy2-for-frame0, joy3-for-frame0, joy0-for-frame1, joy1-for-frame1, ... std::vector<uint8> joysticks; // Format: joy0-for-frame0, joy1-for-frame0, joy2-for-frame0, joy3-for-frame0, joy0-for-frame1, joy1-for-frame1, ...
std::vector<uint8> commands; // Format: commands-for-frame0, commands-for-frame1, ... std::vector<uint8> commands; // Format: commands-for-frame0, commands-for-frame1, ...
std::vector<uint8> hot_changes; // Format: buttons01joy0-for-frame0, buttons23joy0-for-frame0, buttons45joy0-for-frame0, buttons67joy0-for-frame0, buttons01joy1-for-frame0, ... std::vector<uint8> hot_changes; // Format: buttons01joy0-for-frame0, buttons23joy0-for-frame0, buttons45joy0-for-frame0, buttons67joy0-for-frame0, buttons01joy1-for-frame0, ...

View File

@ -1,13 +1,12 @@
//Implementation file of Markers class //Implementation file of Markers class
#include "taseditproj.h" #include "taseditor_project.h"
#include "zlib.h" #include "zlib.h"
#include <Shlwapi.h> // for StrStrI #include <Shlwapi.h> // for StrStrI
extern bool TASEdit_empty_marker_notes; extern TASEDITOR_CONFIG taseditor_config;
extern HWND hwndTasEdit; extern TASEDITOR_WINDOW taseditor_window;
extern PLAYBACK playback; extern PLAYBACK playback;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
// resources // resources
char markers_save_id[MARKERS_ID_LEN] = "MARKERS"; char markers_save_id[MARKERS_ID_LEN] = "MARKERS";
@ -274,7 +273,7 @@ int MARKERS::SetMarker(int frame)
int marker_num = GetMarkerUp(frame) + 1; int marker_num = GetMarkerUp(frame) + 1;
markers_array[frame] = marker_num; markers_array[frame] = marker_num;
if (TASEdit_empty_marker_notes) if (taseditor_config.empty_marker_notes)
notes.insert(notes.begin() + marker_num, 1, ""); notes.insert(notes.begin() + marker_num, 1, "");
else else
// copy previous marker note // copy previous marker note
@ -392,7 +391,7 @@ void MARKERS::FindSimilar(int offset)
// check if playback_marker_text is empty // check if playback_marker_text is empty
if (!sourceNote[0]) if (!sourceNote[0])
{ {
MessageBox(hwndTasEdit, "Marker Note under Playback cursor is empty!", "Find Similar Note", MB_OK); MessageBox(taseditor_window.hwndTasEditor, "Marker Note under Playback cursor is empty!", "Find Similar Note", MB_OK);
return; return;
} }
@ -431,7 +430,7 @@ void MARKERS::FindSimilar(int offset)
if (!totalSourceKeywords) if (!totalSourceKeywords)
{ {
MessageBox(hwndTasEdit, "Marker Note under Playback cursor doesn't have keywords!", "Find Similar Note", MB_OK); MessageBox(taseditor_window.hwndTasEditor, "Marker Note under Playback cursor doesn't have keywords!", "Find Similar Note", MB_OK);
return; return;
} }
@ -574,9 +573,9 @@ void MARKERS::FindSimilar(int offset)
} else } else
{ {
if (offset) if (offset)
MessageBox(hwndTasEdit, "Could not find more Notes similar to Marker Note under Playback cursor!", "Find Similar Note", MB_OK); MessageBox(taseditor_window.hwndTasEditor, "Could not find more Notes similar to Marker Note under Playback cursor!", "Find Similar Note", MB_OK);
else else
MessageBox(hwndTasEdit, "Could not find anything similar to Marker Note under Playback cursor!", "Find Similar Note", MB_OK); MessageBox(taseditor_window.hwndTasEditor, "Could not find anything similar to Marker Note under Playback cursor!", "Find Similar Note", MB_OK);
} }
} }

View File

@ -1,21 +1,21 @@
//Implementation file of Playback class //Implementation file of Playback class
#include "taseditproj.h" #include "taseditor_project.h"
#include "..\tasedit.h" // only for MARKER_NOTE_EDIT_UPPER #include "..\tasedit.h" // only for MARKER_NOTE_EDIT_UPPER
#ifdef _S9XLUA_H #ifdef _S9XLUA_H
extern void ForceExecuteLuaFrameFunctions(); extern void ForceExecuteLuaFrameFunctions();
#endif #endif
extern HWND hwndTasEdit; extern bool Taseditor_rewind_now;
extern bool Tasedit_rewind_now;
extern bool turbo; extern bool turbo;
extern bool TASEdit_turbo_seek;
extern int marker_note_edit; extern int marker_note_edit;
extern int search_similar_marker; extern int search_similar_marker;
extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
extern MARKERS current_markers; extern MARKERS current_markers;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern void UpdateMarkerNote(); extern void UpdateMarkerNote();
@ -32,17 +32,17 @@ PLAYBACK::PLAYBACK()
void PLAYBACK::init() void PLAYBACK::init()
{ {
hwndProgressbar = GetDlgItem(hwndTasEdit, IDC_PROGRESS1); hwndProgressbar = GetDlgItem(taseditor_window.hwndTasEditor, IDC_PROGRESS1);
SendMessage(hwndProgressbar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSBAR_WIDTH)); SendMessage(hwndProgressbar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSBAR_WIDTH));
hwndRewind = GetDlgItem(hwndTasEdit, TASEDIT_REWIND); hwndRewind = GetDlgItem(taseditor_window.hwndTasEditor, TASEDIT_REWIND);
hwndForward = GetDlgItem(hwndTasEdit, TASEDIT_FORWARD); hwndForward = GetDlgItem(taseditor_window.hwndTasEditor, TASEDIT_FORWARD);
hwndRewindFull = GetDlgItem(hwndTasEdit, TASEDIT_REWIND_FULL); hwndRewindFull = GetDlgItem(taseditor_window.hwndTasEditor, TASEDIT_REWIND_FULL);
hwndForwardFull = GetDlgItem(hwndTasEdit, TASEDIT_FORWARD_FULL); hwndForwardFull = GetDlgItem(taseditor_window.hwndTasEditor, TASEDIT_FORWARD_FULL);
hwndPlaybackMarker = GetDlgItem(hwndTasEdit, IDC_PLAYBACK_MARKER); hwndPlaybackMarker = GetDlgItem(taseditor_window.hwndTasEditor, IDC_PLAYBACK_MARKER);
SendMessage(hwndPlaybackMarker, WM_SETFONT, (WPARAM)tasedit_list.hMarkersFont, 0); SendMessage(hwndPlaybackMarker, WM_SETFONT, (WPARAM)list.hMarkersFont, 0);
hwndPlaybackMarkerEdit = GetDlgItem(hwndTasEdit, IDC_PLAYBACK_MARKER_EDIT); hwndPlaybackMarkerEdit = GetDlgItem(taseditor_window.hwndTasEditor, IDC_PLAYBACK_MARKER_EDIT);
SendMessage(hwndPlaybackMarkerEdit, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0); SendMessage(hwndPlaybackMarkerEdit, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0);
SendMessage(hwndPlaybackMarkerEdit, WM_SETFONT, (WPARAM)tasedit_list.hMarkersEditFont, 0); SendMessage(hwndPlaybackMarkerEdit, WM_SETFONT, (WPARAM)list.hMarkersEditFont, 0);
// subclass the edit control // subclass the edit control
playbackMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndPlaybackMarkerEdit, GWL_WNDPROC, (LONG)UpperMarkerEditWndProc); playbackMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndPlaybackMarkerEdit, GWL_WNDPROC, (LONG)UpperMarkerEditWndProc);
@ -74,7 +74,7 @@ void PLAYBACK::update()
if (old_pauseframe != pause_frame && old_pauseframe) if (old_pauseframe != pause_frame && old_pauseframe)
{ {
// pause_frame was changed, clear old_pauseframe gfx // pause_frame was changed, clear old_pauseframe gfx
tasedit_list.RedrawRow(old_pauseframe-1); list.RedrawRow(old_pauseframe-1);
bookmarks.RedrawChangedBookmarks(old_pauseframe-1); bookmarks.RedrawChangedBookmarks(old_pauseframe-1);
} }
old_pauseframe = pause_frame; old_pauseframe = pause_frame;
@ -89,7 +89,7 @@ void PLAYBACK::update()
if (old_show_pauseframe != show_pauseframe) if (old_show_pauseframe != show_pauseframe)
{ {
// update pauseframe gfx // update pauseframe gfx
tasedit_list.RedrawRow(pause_frame-1); list.RedrawRow(pause_frame-1);
bookmarks.RedrawChangedBookmarks(pause_frame-1); bookmarks.RedrawChangedBookmarks(pause_frame-1);
} }
@ -114,15 +114,15 @@ void PLAYBACK::update()
// update the playback cursor // update the playback cursor
if(currFrameCounter != lastCursor) if(currFrameCounter != lastCursor)
{ {
tasedit_list.FollowPlaybackIfNeeded(); list.FollowPlaybackIfNeeded();
// update gfx of the old and new rows // update gfx of the old and new rows
tasedit_list.RedrawRow(lastCursor); list.RedrawRow(lastCursor);
bookmarks.RedrawChangedBookmarks(lastCursor); bookmarks.RedrawChangedBookmarks(lastCursor);
tasedit_list.RedrawRow(currFrameCounter); list.RedrawRow(currFrameCounter);
bookmarks.RedrawChangedBookmarks(currFrameCounter); bookmarks.RedrawChangedBookmarks(currFrameCounter);
// enforce redrawing now // enforce redrawing now
lastCursor = currFrameCounter; lastCursor = currFrameCounter;
UpdateWindow(tasedit_list.hwndList); UpdateWindow(list.hwndList);
// lazy update of "Playback's Marker text" // lazy update of "Playback's Marker text"
int current_marker = current_markers.GetMarkerUp(currFrameCounter); int current_marker = current_markers.GetMarkerUp(currFrameCounter);
if (shown_marker != current_marker) if (shown_marker != current_marker)
@ -145,7 +145,7 @@ void PLAYBACK::update()
// update < and > buttons // update < and > buttons
old_rewind_button_state = rewind_button_state; old_rewind_button_state = rewind_button_state;
rewind_button_state = ((Button_GetState(hwndRewind) & BST_PUSHED) != 0 || Tasedit_rewind_now); rewind_button_state = ((Button_GetState(hwndRewind) & BST_PUSHED) != 0 || Taseditor_rewind_now);
if (rewind_button_state) if (rewind_button_state)
{ {
if (!old_rewind_button_state) if (!old_rewind_button_state)
@ -236,7 +236,7 @@ void PLAYBACK::SeekingStart(int finish_frame)
{ {
seeking_start_frame = currFrameCounter; seeking_start_frame = currFrameCounter;
pause_frame = finish_frame; pause_frame = finish_frame;
if (TASEdit_turbo_seek) if (taseditor_config.turbo_seek)
turbo = true; turbo = true;
UnpauseEmulation(); UnpauseEmulation();
} }
@ -255,7 +255,7 @@ void PLAYBACK::RewindFrame()
jump(currFrameCounter-1); jump(currFrameCounter-1);
else else
// cursor is at frame 0 - can't rewind, but still must make cursor visible if needed // cursor is at frame 0 - can't rewind, but still must make cursor visible if needed
tasedit_list.FollowPlaybackIfNeeded(); list.FollowPlaybackIfNeeded();
if (!pause_frame) PauseEmulation(); if (!pause_frame) PauseEmulation();
} }
void PLAYBACK::ForwardFrame() void PLAYBACK::ForwardFrame()
@ -319,7 +319,7 @@ void PLAYBACK::jump(int frame)
if (JumpToFrame(frame)) if (JumpToFrame(frame))
{ {
ForceExecuteLuaFrameFunctions(); ForceExecuteLuaFrameFunctions();
tasedit_list.FollowPlaybackIfNeeded(); list.FollowPlaybackIfNeeded();
} }
} }
void PLAYBACK::restorePosition() void PLAYBACK::restorePosition()
@ -385,7 +385,7 @@ LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
if (marker_note_edit == MARKER_NOTE_EDIT_UPPER) if (marker_note_edit == MARKER_NOTE_EDIT_UPPER)
{ {
extern PLAYBACK playback; extern PLAYBACK playback;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
switch(msg) switch(msg)
{ {
case WM_CHAR: case WM_CHAR:
@ -395,11 +395,11 @@ LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
case VK_ESCAPE: case VK_ESCAPE:
// revert text to original note text // revert text to original note text
SetWindowText(playback.hwndPlaybackMarkerEdit, current_markers.GetNote(playback.shown_marker).c_str()); SetWindowText(playback.hwndPlaybackMarkerEdit, current_markers.GetNote(playback.shown_marker).c_str());
SetFocus(tasedit_list.hwndList); SetFocus(list.hwndList);
return 0; return 0;
case VK_RETURN: case VK_RETURN:
// exit and save text changes // exit and save text changes
SetFocus(tasedit_list.hwndList); SetFocus(list.hwndList);
return 0; return 0;
case VK_TAB: case VK_TAB:
// switch to lower edit control (also exit and save text changes) // switch to lower edit control (also exit and save text changes)

View File

@ -39,6 +39,8 @@ public:
int GetPauseFrame(); int GetPauseFrame();
void SetProgressbar(int a, int b); void SetProgressbar(int a, int b);
bool JumpToFrame(int index);
int pause_frame; int pause_frame;
bool must_find_current_marker; bool must_find_current_marker;
int shown_marker; int shown_marker;
@ -50,7 +52,6 @@ public:
bool jump_was_used_this_frame; bool jump_was_used_this_frame;
private: private:
bool JumpToFrame(int index);
int lastCursor; // but for currentCursor we use external variable currFrameCounter int lastCursor; // but for currentCursor we use external variable currFrameCounter
bool old_emu_paused, emu_paused; bool old_emu_paused, emu_paused;

View File

@ -1,16 +1,12 @@
//Implementation file of SCREENSHOT_DISPLAY class //Implementation file of POPUP_DISPLAY class
#include "taseditor_project.h"
#include "taseditproj.h"
#include "zlib.h" #include "zlib.h"
extern HWND hwndTasEdit; extern TASEDITOR_CONFIG taseditor_config;
extern int TasEdit_wndx, TasEdit_wndy; extern TASEDITOR_WINDOW taseditor_window;
extern bool TASEdit_show_branch_screenshots;
extern bool TASEdit_show_branch_tooltips;
extern MARKERS current_markers; extern MARKERS current_markers;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
LRESULT CALLBACK ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT APIENTRY MarkerNoteTooltipWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY MarkerNoteTooltipWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
@ -19,7 +15,7 @@ LRESULT APIENTRY MarkerNoteTooltipWndProc(HWND hwnd, UINT message, WPARAM wParam
char szClassName[] = "ScrBmp"; char szClassName[] = "ScrBmp";
char szClassName2[] = "MarketNoteTooltip"; char szClassName2[] = "MarketNoteTooltip";
SCREENSHOT_DISPLAY::SCREENSHOT_DISPLAY() POPUP_DISPLAY::POPUP_DISPLAY()
{ {
// create BITMAPINFO // create BITMAPINFO
scr_bmi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); // 256 color in palette scr_bmi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); // 256 color in palette
@ -70,7 +66,7 @@ SCREENSHOT_DISPLAY::SCREENSHOT_DISPLAY()
blend.SourceConstantAlpha = 255; blend.SourceConstantAlpha = 255;
} }
void SCREENSHOT_DISPLAY::init() void POPUP_DISPLAY::init()
{ {
free(); free();
// fill scr_bmp palette with current palette colors // fill scr_bmp palette with current palette colors
@ -81,12 +77,12 @@ void SCREENSHOT_DISPLAY::init()
scr_bmi->bmiColors[i].rgbGreen = color_palette[i].peGreen; scr_bmi->bmiColors[i].rgbGreen = color_palette[i].peGreen;
scr_bmi->bmiColors[i].rgbBlue = color_palette[i].peBlue; scr_bmi->bmiColors[i].rgbBlue = color_palette[i].peBlue;
} }
HDC win_hdc = GetWindowDC(tasedit_list.hwndList); HDC win_hdc = GetWindowDC(list.hwndList);
scr_bmp = CreateDIBSection(win_hdc, scr_bmi, DIB_RGB_COLORS, (void**)&scr_ptr, 0, 0); scr_bmp = CreateDIBSection(win_hdc, scr_bmi, DIB_RGB_COLORS, (void**)&scr_ptr, 0, 0);
// calculate coordinates (relative to IDC_BOOKMARKS_BOX) // calculate coordinates (relative to IDC_BOOKMARKS_BOX)
RECT temp_rect, parent_rect; RECT temp_rect, parent_rect;
GetWindowRect(hwndTasEdit, &parent_rect); GetWindowRect(taseditor_window.hwndTasEditor, &parent_rect);
GetWindowRect(GetDlgItem(hwndTasEdit, IDC_BOOKMARKS_BOX), &temp_rect); GetWindowRect(GetDlgItem(taseditor_window.hwndTasEditor, IDC_BOOKMARKS_BOX), &temp_rect);
scr_bmp_x = temp_rect.left - SCREENSHOT_WIDTH - SCR_BMP_DX - parent_rect.left; scr_bmp_x = temp_rect.left - SCREENSHOT_WIDTH - SCR_BMP_DX - parent_rect.left;
//scr_bmp_y = ((temp_rect.bottom + temp_rect.top - (SCREENSHOT_HEIGHT + SCR_BMP_TOOLTIP_GAP + MARKER_NOTE_TOOLTIP_HEIGHT)) / 2) - parent_rect.top; //scr_bmp_y = ((temp_rect.bottom + temp_rect.top - (SCREENSHOT_HEIGHT + SCR_BMP_TOOLTIP_GAP + MARKER_NOTE_TOOLTIP_HEIGHT)) / 2) - parent_rect.top;
scr_bmp_y = (temp_rect.bottom - SCREENSHOT_HEIGHT) - parent_rect.top; scr_bmp_y = (temp_rect.bottom - SCREENSHOT_HEIGHT) - parent_rect.top;
@ -94,7 +90,7 @@ void SCREENSHOT_DISPLAY::init()
//tooltip_y = scr_bmp_y + SCREENSHOT_HEIGHT + SCR_BMP_TOOLTIP_GAP; //tooltip_y = scr_bmp_y + SCREENSHOT_HEIGHT + SCR_BMP_TOOLTIP_GAP;
tooltip_y = scr_bmp_y + SCREENSHOT_HEIGHT + SCR_BMP_TOOLTIP_GAP; tooltip_y = scr_bmp_y + SCREENSHOT_HEIGHT + SCR_BMP_TOOLTIP_GAP;
} }
void SCREENSHOT_DISPLAY::free() void POPUP_DISPLAY::free()
{ {
reset(); reset();
if (scr_bmp) if (scr_bmp)
@ -103,7 +99,7 @@ void SCREENSHOT_DISPLAY::free()
scr_bmp = 0; scr_bmp = 0;
} }
} }
void SCREENSHOT_DISPLAY::reset() void POPUP_DISPLAY::reset()
{ {
screenshot_currently_shown = ITEM_UNDER_MOUSE_NONE; screenshot_currently_shown = ITEM_UNDER_MOUSE_NONE;
next_update_time = scr_bmp_phase = 0; next_update_time = scr_bmp_phase = 0;
@ -119,7 +115,7 @@ void SCREENSHOT_DISPLAY::reset()
} }
} }
void SCREENSHOT_DISPLAY::update() void POPUP_DISPLAY::update()
{ {
// once per 40 milliseconds update screenshot_bitmap alpha // once per 40 milliseconds update screenshot_bitmap alpha
if (clock() > next_update_time) if (clock() > next_update_time)
@ -127,25 +123,25 @@ void SCREENSHOT_DISPLAY::update()
next_update_time = clock() + DISPLAY_UPDATE_TICK; next_update_time = clock() + DISPLAY_UPDATE_TICK;
if (bookmarks.item_under_mouse >= 0 && bookmarks.item_under_mouse < TOTAL_BOOKMARKS) if (bookmarks.item_under_mouse >= 0 && bookmarks.item_under_mouse < TOTAL_BOOKMARKS)
{ {
if (TASEdit_show_branch_screenshots && !hwndScrBmp) if (taseditor_config.show_branch_screenshots && !hwndScrBmp)
{ {
// create window // create window
hwndScrBmp = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, szClassName, szClassName, WS_POPUP, TasEdit_wndx + scr_bmp_x, TasEdit_wndy + scr_bmp_y, SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT, hwndTasEdit, NULL, fceu_hInstance, NULL); hwndScrBmp = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, szClassName, szClassName, WS_POPUP, taseditor_config.wndx + scr_bmp_x, taseditor_config.wndy + scr_bmp_y, SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT, taseditor_window.hwndTasEditor, NULL, fceu_hInstance, NULL);
RedrawScreenshotBitmap(); RedrawScreenshotBitmap();
ShowWindow(hwndScrBmp, SW_SHOWNA); ShowWindow(hwndScrBmp, SW_SHOWNA);
} }
if (TASEdit_show_branch_tooltips && !hwndMarkerNoteTooltip) if (taseditor_config.show_branch_tooltips && !hwndMarkerNoteTooltip)
{ {
hwndMarkerNoteTooltip = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, szClassName2, szClassName2, WS_POPUP, TasEdit_wndx + tooltip_x, TasEdit_wndy + tooltip_y, MARKER_NOTE_TOOLTIP_WIDTH, MARKER_NOTE_TOOLTIP_HEIGHT, hwndTasEdit, NULL, fceu_hInstance, NULL); hwndMarkerNoteTooltip = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, szClassName2, szClassName2, WS_POPUP, taseditor_config.wndx + tooltip_x, taseditor_config.wndy + tooltip_y, MARKER_NOTE_TOOLTIP_WIDTH, MARKER_NOTE_TOOLTIP_HEIGHT, taseditor_window.hwndTasEditor, NULL, fceu_hInstance, NULL);
ChangeTooltipText(); ChangeTooltipText();
ShowWindow(hwndMarkerNoteTooltip, SW_SHOWNA); ShowWindow(hwndMarkerNoteTooltip, SW_SHOWNA);
} }
// change screenshot_bitmap pic and tooltip text if needed // change screenshot_bitmap pic and tooltip text if needed
if (screenshot_currently_shown != bookmarks.item_under_mouse) if (screenshot_currently_shown != bookmarks.item_under_mouse)
{ {
if (TASEdit_show_branch_screenshots) if (taseditor_config.show_branch_screenshots)
ChangeScreenshotBitmap(); ChangeScreenshotBitmap();
if (TASEdit_show_branch_tooltips) if (taseditor_config.show_branch_tooltips)
ChangeTooltipText(); ChangeTooltipText();
screenshot_currently_shown = bookmarks.item_under_mouse; screenshot_currently_shown = bookmarks.item_under_mouse;
} }
@ -205,7 +201,7 @@ void SCREENSHOT_DISPLAY::update()
} }
} }
void SCREENSHOT_DISPLAY::ChangeScreenshotBitmap() void POPUP_DISPLAY::ChangeScreenshotBitmap()
{ {
// uncompress // uncompress
uLongf destlen = SCREENSHOT_SIZE; uLongf destlen = SCREENSHOT_SIZE;
@ -219,13 +215,13 @@ void SCREENSHOT_DISPLAY::ChangeScreenshotBitmap()
} }
RedrawScreenshotBitmap(); RedrawScreenshotBitmap();
} }
void SCREENSHOT_DISPLAY::RedrawScreenshotBitmap() void POPUP_DISPLAY::RedrawScreenshotBitmap()
{ {
HBITMAP temp_bmp = (HBITMAP)SendMessage(scr_bmp_pic, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)scr_bmp); HBITMAP temp_bmp = (HBITMAP)SendMessage(scr_bmp_pic, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)scr_bmp);
if (temp_bmp && temp_bmp != scr_bmp) if (temp_bmp && temp_bmp != scr_bmp)
DeleteObject(temp_bmp); DeleteObject(temp_bmp);
} }
void SCREENSHOT_DISPLAY::ChangeTooltipText() void POPUP_DISPLAY::ChangeTooltipText()
{ {
// retrieve info from the pointed bookmark's markers // retrieve info from the pointed bookmark's markers
int frame = bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.jump_frame; int frame = bookmarks.bookmarks_array[bookmarks.item_under_mouse].snapshot.jump_frame;
@ -235,23 +231,23 @@ void SCREENSHOT_DISPLAY::ChangeTooltipText()
SetWindowText(marker_note_tooltip, new_text); SetWindowText(marker_note_tooltip, new_text);
} }
void SCREENSHOT_DISPLAY::ParentWindowMoved() void POPUP_DISPLAY::ParentWindowMoved()
{ {
if (hwndScrBmp) if (hwndScrBmp)
SetWindowPos(hwndScrBmp, 0, TasEdit_wndx + scr_bmp_x, TasEdit_wndy + scr_bmp_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE); SetWindowPos(hwndScrBmp, 0, taseditor_config.wndx + scr_bmp_x, taseditor_config.wndy + scr_bmp_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
if (hwndMarkerNoteTooltip) if (hwndMarkerNoteTooltip)
SetWindowPos(hwndMarkerNoteTooltip, 0, TasEdit_wndx + tooltip_x, TasEdit_wndy + tooltip_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE); SetWindowPos(hwndMarkerNoteTooltip, 0, taseditor_config.wndx + tooltip_x, taseditor_config.wndy + tooltip_y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
LRESULT APIENTRY ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT APIENTRY ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
extern SCREENSHOT_DISPLAY screenshot_display; extern POPUP_DISPLAY popup_display;
switch(message) switch(message)
{ {
case WM_CREATE: case WM_CREATE:
{ {
// create static bitmap placeholder // create static bitmap placeholder
screenshot_display.scr_bmp_pic = CreateWindow(WC_STATIC, NULL, SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0, 255, 255, hwnd, NULL, NULL, NULL); popup_display.scr_bmp_pic = CreateWindow(WC_STATIC, NULL, SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0, 255, 255, hwnd, NULL, NULL, NULL);
return 0; return 0;
} }
default: default:
@ -260,13 +256,13 @@ LRESULT APIENTRY ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
} }
LRESULT APIENTRY MarkerNoteTooltipWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT APIENTRY MarkerNoteTooltipWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
extern SCREENSHOT_DISPLAY screenshot_display; extern POPUP_DISPLAY popup_display;
switch(message) switch(message)
{ {
case WM_CREATE: case WM_CREATE:
{ {
// create static text field // create static text field
screenshot_display.marker_note_tooltip = CreateWindow(WC_STATIC, NULL, WS_CHILD | WS_VISIBLE | SS_CENTER | SS_SUNKEN, 1, 1, MARKER_NOTE_TOOLTIP_WIDTH - 2, MARKER_NOTE_TOOLTIP_HEIGHT - 2, hwnd, NULL, NULL, NULL); popup_display.marker_note_tooltip = CreateWindow(WC_STATIC, NULL, WS_CHILD | WS_VISIBLE | SS_CENTER | SS_SUNKEN, 1, 1, MARKER_NOTE_TOOLTIP_WIDTH - 2, MARKER_NOTE_TOOLTIP_HEIGHT - 2, hwnd, NULL, NULL, NULL);
return 0; return 0;
} }
default: default:

View File

@ -1,4 +1,4 @@
//Specification file for SCREENSHOT_DISPLAY class //Specification file for POPUP_DISPLAY class
#define SCR_BMP_PHASE_MAX 10 #define SCR_BMP_PHASE_MAX 10
#define SCR_BMP_PHASE_ALPHA_MAX 8 #define SCR_BMP_PHASE_ALPHA_MAX 8
@ -11,10 +11,10 @@
#define DISPLAY_UPDATE_TICK 40 // update at 25FPS #define DISPLAY_UPDATE_TICK 40 // update at 25FPS
class SCREENSHOT_DISPLAY class POPUP_DISPLAY
{ {
public: public:
SCREENSHOT_DISPLAY(); POPUP_DISPLAY();
void init(); void init();
void free(); void free();
void reset(); void reset();

View File

@ -1,23 +1,16 @@
//Implementation file of RECORDER class //Implementation file of RECORDER class
#include "taseditproj.h" #include "taseditor_project.h"
#include "zlib.h" #include "zlib.h"
extern HWND hwndTasEdit;
extern uint32 GetGamepadPressedImmediate(); extern uint32 GetGamepadPressedImmediate();
extern void ColumnSet(int column); extern void ColumnSet(int column);
extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern INPUT_HISTORY history; extern INPUT_HISTORY history;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
extern void RedrawWindowCaption();
extern bool TASEdit_branch_only_when_rec;
extern bool TASEdit_use_1p_rec;
extern int TASEdit_superimpose;
extern bool TASEdit_columnset_by_keys;
extern bool TASEdit_focus;
// resources // resources
const char recordingModes[5][4] = { "All", const char recordingModes[5][4] = { "All",
@ -36,12 +29,12 @@ RECORDER::RECORDER()
void RECORDER::init() void RECORDER::init()
{ {
hwndRecCheckbox = GetDlgItem(hwndTasEdit, IDC_RECORDING); hwndRecCheckbox = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RECORDING);
hwndRB_RecAll = GetDlgItem(hwndTasEdit, IDC_RADIO2); hwndRB_RecAll = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RADIO2);
hwndRB_Rec1P = GetDlgItem(hwndTasEdit, IDC_RADIO3); hwndRB_Rec1P = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RADIO3);
hwndRB_Rec2P = GetDlgItem(hwndTasEdit, IDC_RADIO4); hwndRB_Rec2P = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RADIO4);
hwndRB_Rec3P = GetDlgItem(hwndTasEdit, IDC_RADIO5); hwndRB_Rec3P = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RADIO5);
hwndRB_Rec4P = GetDlgItem(hwndTasEdit, IDC_RADIO6); hwndRB_Rec4P = GetDlgItem(taseditor_window.hwndTasEditor, IDC_RADIO6);
reset(); reset();
old_multitrack_recording_joypad = multitrack_recording_joypad; old_multitrack_recording_joypad = multitrack_recording_joypad;
old_movie_readonly = movie_readonly; old_movie_readonly = movie_readonly;
@ -71,9 +64,9 @@ void RECORDER::update()
{ {
// update window caption if needed // update window caption if needed
if (old_movie_readonly != movie_readonly || old_multitrack_recording_joypad != multitrack_recording_joypad) if (old_movie_readonly != movie_readonly || old_multitrack_recording_joypad != multitrack_recording_joypad)
RedrawWindowCaption(); taseditor_window.RedrawCaption();
// update Bookmarks/Branches groupbox caption if needed // update Bookmarks/Branches groupbox caption if needed
if (TASEdit_branch_only_when_rec && old_movie_readonly != movie_readonly) if (taseditor_config.branch_only_when_rec && old_movie_readonly != movie_readonly)
bookmarks.RedrawBookmarksCaption(); bookmarks.RedrawBookmarksCaption();
// update recording radio buttons if user used hotkey to switch R/W // update recording radio buttons if user used hotkey to switch R/W
if (old_movie_readonly != movie_readonly || old_multitrack_recording_joypad != multitrack_recording_joypad) if (old_movie_readonly != movie_readonly || old_multitrack_recording_joypad != multitrack_recording_joypad)
@ -96,7 +89,7 @@ void RECORDER::update()
{ {
int joy = multitrack_recording_joypad - 1; int joy = multitrack_recording_joypad - 1;
// substitute target joypad with 1p joypad // substitute target joypad with 1p joypad
if (multitrack_recording_joypad > MULTITRACK_RECORDING_1P && TASEdit_use_1p_rec) if (multitrack_recording_joypad > MULTITRACK_RECORDING_1P && taseditor_config.use_1p_rec)
current_joy[joy] = current_joy[0]; current_joy[joy] = current_joy[0];
// clear all other joypads (pressing them does not count) // clear all other joypads (pressing them does not count)
for (int i = 0; i < NUM_JOYPADS; ++i) for (int i = 0; i < NUM_JOYPADS; ++i)
@ -104,7 +97,7 @@ void RECORDER::update()
current_joy[i] = 0; current_joy[i] = 0;
} }
// call ColumnSet if needed // call ColumnSet if needed
if (TASEdit_columnset_by_keys && movie_readonly && TASEdit_focus) if (taseditor_config.columnset_by_keys && movie_readonly && taseditor_window.TASEditor_focus)
{ {
int num_joys; int num_joys;
if (currMovieData.fourscore) if (currMovieData.fourscore)
@ -178,7 +171,7 @@ void RECORDER::InputChanged()
for (; i >= 0; i--) for (; i >= 0; i--)
{ {
// superimpose (bitwise OR) if needed // superimpose (bitwise OR) if needed
if (TASEdit_superimpose == BST_CHECKED || (TASEdit_superimpose == BST_INDETERMINATE && new_joy[i] == 0)) if (taseditor_config.superimpose == BST_CHECKED || (taseditor_config.superimpose == BST_INDETERMINATE && new_joy[i] == 0))
new_joy[i] |= old_joy[i]; new_joy[i] |= old_joy[i];
// change this joystick // change this joystick
currMovieData.records[currFrameCounter].joysticks[i] = new_joy[i]; currMovieData.records[currFrameCounter].joysticks[i] = new_joy[i];
@ -188,17 +181,17 @@ void RECORDER::InputChanged()
// set lights for changed buttons // set lights for changed buttons
for (int button = 0; button < NUM_JOYPAD_BUTTONS; ++button) for (int button = 0; button < NUM_JOYPAD_BUTTONS; ++button)
if ((new_joy[i] & (1 << button)) && !(old_joy[i] & (1 << button))) if ((new_joy[i] & (1 << button)) && !(old_joy[i] & (1 << button)))
tasedit_list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + i * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX); list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + i * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX);
} }
} }
} else } else
{ {
int joy = multitrack_recording_joypad - 1; int joy = multitrack_recording_joypad - 1;
// substitute target joypad with 1p joypad // substitute target joypad with 1p joypad
if (multitrack_recording_joypad > MULTITRACK_RECORDING_1P && TASEdit_use_1p_rec) if (multitrack_recording_joypad > MULTITRACK_RECORDING_1P && taseditor_config.use_1p_rec)
new_joy[joy] = new_joy[0]; new_joy[joy] = new_joy[0];
// superimpose (bitwise OR) if needed // superimpose (bitwise OR) if needed
if (TASEdit_superimpose == BST_CHECKED || (TASEdit_superimpose == BST_INDETERMINATE && new_joy[joy] == 0)) if (taseditor_config.superimpose == BST_CHECKED || (taseditor_config.superimpose == BST_INDETERMINATE && new_joy[joy] == 0))
new_joy[joy] |= old_joy[joy]; new_joy[joy] |= old_joy[joy];
// other joysticks should not be changed // other joysticks should not be changed
currMovieData.records[currFrameCounter].joysticks[0] = old_joy[0]; currMovieData.records[currFrameCounter].joysticks[0] = old_joy[0];
@ -216,7 +209,7 @@ void RECORDER::InputChanged()
// set lights for changed buttons // set lights for changed buttons
for (int button = 0; button < NUM_JOYPAD_BUTTONS; ++button) for (int button = 0; button < NUM_JOYPAD_BUTTONS; ++button)
if ((new_joy[joy] & (1 << button)) && !(old_joy[joy] & (1 << button))) if ((new_joy[joy] & (1 << button)) && !(old_joy[joy] & (1 << button)))
tasedit_list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX); list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX);
} }
} }
if (changes_made) if (changes_made)

View File

@ -0,0 +1,55 @@
//Implementation file of TASEDITOR_CONFIG class
#include "../common.h"
#include "taseditor_config.h"
TASEDITOR_CONFIG::TASEDITOR_CONFIG()
{
// set default values
wndx = 0;
wndy = 0;
findnote_wndx = 0;
findnote_wndy = 0;
follow_playback = true;
turbo_seek = true;
show_lag_frames = true;
show_markers = true;
show_branch_screenshots = true;
show_branch_tooltips = true;
enable_hot_changes = true;
jump_to_undo = true;
follow_note_context = true;
bind_markers = true;
empty_marker_notes = true;
combine_consecutive_rec = true;
use_1p_rec = true;
columnset_by_keys = true;
keyboard_for_listview = true;
superimpose = BST_UNCHECKED;
superimpose_affects_paste = true;
branch_full_movie = true;
branch_only_when_rec = false;
view_branches_tree = false;
branch_scr_hud = true;
restore_position = false;
greenzone_capacity = GREENZONE_CAPACITY_DEFAULT;
undo_levels = UNDO_LEVELS_DEFAULT;
autosave_period = AUTOSAVE_PERIOD_DEFAULT;
last_export_type = EXPORT_TYPE_1P;
last_export_subtitles = false;
savecompact_binary = true;
savecompact_markers = true;
savecompact_bookmarks = true;
savecompact_greenzone = false;
savecompact_history = false;
savecompact_list = true;
savecompact_selection = false;
findnote_matchcase = false;
findnote_search_up = false;
enable_auto_function = true;
silent_autosave = true;
}

View File

@ -0,0 +1,69 @@
//Specification file for TASEDITOR_CONFIG class
#define GREENZONE_CAPACITY_MIN 1
#define GREENZONE_CAPACITY_MAX 50000
#define GREENZONE_CAPACITY_DEFAULT 10000
#define UNDO_LEVELS_MIN 1
#define UNDO_LEVELS_MAX 999
#define UNDO_LEVELS_DEFAULT 99
#define AUTOSAVE_PERIOD_MIN 0 // 0 = no autosave
#define AUTOSAVE_PERIOD_MAX 1440 // 24 hours
#define AUTOSAVE_PERIOD_DEFAULT 15 // in minutes
#define EXPORT_TYPE_1P 0
#define EXPORT_TYPE_2P 1
#define EXPORT_TYPE_FOURSCORE 2
class TASEDITOR_CONFIG
{
public:
TASEDITOR_CONFIG();
// vars saved in cfg file
int wndx;
int wndy;
int findnote_wndx;
int findnote_wndy;
bool follow_playback;
bool turbo_seek;
bool show_lag_frames;
bool show_markers;
bool show_branch_screenshots;
bool show_branch_tooltips;
bool enable_hot_changes;
bool jump_to_undo;
bool follow_note_context;
bool bind_markers;
bool empty_marker_notes;
bool combine_consecutive_rec;
bool use_1p_rec;
bool columnset_by_keys;
bool keyboard_for_listview;
int superimpose;
bool superimpose_affects_paste;
bool branch_full_movie;
bool branch_only_when_rec;
bool view_branches_tree;
bool branch_scr_hud;
bool restore_position;
int greenzone_capacity;
int undo_levels;
int autosave_period;
int last_export_type;
bool last_export_subtitles;
bool savecompact_binary;
bool savecompact_markers;
bool savecompact_bookmarks;
bool savecompact_greenzone;
bool savecompact_history;
bool savecompact_list;
bool savecompact_selection;
bool findnote_matchcase;
bool findnote_search_up;
bool enable_auto_function;
bool silent_autosave;
private:
};

View File

@ -1,29 +1,22 @@
//Implementation file of TASEDIT_LIST class //Implementation file of TASEDITOR_LIST class
#include "taseditproj.h" #include "taseditor_project.h"
#include "utils/xstring.h" #include "utils/xstring.h"
#include "uxtheme.h" #include "uxtheme.h"
#pragma comment(lib, "UxTheme.lib") #pragma comment(lib, "UxTheme.lib")
extern HWND hwndTasEdit;
extern char buttonNames[NUM_JOYPAD_BUTTONS][2]; extern char buttonNames[NUM_JOYPAD_BUTTONS][2];
extern void ColumnSet(int column); extern void ColumnSet(int column);
extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern PLAYBACK playback; extern PLAYBACK playback;
extern RECORDER recorder; extern RECORDER recorder;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern INPUT_HISTORY history; extern INPUT_HISTORY history;
extern MARKERS current_markers; extern MARKERS current_markers;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
extern bool TASEdit_enable_hot_changes;
extern bool TASEdit_show_markers;
extern bool TASEdit_bind_markers;
extern bool TASEdit_show_lag_frames;
extern bool TASEdit_follow_playback;
extern bool TASEdit_jump_to_undo;
extern bool TASEdit_keyboard_for_listview;
LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
@ -37,9 +30,13 @@ COLORREF header_lights_colors[11] = { 0x0, 0x006311, 0x008500, 0x1dad00, 0x46d10
char list_save_id[LIST_ID_LEN] = "LIST"; char list_save_id[LIST_ID_LEN] = "LIST";
char list_skipsave_id[LIST_ID_LEN] = "LISX"; char list_skipsave_id[LIST_ID_LEN] = "LISX";
TASEDIT_LIST::TASEDIT_LIST() TASEDITOR_LIST::TASEDITOR_LIST()
{ {
}
void TASEDITOR_LIST::init()
{
free();
// create fonts for main listview // create fonts for main listview
hMainListFont = CreateFont(14, 7, /*Height,Width*/ hMainListFont = CreateFont(14, 7, /*Height,Width*/
0, 0, /*escapement,orientation*/ 0, 0, /*escapement,orientation*/
@ -66,15 +63,11 @@ TASEDIT_LIST::TASEDIT_LIST()
ANSI_CHARSET, OUT_DEVICE_PRECIS, CLIP_MASK, /*charset, precision, clipping*/ ANSI_CHARSET, OUT_DEVICE_PRECIS, CLIP_MASK, /*charset, precision, clipping*/
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/ DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
"Arial"); /*font name*/ "Arial"); /*font name*/
}
void TASEDIT_LIST::init()
{
free();
bg_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); bg_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
header_colors.resize(MAX_NUM_COLUMNS); header_colors.resize(MAX_NUM_COLUMNS);
hwndList = GetDlgItem(hwndTasEdit, IDC_LIST1);
hwndList = GetDlgItem(taseditor_window.hwndTasEditor, IDC_LIST1);
// prepare the main listview // prepare the main listview
ListView_SetExtendedListViewStyleEx(hwndList, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_INFOTIP); ListView_SetExtendedListViewStyleEx(hwndList, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_INFOTIP);
// subclass the header // subclass the header
@ -180,8 +173,28 @@ void TASEDIT_LIST::init()
reset(); reset();
//update(); //update();
} }
void TASEDIT_LIST::free() void TASEDITOR_LIST::free()
{ {
if (hMainListFont)
{
DeleteObject(hMainListFont);
hMainListFont = 0;
}
if (hMainListSelectFont)
{
DeleteObject(hMainListSelectFont);
hMainListSelectFont = 0;
}
if (hMarkersFont)
{
DeleteObject(hMarkersFont);
hMarkersFont = 0;
}
if (hMarkersEditFont)
{
DeleteObject(hMarkersEditFont);
hMarkersEditFont = 0;
}
if (bg_brush) if (bg_brush)
{ {
DeleteObject(bg_brush); DeleteObject(bg_brush);
@ -194,13 +207,13 @@ void TASEDIT_LIST::free()
} }
header_colors.resize(0); header_colors.resize(0);
} }
void TASEDIT_LIST::reset() void TASEDITOR_LIST::reset()
{ {
next_header_update_time = 0; next_header_update_time = 0;
// scroll to the beginning // scroll to the beginning
ListView_EnsureVisible(hwndList, 0, FALSE); ListView_EnsureVisible(hwndList, 0, FALSE);
} }
void TASEDIT_LIST::update() void TASEDITOR_LIST::update()
{ {
//update the number of items in the list //update the number of items in the list
int currLVItemCount = ListView_GetItemCount(hwndList); int currLVItemCount = ListView_GetItemCount(hwndList);
@ -208,7 +221,7 @@ void TASEDIT_LIST::update()
if(currLVItemCount != movie_size) if(currLVItemCount != movie_size)
ListView_SetItemCountEx(hwndList, movie_size, LVSICF_NOSCROLL|LVSICF_NOINVALIDATEALL); ListView_SetItemCountEx(hwndList, movie_size, LVSICF_NOSCROLL|LVSICF_NOINVALIDATEALL);
// once per 40 milliseconds update screenshot_bitmap alpha // once per 40 milliseconds update colors alpha
if (clock() > next_header_update_time) if (clock() > next_header_update_time)
{ {
next_header_update_time = clock() + HEADER_LIGHT_UPDATE_TICK; next_header_update_time = clock() + HEADER_LIGHT_UPDATE_TICK;
@ -255,7 +268,7 @@ void TASEDIT_LIST::update()
} }
} }
void TASEDIT_LIST::save(EMUFILE *os, bool really_save) void TASEDITOR_LIST::save(EMUFILE *os, bool really_save)
{ {
if (really_save) if (really_save)
{ {
@ -272,7 +285,7 @@ void TASEDIT_LIST::save(EMUFILE *os, bool really_save)
} }
} }
// returns true if couldn't load // returns true if couldn't load
bool TASEDIT_LIST::load(EMUFILE *is) bool TASEDITOR_LIST::load(EMUFILE *is)
{ {
update(); update();
// read "LIST" string // read "LIST" string
@ -298,7 +311,7 @@ error:
return true; return true;
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
void TASEDIT_LIST::AddFourscore() void TASEDITOR_LIST::AddFourscore()
{ {
// add list columns // add list columns
LVCOLUMN lvc; LVCOLUMN lvc;
@ -320,7 +333,7 @@ void TASEDIT_LIST::AddFourscore()
// change eoptions // change eoptions
FCEUI_SetInputFourscore(true); FCEUI_SetInputFourscore(true);
} }
void TASEDIT_LIST::RemoveFourscore() void TASEDITOR_LIST::RemoveFourscore()
{ {
// remove list columns // remove list columns
for (num_columns = COLUMN_FRAMENUM2; num_columns >= COLUMN_JOYPAD3_A; num_columns--) for (num_columns = COLUMN_FRAMENUM2; num_columns >= COLUMN_JOYPAD3_A; num_columns--)
@ -329,21 +342,21 @@ void TASEDIT_LIST::RemoveFourscore()
FCEUI_SetInputFourscore(false); FCEUI_SetInputFourscore(false);
} }
void TASEDIT_LIST::RedrawList() void TASEDITOR_LIST::RedrawList()
{ {
InvalidateRect(hwndList, 0, FALSE); InvalidateRect(hwndList, 0, FALSE);
} }
void TASEDIT_LIST::RedrawRow(int index) void TASEDITOR_LIST::RedrawRow(int index)
{ {
ListView_RedrawItems(hwndList, index, index); ListView_RedrawItems(hwndList, index, index);
} }
void TASEDIT_LIST::RedrawHeader() void TASEDITOR_LIST::RedrawHeader()
{ {
InvalidateRect(hwndHeader, 0, FALSE); InvalidateRect(hwndHeader, 0, FALSE);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
bool TASEDIT_LIST::CheckItemVisible(int frame) bool TASEDITOR_LIST::CheckItemVisible(int frame)
{ {
int top = ListView_GetTopIndex(hwndList); int top = ListView_GetTopIndex(hwndList);
// in fourscore there's horizontal scrollbar which takes one row for itself // in fourscore there's horizontal scrollbar which takes one row for itself
@ -352,7 +365,7 @@ bool TASEDIT_LIST::CheckItemVisible(int frame)
return false; return false;
} }
void TASEDIT_LIST::FollowPlayback() void TASEDITOR_LIST::FollowPlayback()
{ {
// center list at jump_frame // center list at jump_frame
int list_items = ListView_GetCountPerPage(hwndList); int list_items = ListView_GetCountPerPage(hwndList);
@ -367,14 +380,14 @@ void TASEDIT_LIST::FollowPlayback()
index = 0; index = 0;
ListView_EnsureVisible(hwndList, index, false); ListView_EnsureVisible(hwndList, index, false);
} }
void TASEDIT_LIST::FollowPlaybackIfNeeded() void TASEDITOR_LIST::FollowPlaybackIfNeeded()
{ {
if (TASEdit_follow_playback) ListView_EnsureVisible(hwndList,currFrameCounter,FALSE); if (taseditor_config.follow_playback) ListView_EnsureVisible(hwndList,currFrameCounter,FALSE);
} }
void TASEDIT_LIST::FollowUndo() void TASEDITOR_LIST::FollowUndo()
{ {
int jump_frame = history.GetUndoHint(); int jump_frame = history.GetUndoHint();
if (TASEdit_jump_to_undo && jump_frame >= 0) if (taseditor_config.jump_to_undo && jump_frame >= 0)
{ {
if (!CheckItemVisible(jump_frame)) if (!CheckItemVisible(jump_frame))
{ {
@ -393,7 +406,7 @@ void TASEDIT_LIST::FollowUndo()
} }
} }
} }
void TASEDIT_LIST::FollowSelection() void TASEDITOR_LIST::FollowSelection()
{ {
SelectionFrames* current_selection = selection.MakeStrobe(); SelectionFrames* current_selection = selection.MakeStrobe();
if (current_selection->size() == 0) return; if (current_selection->size() == 0) return;
@ -432,7 +445,7 @@ void TASEDIT_LIST::FollowSelection()
ListView_EnsureVisible(hwndList, index, false); ListView_EnsureVisible(hwndList, index, false);
} }
} }
void TASEDIT_LIST::FollowPauseframe() void TASEDITOR_LIST::FollowPauseframe()
{ {
int jump_frame = playback.GetPauseFrame(); int jump_frame = playback.GetPauseFrame();
if (jump_frame >= 0) if (jump_frame >= 0)
@ -452,7 +465,7 @@ void TASEDIT_LIST::FollowPauseframe()
} }
} }
void TASEDIT_LIST::SetHeaderColumnLight(int column, int level) void TASEDITOR_LIST::SetHeaderColumnLight(int column, int level)
{ {
if (column < COLUMN_FRAMENUM || column >= num_columns || level < 0 || level > HEADER_LIGHT_MAX) if (column < COLUMN_FRAMENUM || column >= num_columns || level < 0 || level > HEADER_LIGHT_MAX)
return; return;
@ -465,7 +478,7 @@ void TASEDIT_LIST::SetHeaderColumnLight(int column, int level)
} }
} }
void TASEDIT_LIST::GetDispInfo(NMLVDISPINFO* nmlvDispInfo) void TASEDITOR_LIST::GetDispInfo(NMLVDISPINFO* nmlvDispInfo)
{ {
LVITEM& item = nmlvDispInfo->item; LVITEM& item = nmlvDispInfo->item;
if(item.mask & LVIF_TEXT) if(item.mask & LVIF_TEXT)
@ -509,7 +522,7 @@ void TASEDIT_LIST::GetDispInfo(NMLVDISPINFO* nmlvDispInfo)
item.pszText[2] = 0; item.pszText[2] = 0;
} else } else
{ {
if (TASEdit_enable_hot_changes && history.GetCurrentSnapshot().GetHotChangeInfo(item.iItem, item.iSubItem - COLUMN_JOYPAD1_A)) if (taseditor_config.enable_hot_changes && history.GetCurrentSnapshot().GetHotChangeInfo(item.iItem, item.iSubItem - COLUMN_JOYPAD1_A))
{ {
item.pszText[0] = 45; // "-" item.pszText[0] = 45; // "-"
item.pszText[1] = 0; item.pszText[1] = 0;
@ -521,7 +534,7 @@ void TASEDIT_LIST::GetDispInfo(NMLVDISPINFO* nmlvDispInfo)
} }
} }
LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg) LONG TASEDITOR_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
{ {
int cell_x, cell_y; int cell_x, cell_y;
switch(msg->nmcd.dwDrawStage) switch(msg->nmcd.dwDrawStage)
@ -537,7 +550,7 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
if(cell_x > COLUMN_ICONS) if(cell_x > COLUMN_ICONS)
{ {
// text color // text color
if(TASEdit_enable_hot_changes && cell_x >= COLUMN_JOYPAD1_A && cell_x <= COLUMN_JOYPAD4_R) if(taseditor_config.enable_hot_changes && cell_x >= COLUMN_JOYPAD1_A && cell_x <= COLUMN_JOYPAD4_R)
msg->clrText = hot_changes_colors[history.GetCurrentSnapshot().GetHotChangeInfo(cell_y, cell_x - COLUMN_JOYPAD1_A)]; msg->clrText = hot_changes_colors[history.GetCurrentSnapshot().GetHotChangeInfo(cell_y, cell_x - COLUMN_JOYPAD1_A)];
else else
msg->clrText = NORMAL_TEXT_COLOR; msg->clrText = NORMAL_TEXT_COLOR;
@ -554,9 +567,9 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
if (cell_y == history.GetUndoHint()) if (cell_y == history.GetUndoHint())
{ {
// undo hint here // undo hint here
if (TASEdit_show_markers && current_markers.GetMarker(cell_y)) if (taseditor_config.show_markers && current_markers.GetMarker(cell_y))
{ {
msg->clrTextBk = (TASEdit_bind_markers) ? BINDMARKED_UNDOHINT_FRAMENUM_COLOR : MARKED_UNDOHINT_FRAMENUM_COLOR; msg->clrTextBk = (taseditor_config.bind_markers) ? BINDMARKED_UNDOHINT_FRAMENUM_COLOR : MARKED_UNDOHINT_FRAMENUM_COLOR;
} else } else
{ {
msg->clrTextBk = UNDOHINT_FRAMENUM_COLOR; msg->clrTextBk = UNDOHINT_FRAMENUM_COLOR;
@ -564,24 +577,24 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
} else if (cell_y == currFrameCounter || cell_y == (playback.GetPauseFrame() - 1)) } else if (cell_y == currFrameCounter || cell_y == (playback.GetPauseFrame() - 1))
{ {
// current frame // current frame
if (TASEdit_show_markers && current_markers.GetMarker(cell_y)) if (taseditor_config.show_markers && current_markers.GetMarker(cell_y))
{ {
msg->clrTextBk = (TASEdit_bind_markers) ? CUR_BINDMARKED_FRAMENUM_COLOR : CUR_MARKED_FRAMENUM_COLOR; msg->clrTextBk = (taseditor_config.bind_markers) ? CUR_BINDMARKED_FRAMENUM_COLOR : CUR_MARKED_FRAMENUM_COLOR;
} else } else
{ {
msg->clrTextBk = CUR_FRAMENUM_COLOR; msg->clrTextBk = CUR_FRAMENUM_COLOR;
} }
} else if (TASEdit_show_markers && current_markers.GetMarker(cell_y)) } else if (taseditor_config.show_markers && current_markers.GetMarker(cell_y))
{ {
// marked frame // marked frame
msg->clrTextBk = (TASEdit_bind_markers) ? BINDMARKED_FRAMENUM_COLOR : MARKED_FRAMENUM_COLOR; msg->clrTextBk = (taseditor_config.bind_markers) ? BINDMARKED_FRAMENUM_COLOR : MARKED_FRAMENUM_COLOR;
} else } else
{ {
if(cell_y < greenzone.greenZoneCount) if(cell_y < greenzone.greenZoneCount)
{ {
if (!greenzone.savestates[cell_y].empty()) if (!greenzone.savestates[cell_y].empty())
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[cell_y]) if (taseditor_config.show_lag_frames && greenzone.lag_history[cell_y])
msg->clrTextBk = LAG_FRAMENUM_COLOR; msg->clrTextBk = LAG_FRAMENUM_COLOR;
else else
msg->clrTextBk = GREENZONE_FRAMENUM_COLOR; msg->clrTextBk = GREENZONE_FRAMENUM_COLOR;
@ -590,7 +603,7 @@ LONG TASEDIT_LIST::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 & 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())) || (!greenzone.savestates[cell_y & EVERY2ND].empty() && !greenzone.savestates[(cell_y | 0x1) + 1].empty()))
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[cell_y]) if (taseditor_config.show_lag_frames && greenzone.lag_history[cell_y])
msg->clrTextBk = PALE_LAG_FRAMENUM_COLOR; msg->clrTextBk = PALE_LAG_FRAMENUM_COLOR;
else else
msg->clrTextBk = PALE_GREENZONE_FRAMENUM_COLOR; msg->clrTextBk = PALE_GREENZONE_FRAMENUM_COLOR;
@ -615,7 +628,7 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
{ {
if (!greenzone.savestates[cell_y].empty()) if (!greenzone.savestates[cell_y].empty())
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[cell_y]) if (taseditor_config.show_lag_frames && greenzone.lag_history[cell_y])
msg->clrTextBk = LAG_INPUT_COLOR1; msg->clrTextBk = LAG_INPUT_COLOR1;
else else
msg->clrTextBk = GREENZONE_INPUT_COLOR1; msg->clrTextBk = GREENZONE_INPUT_COLOR1;
@ -624,7 +637,7 @@ LONG TASEDIT_LIST::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 & 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())) || (!greenzone.savestates[cell_y & EVERY2ND].empty() && !greenzone.savestates[(cell_y | 0x1) + 1].empty()))
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[cell_y]) if (taseditor_config.show_lag_frames && greenzone.lag_history[cell_y])
msg->clrTextBk = PALE_LAG_INPUT_COLOR1; msg->clrTextBk = PALE_LAG_INPUT_COLOR1;
else else
msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR1; msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR1;
@ -648,7 +661,7 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
{ {
if (!greenzone.savestates[cell_y].empty()) if (!greenzone.savestates[cell_y].empty())
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[cell_y]) if (taseditor_config.show_lag_frames && greenzone.lag_history[cell_y])
msg->clrTextBk = LAG_INPUT_COLOR2; msg->clrTextBk = LAG_INPUT_COLOR2;
else else
msg->clrTextBk = GREENZONE_INPUT_COLOR2; msg->clrTextBk = GREENZONE_INPUT_COLOR2;
@ -657,7 +670,7 @@ LONG TASEDIT_LIST::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 & 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())) || (!greenzone.savestates[cell_y & EVERY2ND].empty() && !greenzone.savestates[(cell_y | 0x1) + 1].empty()))
{ {
if (TASEdit_show_lag_frames && greenzone.lag_history[cell_y]) if (taseditor_config.show_lag_frames && greenzone.lag_history[cell_y])
msg->clrTextBk = PALE_LAG_INPUT_COLOR2; msg->clrTextBk = PALE_LAG_INPUT_COLOR2;
else else
msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR2; msg->clrTextBk = PALE_GREENZONE_INPUT_COLOR2;
@ -670,7 +683,7 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
} }
} }
LONG TASEDIT_LIST::HeaderCustomDraw(NMLVCUSTOMDRAW* msg) LONG TASEDITOR_LIST::HeaderCustomDraw(NMLVCUSTOMDRAW* msg)
{ {
switch(msg->nmcd.dwDrawStage) switch(msg->nmcd.dwDrawStage)
{ {
@ -720,7 +733,7 @@ LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
//The subclass wndproc for the listview //The subclass wndproc for the listview
LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
switch(msg) switch(msg)
{ {
case WM_CHAR: case WM_CHAR:
@ -728,7 +741,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_NOTIFY: case WM_NOTIFY:
{ {
if (((LPNMHDR)lParam)->hwndFrom == tasedit_list.hwndHeader) if (((LPNMHDR)lParam)->hwndFrom == list.hwndHeader)
{ {
switch (((LPNMHDR)lParam)->code) switch (((LPNMHDR)lParam)->code)
{ {
@ -737,14 +750,14 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case HDN_TRACK: case HDN_TRACK:
return true; // no column resizing return true; // no column resizing
case NM_CUSTOMDRAW: case NM_CUSTOMDRAW:
return tasedit_list.HeaderCustomDraw((NMLVCUSTOMDRAW*)lParam); return list.HeaderCustomDraw((NMLVCUSTOMDRAW*)lParam);
} }
} }
break; break;
} }
case WM_KEYDOWN: case WM_KEYDOWN:
{ {
if (!TASEdit_keyboard_for_listview) if (!taseditor_config.keyboard_for_listview)
return 0; return 0;
break; break;
} }

View File

@ -1,4 +1,4 @@
//Specification file for TASEDIT_LIST class //Specification file for TASEDITOR_LIST class
#define LIST_ID_LEN 5 #define LIST_ID_LEN 5
#define CDDS_SUBITEMPREPAINT (CDDS_SUBITEM | CDDS_ITEMPREPAINT) #define CDDS_SUBITEMPREPAINT (CDDS_SUBITEM | CDDS_ITEMPREPAINT)
@ -94,10 +94,10 @@
#define PLAYBACK_MARKER_COLOR 0xC9AF00 #define PLAYBACK_MARKER_COLOR 0xC9AF00
class TASEDIT_LIST class TASEDITOR_LIST
{ {
public: public:
TASEDIT_LIST(); TASEDITOR_LIST();
void init(); void init();
void free(); void free();
void reset(); void reset();

View File

@ -0,0 +1,193 @@
//Implementation file of TASEDITOR_LUA class
#include "taseditor_project.h"
extern TASEDITOR_WINDOW taseditor_window;
extern INPUT_HISTORY history;
extern MARKERS current_markers;
extern BOOKMARKS bookmarks;
extern RECORDER recorder;
extern PLAYBACK playback;
extern TASEDITOR_LIST list;
extern TASEDITOR_SELECTION selection;
extern void TaseditorUpdateManualFunctionStatus();
TASEDITOR_LUA::TASEDITOR_LUA()
{
}
void TASEDITOR_LUA::init()
{
hwndRunFunction = GetDlgItem(taseditor_window.hwndTasEditor, TASEDIT_RUN_MANUAL);
TaseditorUpdateManualFunctionStatus();
reset();
}
void TASEDITOR_LUA::reset()
{
}
void TASEDITOR_LUA::update()
{
}
void TASEDITOR_LUA::EnableRunFunction()
{
EnableWindow(hwndRunFunction, true);
}
void TASEDITOR_LUA::DisableRunFunction()
{
EnableWindow(hwndRunFunction, false);
}
// --------------------------------------------------------------------------------
// Lua functions of taseditor library
// bool taseditor.engaged()
bool TASEDITOR_LUA::engaged()
{
return FCEUMOV_Mode(MOVIEMODE_TASEDIT);
}
// bool taseditor.markedframe(int frame)
bool TASEDITOR_LUA::markedframe(int frame)
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
return current_markers.GetMarker(frame) != 0;
else
return false;
}
// int taseditor.getmarker(int frame)
int TASEDITOR_LUA::getmarker(int frame)
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
return current_markers.GetMarkerUp(frame);
else
return -1;
}
// int taseditor.setmarker(int frame)
int TASEDITOR_LUA::setmarker(int frame)
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
{
int marker_id = current_markers.GetMarker(frame);
if(!marker_id)
{
marker_id = current_markers.SetMarker(frame);
if (marker_id)
{
// new marker was created - register changes in TAS Editor
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_SET, frame);
selection.must_find_current_marker = playback.must_find_current_marker = true;
list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
}
}
return marker_id;
} else
return -1;
}
// taseditor.clearmarker(int frame)
void TASEDITOR_LUA::clearmarker(int frame)
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
{
if (current_markers.GetMarker(frame))
{
current_markers.ClearMarker(frame);
// marker was deleted - register changes in TAS Editor
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_UNSET, frame);
selection.must_find_current_marker = playback.must_find_current_marker = true;
list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
}
}
}
// string taseditor.getnote(int index)
const char* TASEDITOR_LUA::getnote(int index)
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
return current_markers.GetNote(index).c_str();
else
return NULL;
}
// taseditor.setnote(int index, string newtext)
void TASEDITOR_LUA::setnote(int index, const char* newtext)
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
{
// rename only if newtext is different from old text
char text[MAX_NOTE_LEN];
strncpy(text, newtext, MAX_NOTE_LEN - 1);
if (strcmp(current_markers.GetNote(index).c_str(), text))
{
// text differs from old note - rename
current_markers.SetNote(index, text);
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_RENAME, current_markers.GetMarkerFrame(index));
selection.must_find_current_marker = playback.must_find_current_marker = true;
}
}
}
// int taseditor.getcurrentbranch()
int TASEDITOR_LUA::getcurrentbranch()
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
return bookmarks.GetCurrentBranch();
else
return -1;
}
// string taseditor.getrecordermode()
const char* TASEDITOR_LUA::getrecordermode()
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
return recorder.GetRecordingMode();
else
return NULL;
}
// int taseditor.getplaybacktarget()
int TASEDITOR_LUA::getplaybacktarget()
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
return playback.pause_frame - 1;
else
return -1;
}
// taseditor.setplayback()
void TASEDITOR_LUA::setplayback(int frame)
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
playback.JumpToFrame(frame); // do not trigger lua functions after jump
}
// taseditor.stopseeking()
void TASEDITOR_LUA::stopseeking()
{
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
playback.SeekingStop();
}
// --------------------------------------------------------------------------------

View File

@ -0,0 +1,32 @@
//Specification file for TASEDITOR_LUA class
class TASEDITOR_LUA
{
public:
TASEDITOR_LUA();
void init();
void reset();
void update();
void EnableRunFunction();
void DisableRunFunction();
// Taseditor Lua library
bool engaged();
bool markedframe(int frame);
int getmarker(int frame);
int setmarker(int frame);
void clearmarker(int frame);
const char* getnote(int index);
void setnote(int index, const char* newtext);
int getcurrentbranch();
const char* getrecordermode();
int getplaybacktarget();
void setplayback(int frame);
void stopseeking();
private:
HWND hwndRunFunction;
};

View File

@ -1,38 +1,29 @@
//Implementation file of TASEdit Project class //Implementation file of TASEDITOR_PROJECT class
#include "taseditproj.h" #include "taseditor_project.h"
#include "utils/xstring.h" #include "utils/xstring.h"
#include "version.h" #include "version.h"
#define MARKERS_SAVED 1 extern TASEDITOR_CONFIG taseditor_config;
#define BOOKMARKS_SAVED 2 extern TASEDITOR_WINDOW taseditor_window;
#define GREENZONE_SAVED 4
#define HISTORY_SAVED 8
#define LIST_SAVED 16
#define SELECTION_SAVED 32
#define ALL_SAVED MARKERS_SAVED|BOOKMARKS_SAVED|GREENZONE_SAVED|HISTORY_SAVED|LIST_SAVED|SELECTION_SAVED
extern MARKERS current_markers; extern MARKERS current_markers;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern SCREENSHOT_DISPLAY screenshot_display; extern POPUP_DISPLAY popup_display;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern PLAYBACK playback; extern PLAYBACK playback;
extern RECORDER recorder; extern RECORDER recorder;
extern INPUT_HISTORY history; extern INPUT_HISTORY history;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
extern void FCEU_printf(char *format, ...);
extern void FCEU_PrintError(char *format, ...); extern void FCEU_PrintError(char *format, ...);
extern bool SaveProject(); extern bool SaveProject();
extern void RedrawWindowCaption(); extern bool SaveProjectAs();
extern int TASEdit_autosave_period; TASEDITOR_PROJECT::TASEDITOR_PROJECT()
TASEDIT_PROJECT::TASEDIT_PROJECT()
{ {
} }
void TASEDIT_PROJECT::init() void TASEDITOR_PROJECT::init()
{ {
// init new project // init new project
projectFile = ""; projectFile = "";
@ -41,24 +32,27 @@ void TASEDIT_PROJECT::init()
reset(); reset();
} }
void TASEDIT_PROJECT::reset() void TASEDITOR_PROJECT::reset()
{ {
changed = false; changed = false;
} }
void TASEDIT_PROJECT::update() void TASEDITOR_PROJECT::update()
{ {
// if it's time to autosave - save // if it's time to autosave - pop Save As dialog
if (changed && TASEdit_autosave_period && clock() >= next_save_shedule) if (changed && taseditor_config.autosave_period && clock() >= next_save_shedule)
{ {
SaveProject(); if (taseditor_config.silent_autosave)
SaveProject();
else
SaveProjectAs();
// in case user pressed Cancel, postpone saving to next time // in case user pressed Cancel, postpone saving to next time
SheduleNextAutosave(); SheduleNextAutosave();
} }
} }
bool TASEDIT_PROJECT::save() bool TASEDITOR_PROJECT::save()
{ {
std::string PFN = GetProjectFile(); std::string PFN = GetProjectFile();
if (PFN.empty()) return false; if (PFN.empty()) return false;
@ -75,7 +69,7 @@ bool TASEDIT_PROJECT::save()
bookmarks.save(ofs); bookmarks.save(ofs);
greenzone.save(ofs); greenzone.save(ofs);
history.save(ofs); history.save(ofs);
tasedit_list.save(ofs); list.save(ofs);
selection.save(ofs); selection.save(ofs);
delete ofs; delete ofs;
@ -84,7 +78,7 @@ bool TASEDIT_PROJECT::save()
this->reset(); this->reset();
return true; return true;
} }
bool TASEDIT_PROJECT::save_compact(char* filename, bool save_binary, bool save_markers, bool save_bookmarks, bool save_greenzone, bool save_history, bool save_list, bool save_selection) bool TASEDITOR_PROJECT::save_compact(char* filename, bool save_binary, bool save_markers, bool save_bookmarks, bool save_greenzone, bool save_history, bool save_list, bool save_selection)
{ {
EMUFILE_FILE* ofs = FCEUD_UTF8_fstream(filename,"wb"); EMUFILE_FILE* ofs = FCEUD_UTF8_fstream(filename,"wb");
@ -104,7 +98,7 @@ bool TASEDIT_PROJECT::save_compact(char* filename, bool save_binary, bool save_m
bookmarks.save(ofs, save_bookmarks); bookmarks.save(ofs, save_bookmarks);
greenzone.save(ofs, save_greenzone); greenzone.save(ofs, save_greenzone);
history.save(ofs, save_history); history.save(ofs, save_history);
tasedit_list.save(ofs, save_list); list.save(ofs, save_list);
selection.save(ofs, save_selection); selection.save(ofs, save_selection);
delete ofs; delete ofs;
@ -112,7 +106,7 @@ bool TASEDIT_PROJECT::save_compact(char* filename, bool save_binary, bool save_m
playback.updateProgressbar(); playback.updateProgressbar();
return true; return true;
} }
bool TASEDIT_PROJECT::load(char* fullname) bool TASEDITOR_PROJECT::load(char* fullname)
{ {
EMUFILE_FILE ifs(fullname, "rb"); EMUFILE_FILE ifs(fullname, "rb");
@ -145,19 +139,19 @@ bool TASEDIT_PROJECT::load(char* fullname)
bookmarks.load(&ifs); bookmarks.load(&ifs);
greenzone.load(&ifs); greenzone.load(&ifs);
history.load(&ifs); history.load(&ifs);
tasedit_list.load(&ifs); list.load(&ifs);
selection.load(&ifs); selection.load(&ifs);
playback.reset(); playback.reset();
recorder.reset(); recorder.reset();
screenshot_display.reset(); popup_display.reset();
reset(); reset();
RenameProject(fullname); RenameProject(fullname);
return true; return true;
} }
void TASEDIT_PROJECT::RenameProject(char* new_fullname) void TASEDITOR_PROJECT::RenameProject(char* new_fullname)
{ {
projectFile = new_fullname; projectFile = new_fullname;
char drv[512], dir[512], name[512], ext[512]; // For getting the filename char drv[512], dir[512], name[512], ext[512]; // For getting the filename
@ -168,35 +162,35 @@ void TASEDIT_PROJECT::RenameProject(char* new_fullname)
fm2FileName = thisfm2name; fm2FileName = thisfm2name;
} }
// ----------------------------------------------------------------- // -----------------------------------------------------------------
std::string TASEDIT_PROJECT::GetProjectFile() std::string TASEDITOR_PROJECT::GetProjectFile()
{ {
return projectFile; return projectFile;
} }
std::string TASEDIT_PROJECT::GetProjectName() std::string TASEDITOR_PROJECT::GetProjectName()
{ {
return projectName; return projectName;
} }
std::string TASEDIT_PROJECT::GetFM2Name() std::string TASEDITOR_PROJECT::GetFM2Name()
{ {
return fm2FileName; return fm2FileName;
} }
void TASEDIT_PROJECT::SetProjectChanged() void TASEDITOR_PROJECT::SetProjectChanged()
{ {
if (!changed) if (!changed)
{ {
changed = true; changed = true;
RedrawWindowCaption(); taseditor_window.RedrawCaption();
SheduleNextAutosave(); SheduleNextAutosave();
} }
} }
bool TASEDIT_PROJECT::GetProjectChanged() bool TASEDITOR_PROJECT::GetProjectChanged()
{ {
return changed; return changed;
} }
void TASEDIT_PROJECT::SheduleNextAutosave() void TASEDITOR_PROJECT::SheduleNextAutosave()
{ {
if (TASEdit_autosave_period) if (taseditor_config.autosave_period)
next_save_shedule = clock() + TASEdit_autosave_period * AUTOSAVE_PERIOD_SCALE; next_save_shedule = clock() + taseditor_config.autosave_period * AUTOSAVE_PERIOD_SCALE;
} }

View File

@ -1,10 +1,12 @@
//Specification file for the TASEdit Project class //Specification file for the TASEDITOR_PROJECT class
#include <set> #include <set>
typedef std::set<int> SelectionFrames; typedef std::set<int> SelectionFrames;
#include <time.h> #include <time.h>
#include "movie.h" #include "movie.h"
#include "../common.h" #include "../common.h"
#include "taseditor_config.h"
#include "taseditor_window.h"
#include "markers.h" #include "markers.h"
#include "inputsnapshot.h" #include "inputsnapshot.h"
#include "inputhistory.h" #include "inputhistory.h"
@ -12,16 +14,25 @@ typedef std::set<int> SelectionFrames;
#include "recorder.h" #include "recorder.h"
#include "greenzone.h" #include "greenzone.h"
#include "bookmarks.h" #include "bookmarks.h"
#include "tasedit_list.h" #include "taseditor_list.h"
#include "tasedit_sel.h" #include "taseditor_lua.h"
#include "screenshot_display.h" #include "taseditor_sel.h"
#include "popup_display.h"
#define AUTOSAVE_PERIOD_SCALE 60000 // = 1 minute in milliseconds #define AUTOSAVE_PERIOD_SCALE 60000 // = 1 minute in milliseconds
class TASEDIT_PROJECT #define MARKERS_SAVED 1
#define BOOKMARKS_SAVED 2
#define GREENZONE_SAVED 4
#define HISTORY_SAVED 8
#define LIST_SAVED 16
#define SELECTION_SAVED 32
#define ALL_SAVED MARKERS_SAVED|BOOKMARKS_SAVED|GREENZONE_SAVED|HISTORY_SAVED|LIST_SAVED|SELECTION_SAVED
class TASEDITOR_PROJECT
{ {
public: public:
TASEDIT_PROJECT(); TASEDITOR_PROJECT();
void init(); void init();
void reset(); void reset();
void update(); void update();

View File

@ -1,16 +1,13 @@
//Implementation file of TASEDIT_SELECTION class //Implementation file of TASEDITOR_SELECTION class
#include "taseditproj.h" #include "taseditor_project.h"
#include "..\tasedit.h" // only for MARKER_NOTE_EDIT_LOWER #include "..\tasedit.h" // only for MARKER_NOTE_EDIT_LOWER
char selection_save_id[SELECTION_ID_LEN] = "SELECTION"; extern TASEDITOR_CONFIG taseditor_config;
char selection_skipsave_id[SELECTION_ID_LEN] = "SELECTIOX"; extern TASEDITOR_WINDOW taseditor_window;
extern HWND hwndTasEdit;
extern int TasEdit_undo_levels;
extern int marker_note_edit;
extern MARKERS current_markers; extern MARKERS current_markers;
extern TASEDIT_LIST tasedit_list; extern TASEDITOR_LIST list;
extern int marker_note_edit;
extern void UpdateMarkerNote(); extern void UpdateMarkerNote();
@ -18,6 +15,9 @@ LRESULT APIENTRY LowerMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
WNDPROC selectionMarkerEdit_oldWndproc; WNDPROC selectionMarkerEdit_oldWndproc;
// resources // resources
char selection_save_id[SELECTION_ID_LEN] = "SELECTION";
char selection_skipsave_id[SELECTION_ID_LEN] = "SELECTIOX";
char selectionText[] = "Selection: "; char selectionText[] = "Selection: ";
char selectionEmptyText[] = "Selection: no"; char selectionEmptyText[] = "Selection: no";
char numTextRow[] = "1 row, "; char numTextRow[] = "1 row, ";
@ -28,21 +28,21 @@ char clipboardText[] = "Clipboard: ";
char clipboardEmptyText[] = "Clipboard: empty"; char clipboardEmptyText[] = "Clipboard: empty";
char lowerMarkerText[] = "Marker "; char lowerMarkerText[] = "Marker ";
TASEDIT_SELECTION::TASEDIT_SELECTION() TASEDITOR_SELECTION::TASEDITOR_SELECTION()
{ {
} }
void TASEDIT_SELECTION::init() void TASEDITOR_SELECTION::init()
{ {
hwndPrevMarker = GetDlgItem(hwndTasEdit, TASEDIT_PREV_MARKER); hwndPrevMarker = GetDlgItem(taseditor_window.hwndTasEditor, TASEDIT_PREV_MARKER);
hwndNextMarker = GetDlgItem(hwndTasEdit, TASEDIT_NEXT_MARKER); hwndNextMarker = GetDlgItem(taseditor_window.hwndTasEditor, TASEDIT_NEXT_MARKER);
hwndTextSelection = GetDlgItem(hwndTasEdit, IDC_TEXT_SELECTION); hwndTextSelection = GetDlgItem(taseditor_window.hwndTasEditor, IDC_TEXT_SELECTION);
hwndTextClipboard = GetDlgItem(hwndTasEdit, IDC_TEXT_CLIPBOARD); hwndTextClipboard = GetDlgItem(taseditor_window.hwndTasEditor, IDC_TEXT_CLIPBOARD);
hwndSelectionMarker = GetDlgItem(hwndTasEdit, IDC_SELECTION_MARKER); hwndSelectionMarker = GetDlgItem(taseditor_window.hwndTasEditor, IDC_SELECTION_MARKER);
SendMessage(hwndSelectionMarker, WM_SETFONT, (WPARAM)tasedit_list.hMarkersFont, 0); SendMessage(hwndSelectionMarker, WM_SETFONT, (WPARAM)list.hMarkersFont, 0);
hwndSelectionMarkerEdit = GetDlgItem(hwndTasEdit, IDC_SELECTION_MARKER_EDIT); hwndSelectionMarkerEdit = GetDlgItem(taseditor_window.hwndTasEditor, IDC_SELECTION_MARKER_EDIT);
SendMessage(hwndSelectionMarkerEdit, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0); SendMessage(hwndSelectionMarkerEdit, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0);
SendMessage(hwndSelectionMarkerEdit, WM_SETFONT, (WPARAM)tasedit_list.hMarkersEditFont, 0); SendMessage(hwndSelectionMarkerEdit, WM_SETFONT, (WPARAM)list.hMarkersEditFont, 0);
// subclass the edit control // subclass the edit control
selectionMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndSelectionMarkerEdit, GWL_WNDPROC, (LONG)LowerMarkerEditWndProc); selectionMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndSelectionMarkerEdit, GWL_WNDPROC, (LONG)LowerMarkerEditWndProc);
@ -52,20 +52,20 @@ void TASEDIT_SELECTION::init()
CheckClipboard(); CheckClipboard();
RedrawTextClipboard(); RedrawTextClipboard();
} }
void TASEDIT_SELECTION::free() void TASEDITOR_SELECTION::free()
{ {
// clear history // clear history
selections_history.resize(0); selections_history.resize(0);
history_total_items = 0; history_total_items = 0;
temp_selection.clear(); temp_selection.clear();
} }
void TASEDIT_SELECTION::reset() void TASEDITOR_SELECTION::reset()
{ {
free(); free();
// init vars // init vars
shown_marker = 0; shown_marker = 0;
last_selection_beginning = -1; last_selection_beginning = -1;
history_size = TasEdit_undo_levels + 1; history_size = taseditor_config.undo_levels + 1;
selections_history.resize(history_size); selections_history.resize(history_size);
history_start_pos = 0; history_start_pos = 0;
history_cursor_pos = -1; history_cursor_pos = -1;
@ -74,14 +74,14 @@ void TASEDIT_SELECTION::reset()
track_selection_changes = true; track_selection_changes = true;
reset_vars(); reset_vars();
} }
void TASEDIT_SELECTION::reset_vars() void TASEDITOR_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;
must_find_current_marker = true; must_find_current_marker = true;
} }
void TASEDIT_SELECTION::update() void TASEDITOR_SELECTION::update()
{ {
// keep selection within movie limits // keep selection within movie limits
if (CurrentSelection().size()) if (CurrentSelection().size())
@ -179,7 +179,7 @@ void TASEDIT_SELECTION::update()
} }
void TASEDIT_SELECTION::RedrawTextClipboard() void TASEDITOR_SELECTION::RedrawTextClipboard()
{ {
if (clipboard_selection.size()) if (clipboard_selection.size())
{ {
@ -212,7 +212,7 @@ void TASEDIT_SELECTION::RedrawTextClipboard()
} else } else
SetWindowText(hwndTextClipboard, clipboardEmptyText); SetWindowText(hwndTextClipboard, clipboardEmptyText);
} }
void TASEDIT_SELECTION::RedrawMarker() void TASEDITOR_SELECTION::RedrawMarker()
{ {
// redraw marker num // redraw marker num
char new_text[MAX_NOTE_LEN] = {0}; char new_text[MAX_NOTE_LEN] = {0};
@ -227,7 +227,7 @@ void TASEDIT_SELECTION::RedrawMarker()
SetWindowText(hwndSelectionMarkerEdit, new_text); SetWindowText(hwndSelectionMarkerEdit, new_text);
} }
void TASEDIT_SELECTION::JumpPrevMarker() void TASEDITOR_SELECTION::JumpPrevMarker()
{ {
// jump to previous marker // jump to previous marker
int index = GetCurrentSelectionBeginning(); int index = GetCurrentSelectionBeginning();
@ -239,7 +239,7 @@ void TASEDIT_SELECTION::JumpPrevMarker()
else else
JumpToFrame(0); JumpToFrame(0);
} }
void TASEDIT_SELECTION::JumpNextMarker() void TASEDITOR_SELECTION::JumpNextMarker()
{ {
// jump to next marker // jump to next marker
int index = GetCurrentSelectionBeginning(); int index = GetCurrentSelectionBeginning();
@ -253,14 +253,14 @@ void TASEDIT_SELECTION::JumpNextMarker()
else else
JumpToFrame(last_frame); JumpToFrame(last_frame);
} }
void TASEDIT_SELECTION::JumpToFrame(int frame) void TASEDITOR_SELECTION::JumpToFrame(int frame)
{ {
ClearSelection(); ClearSelection();
SetRowSelection(frame); SetRowSelection(frame);
tasedit_list.FollowSelection(); list.FollowSelection();
} }
// ---------------------------------------------------------- // ----------------------------------------------------------
void TASEDIT_SELECTION::save(EMUFILE *os, bool really_save) void TASEDITOR_SELECTION::save(EMUFILE *os, bool really_save)
{ {
if (really_save) if (really_save)
{ {
@ -283,7 +283,7 @@ void TASEDIT_SELECTION::save(EMUFILE *os, bool really_save)
} }
} }
// returns true if couldn't load // returns true if couldn't load
bool TASEDIT_SELECTION::load(EMUFILE *is) bool TASEDITOR_SELECTION::load(EMUFILE *is)
{ {
// read "SELECTION" string // read "SELECTION" string
char save_id[SELECTION_ID_LEN]; char save_id[SELECTION_ID_LEN];
@ -344,7 +344,7 @@ error:
return true; return true;
} }
void TASEDIT_SELECTION::saveSelection(SelectionFrames& selection, EMUFILE *os) void TASEDITOR_SELECTION::saveSelection(SelectionFrames& selection, EMUFILE *os)
{ {
write32le(selection.size(), os); write32le(selection.size(), os);
if (selection.size()) if (selection.size())
@ -353,7 +353,7 @@ void TASEDIT_SELECTION::saveSelection(SelectionFrames& selection, EMUFILE *os)
write32le(*it, os); write32le(*it, os);
} }
} }
bool TASEDIT_SELECTION::loadSelection(SelectionFrames& selection, EMUFILE *is) bool TASEDITOR_SELECTION::loadSelection(SelectionFrames& selection, EMUFILE *is)
{ {
int temp_int, temp_size; int temp_int, temp_size;
selection.clear(); selection.clear();
@ -366,7 +366,7 @@ bool TASEDIT_SELECTION::loadSelection(SelectionFrames& selection, EMUFILE *is)
} }
return false; return false;
} }
bool TASEDIT_SELECTION::skiploadSelection(EMUFILE *is) bool TASEDITOR_SELECTION::skiploadSelection(EMUFILE *is)
{ {
int temp_size; int temp_size;
if (!read32le(&temp_size, is)) return true; if (!read32le(&temp_size, is)) return true;
@ -375,7 +375,7 @@ bool TASEDIT_SELECTION::skiploadSelection(EMUFILE *is)
} }
// ---------------------------------------------------------- // ----------------------------------------------------------
//used to track selection //used to track selection
void TASEDIT_SELECTION::ItemRangeChanged(NMLVODSTATECHANGE* info) void TASEDITOR_SELECTION::ItemRangeChanged(NMLVODSTATECHANGE* info)
{ {
bool ON = !(info->uOldState & LVIS_SELECTED) && (info->uNewState & LVIS_SELECTED); bool ON = !(info->uOldState & LVIS_SELECTED) && (info->uNewState & LVIS_SELECTED);
bool OFF = (info->uOldState & LVIS_SELECTED) && !(info->uNewState & LVIS_SELECTED); bool OFF = (info->uOldState & LVIS_SELECTED) && !(info->uNewState & LVIS_SELECTED);
@ -389,7 +389,7 @@ void TASEDIT_SELECTION::ItemRangeChanged(NMLVODSTATECHANGE* info)
must_redraw_text = true; must_redraw_text = true;
} }
void TASEDIT_SELECTION::ItemChanged(NMLISTVIEW* info) void TASEDITOR_SELECTION::ItemChanged(NMLISTVIEW* info)
{ {
int item = info->iItem; int item = info->iItem;
@ -423,7 +423,7 @@ void TASEDIT_SELECTION::ItemChanged(NMLISTVIEW* info)
must_redraw_text = true; must_redraw_text = true;
} }
// ---------------------------------------------------------- // ----------------------------------------------------------
void TASEDIT_SELECTION::AddNewSelectionToHistory() void TASEDITOR_SELECTION::AddNewSelectionToHistory()
{ {
// create new empty selection // create new empty selection
SelectionFrames selectionFrames; SelectionFrames selectionFrames;
@ -445,7 +445,7 @@ void TASEDIT_SELECTION::AddNewSelectionToHistory()
selections_history[(history_start_pos + history_cursor_pos) % history_size] = selectionFrames; selections_history[(history_start_pos + history_cursor_pos) % history_size] = selectionFrames;
} }
void TASEDIT_SELECTION::jump(int new_pos) void TASEDITOR_SELECTION::jump(int new_pos)
{ {
if (new_pos < 0) new_pos = 0; else if (new_pos >= history_total_items) new_pos = history_total_items-1; if (new_pos < 0) new_pos = 0; else if (new_pos >= history_total_items) new_pos = history_total_items-1;
if (new_pos == history_cursor_pos) return; if (new_pos == history_cursor_pos) return;
@ -457,22 +457,22 @@ void TASEDIT_SELECTION::jump(int new_pos)
// also keep selection within list // also keep selection within list
update(); update();
} }
void TASEDIT_SELECTION::undo() void TASEDITOR_SELECTION::undo()
{ {
jump(history_cursor_pos - 1); jump(history_cursor_pos - 1);
} }
void TASEDIT_SELECTION::redo() void TASEDITOR_SELECTION::redo()
{ {
jump(history_cursor_pos + 1); jump(history_cursor_pos + 1);
} }
void TASEDIT_SELECTION::MemorizeClipboardSelection() void TASEDITOR_SELECTION::MemorizeClipboardSelection()
{ {
// copy currently strobed selection data to clipboard_selection // copy currently strobed selection data to clipboard_selection
clipboard_selection = temp_selection; clipboard_selection = temp_selection;
RedrawTextClipboard(); RedrawTextClipboard();
} }
void TASEDIT_SELECTION::ReselectClipboard() void TASEDITOR_SELECTION::ReselectClipboard()
{ {
if (clipboard_selection.size() == 0) return; if (clipboard_selection.size() == 0) return;
@ -483,9 +483,9 @@ void TASEDIT_SELECTION::ReselectClipboard()
update(); update();
} }
// retrieves some information from clipboard to clipboard_selection // retrieves some information from clipboard to clipboard_selection
void TASEDIT_SELECTION::CheckClipboard() void TASEDITOR_SELECTION::CheckClipboard()
{ {
if (OpenClipboard(hwndTasEdit)) if (OpenClipboard(taseditor_window.hwndTasEditor))
{ {
// check if clipboard contains TAS Editor input data // check if clipboard contains TAS Editor input data
HANDLE hGlobal = GetClipboardData(CF_TEXT); HANDLE hGlobal = GetClipboardData(CF_TEXT);
@ -525,40 +525,40 @@ void TASEDIT_SELECTION::CheckClipboard()
} }
} }
// ---------------------------------------------------------- // ----------------------------------------------------------
void TASEDIT_SELECTION::ClearSelection() void TASEDITOR_SELECTION::ClearSelection()
{ {
ListView_SetItemState(tasedit_list.hwndList, -1, 0, LVIS_FOCUSED|LVIS_SELECTED); ListView_SetItemState(list.hwndList, -1, 0, LVIS_FOCUSED|LVIS_SELECTED);
} }
void TASEDIT_SELECTION::ClearRowSelection(int index) void TASEDITOR_SELECTION::ClearRowSelection(int index)
{ {
ListView_SetItemState(tasedit_list.hwndList, index, 0, LVIS_SELECTED); ListView_SetItemState(list.hwndList, index, 0, LVIS_SELECTED);
} }
void TASEDIT_SELECTION::EnforceSelectionToList() void TASEDITOR_SELECTION::EnforceSelectionToList()
{ {
track_selection_changes = false; track_selection_changes = false;
ClearSelection(); ClearSelection();
for(SelectionFrames::reverse_iterator it(CurrentSelection().rbegin()); it != CurrentSelection().rend(); it++) for(SelectionFrames::reverse_iterator it(CurrentSelection().rbegin()); it != CurrentSelection().rend(); it++)
{ {
ListView_SetItemState(tasedit_list.hwndList, *it, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(list.hwndList, *it, LVIS_SELECTED, LVIS_SELECTED);
} }
track_selection_changes = true; track_selection_changes = true;
} }
void TASEDIT_SELECTION::SelectAll() void TASEDITOR_SELECTION::SelectAll()
{ {
ListView_SetItemState(tasedit_list.hwndList, -1, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(list.hwndList, -1, LVIS_SELECTED, LVIS_SELECTED);
} }
void TASEDIT_SELECTION::SetRowSelection(int index) void TASEDITOR_SELECTION::SetRowSelection(int index)
{ {
ListView_SetItemState(tasedit_list.hwndList, index, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED); ListView_SetItemState(list.hwndList, index, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
} }
void TASEDIT_SELECTION::SetRegionSelection(int start, int end) void TASEDITOR_SELECTION::SetRegionSelection(int start, int end)
{ {
for (int i = start; i <= end; ++i) for (int i = start; i <= end; ++i)
ListView_SetItemState(tasedit_list.hwndList, i, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED); ListView_SetItemState(list.hwndList, i, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
} }
void TASEDIT_SELECTION::SelectMidMarkers() void TASEDITOR_SELECTION::SelectMidMarkers()
{ {
int center, upper_border, lower_border; int center, upper_border, lower_border;
int upper_marker, lower_marker; int upper_marker, lower_marker;
@ -580,7 +580,7 @@ void TASEDIT_SELECTION::SelectMidMarkers()
if (current_markers.GetMarker(lower_marker)) break; if (current_markers.GetMarker(lower_marker)) break;
// clear selection without clearing focused, because otherwise there's strange bug when quickly pressing Ctrl+A right after clicking on already selected row // clear selection without clearing focused, because otherwise there's strange bug when quickly pressing Ctrl+A right after clicking on already selected row
ListView_SetItemState(tasedit_list.hwndList, -1, 0, LVIS_SELECTED); ListView_SetItemState(list.hwndList, -1, 0, LVIS_SELECTED);
// special case // special case
if (upper_marker == -1 && lower_marker == movie_size) if (upper_marker == -1 && lower_marker == movie_size)
@ -595,7 +595,7 @@ void TASEDIT_SELECTION::SelectMidMarkers()
// default: select all between markers // default: select all between markers
for (int i = upper_marker+1; i < lower_marker; ++i) for (int i = upper_marker+1; i < lower_marker; ++i)
{ {
ListView_SetItemState(tasedit_list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
} }
} else if (upper_border == upper_marker+1 && lower_border == lower_marker-1) } else if (upper_border == upper_marker+1 && lower_border == lower_marker-1)
{ {
@ -604,14 +604,14 @@ void TASEDIT_SELECTION::SelectMidMarkers()
if (lower_marker >= movie_size) lower_marker = movie_size - 1; if (lower_marker >= movie_size) lower_marker = movie_size - 1;
for (int i = upper_marker; i <= lower_marker; ++i) for (int i = upper_marker; i <= lower_marker; ++i)
{ {
ListView_SetItemState(tasedit_list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
} }
} else if (upper_border <= upper_marker && lower_border >= lower_marker) } else if (upper_border <= upper_marker && lower_border >= lower_marker)
{ {
// selected all between markers and both markers selected too - now deselect lower marker // selected all between markers and both markers selected too - now deselect lower marker
for (int i = upper_marker; i < lower_marker; ++i) for (int i = upper_marker; i < lower_marker; ++i)
{ {
ListView_SetItemState(tasedit_list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
} }
} else if (upper_border == upper_marker && lower_border == lower_marker-1) } else if (upper_border == upper_marker && lower_border == lower_marker-1)
{ {
@ -619,52 +619,52 @@ void TASEDIT_SELECTION::SelectMidMarkers()
if (lower_marker >= movie_size) lower_marker = movie_size - 1; if (lower_marker >= movie_size) lower_marker = movie_size - 1;
for (int i = upper_marker+1; i <= lower_marker; ++i) for (int i = upper_marker+1; i <= lower_marker; ++i)
{ {
ListView_SetItemState(tasedit_list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
} }
} else if (upper_border == upper_marker+1 && lower_border == lower_marker) } else if (upper_border == upper_marker+1 && lower_border == lower_marker)
{ {
// selected all between markers and lower marker selected too - now deselect lower marker (return to "selected all between markers") // selected all between markers and lower marker selected too - now deselect lower marker (return to "selected all between markers")
for (int i = upper_marker + 1; i < lower_marker; ++i) for (int i = upper_marker + 1; i < lower_marker; ++i)
{ {
ListView_SetItemState(tasedit_list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED); ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
} }
} }
} }
// getters // getters
int TASEDIT_SELECTION::GetCurrentSelectionSize() int TASEDITOR_SELECTION::GetCurrentSelectionSize()
{ {
return selections_history[(history_start_pos + history_cursor_pos) % history_size].size(); return selections_history[(history_start_pos + history_cursor_pos) % history_size].size();
} }
int TASEDIT_SELECTION::GetCurrentSelectionBeginning() int TASEDITOR_SELECTION::GetCurrentSelectionBeginning()
{ {
if (selections_history[(history_start_pos + history_cursor_pos) % history_size].size()) if (selections_history[(history_start_pos + history_cursor_pos) % history_size].size())
return *selections_history[(history_start_pos + history_cursor_pos) % history_size].begin(); return *selections_history[(history_start_pos + history_cursor_pos) % history_size].begin();
else else
return -1; return -1;
} }
bool TASEDIT_SELECTION::CheckFrameSelected(int frame) bool TASEDITOR_SELECTION::CheckFrameSelected(int frame)
{ {
if(CurrentSelection().find(frame) == CurrentSelection().end()) if(CurrentSelection().find(frame) == CurrentSelection().end())
return false; return false;
return true; return true;
} }
SelectionFrames* TASEDIT_SELECTION::MakeStrobe() SelectionFrames* TASEDITOR_SELECTION::MakeStrobe()
{ {
// copy current selection to temp_selection // copy current selection to temp_selection
temp_selection = selections_history[(history_start_pos + history_cursor_pos) % history_size]; temp_selection = selections_history[(history_start_pos + history_cursor_pos) % history_size];
return &temp_selection; return &temp_selection;
} }
SelectionFrames& TASEDIT_SELECTION::GetStrobedSelection() SelectionFrames& TASEDITOR_SELECTION::GetStrobedSelection()
{ {
return temp_selection; return temp_selection;
} }
SelectionFrames& TASEDIT_SELECTION::GetInsertedSet() SelectionFrames& TASEDITOR_SELECTION::GetInsertedSet()
{ {
return inserted_set; return inserted_set;
} }
// this getter is only for inside-class use // this getter is only for inside-class use
SelectionFrames& TASEDIT_SELECTION::CurrentSelection() SelectionFrames& TASEDITOR_SELECTION::CurrentSelection()
{ {
return selections_history[(history_start_pos + history_cursor_pos) % history_size]; return selections_history[(history_start_pos + history_cursor_pos) % history_size];
} }
@ -674,7 +674,7 @@ LRESULT APIENTRY LowerMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
if (marker_note_edit == MARKER_NOTE_EDIT_LOWER) if (marker_note_edit == MARKER_NOTE_EDIT_LOWER)
{ {
extern PLAYBACK playback; extern PLAYBACK playback;
extern TASEDIT_SELECTION selection; extern TASEDITOR_SELECTION selection;
switch(msg) switch(msg)
{ {
case WM_CHAR: case WM_CHAR:
@ -684,11 +684,11 @@ LRESULT APIENTRY LowerMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
case VK_ESCAPE: case VK_ESCAPE:
// revert text to original note text // revert text to original note text
SetWindowText(selection.hwndSelectionMarkerEdit, current_markers.GetNote(selection.shown_marker).c_str()); SetWindowText(selection.hwndSelectionMarkerEdit, current_markers.GetNote(selection.shown_marker).c_str());
SetFocus(tasedit_list.hwndList); SetFocus(list.hwndList);
return 0; return 0;
case VK_RETURN: case VK_RETURN:
// exit and save text changes // exit and save text changes
SetFocus(tasedit_list.hwndList); SetFocus(list.hwndList);
return 0; return 0;
case VK_TAB: case VK_TAB:
// switch to upper edit control (also exit and save text changes) // switch to upper edit control (also exit and save text changes)

View File

@ -1,11 +1,11 @@
//Specification file for TASEDIT_SELECTION class //Specification file for TASEDITOR_SELECTION class
#define SELECTION_ID_LEN 10 #define SELECTION_ID_LEN 10
class TASEDIT_SELECTION class TASEDITOR_SELECTION
{ {
public: public:
TASEDIT_SELECTION(); TASEDITOR_SELECTION();
void init(); void init();
void free(); void free();
void reset(); void reset();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
//Specification file for TASEDITOR_WINDOW class
enum ECONTEXTMENU
{
CONTEXTMENU_STRAY = 0,
CONTEXTMENU_SELECTED = 1,
};
class TASEDITOR_WINDOW
{
public:
TASEDITOR_WINDOW();
void init();
void exit();
void reset();
void update();
HWND hwndTasEditor, hwndFindNote;
HMENU hmenu, hrmenu;
HICON hTaseditorIcon;
bool TASEditor_focus;
void RedrawCaption();
void RedrawWindow();
void RightClick(LPNMITEMACTIVATE info);
void StrayClickMenu(LPNMITEMACTIVATE info);
void RightClickMenu(LPNMITEMACTIVATE info);
void UpdateCheckedItems();
void UpdateRecentProjectsMenu();
void UpdateRecentProjectsArray(const char* addString);
void RemoveRecentProject(unsigned int which);
void LoadRecentProject(int slot);
private:
};

View File

@ -9,6 +9,8 @@ enum LuaCallID
LUACALL_BEFOREEXIT, LUACALL_BEFOREEXIT,
LUACALL_BEFORESAVE, LUACALL_BEFORESAVE,
LUACALL_AFTERLOAD, LUACALL_AFTERLOAD,
LUACALL_TASEDITOR_AUTO,
LUACALL_TASEDITOR_MANUAL,
LUACALL_COUNT LUACALL_COUNT
}; };

View File

@ -52,11 +52,13 @@
#include "drivers/win/window.h" #include "drivers/win/window.h"
#include "drivers/win/ntview.h" #include "drivers/win/ntview.h"
#include "./drivers/win/taseditlib/taseditor_window.h"
#include "./drivers/win/taseditlib/markers.h" #include "./drivers/win/taseditlib/markers.h"
#include "./drivers/win/taseditlib/inputsnapshot.h" #include "./drivers/win/taseditlib/inputsnapshot.h"
#include "./drivers/win/taseditlib/bookmarks.h" #include "./drivers/win/taseditlib/bookmarks.h"
extern bool Tasedit_rewind_now; extern bool Taseditor_rewind_now;
extern BOOKMARKS bookmarks; extern BOOKMARKS bookmarks;
extern TASEDITOR_WINDOW taseditor_window;
#endif // WIN32 #endif // WIN32
//it is easier to declare these input drivers extern here than include a bunch of files //it is easier to declare these input drivers extern here than include a bunch of files
@ -1116,8 +1118,7 @@ static void ReloadRom(void)
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) if (FCEUMOV_Mode(MOVIEMODE_TASEDIT))
{ {
// load most recent project // load most recent project
extern void LoadRecentProject(int slot); taseditor_window.LoadRecentProject(0);
LoadRecentProject(0);
} else } else
{ {
// load most recent ROM // load most recent ROM
@ -1166,13 +1167,13 @@ static void ToggleFullscreen(void)
static void TaseditRewindOn(void) static void TaseditRewindOn(void)
{ {
#ifdef WIN32 #ifdef WIN32
Tasedit_rewind_now = true; Taseditor_rewind_now = true;
#endif #endif
} }
static void TaseditRewindOff(void) static void TaseditRewindOff(void)
{ {
#ifdef WIN32 #ifdef WIN32
Tasedit_rewind_now = false; Taseditor_rewind_now = false;
#endif #endif
} }

View File

@ -39,14 +39,9 @@
#include "fceulua.h" #include "fceulua.h"
#ifdef WIN32 #ifdef WIN32
#include "drivers/win/taseditlib/taseditproj.h" #include "drivers/win/common.h"
extern INPUT_HISTORY history; #include "drivers/win/taseditlib/taseditor_lua.h"
extern MARKERS current_markers; extern TASEDITOR_LUA taseditor_lua;
extern BOOKMARKS bookmarks;
extern RECORDER recorder;
extern PLAYBACK playback;
extern TASEDIT_LIST tasedit_list;
extern TASEDIT_SELECTION selection;
#endif #endif
extern "C" extern "C"
@ -127,6 +122,7 @@ extern INT_PTR CALLBACK DlgLuaScriptDialog(HWND hDlg, UINT msg, WPARAM wParam, L
extern void PrintToWindowConsole(int hDlgAsInt, const char* str); extern void PrintToWindowConsole(int hDlgAsInt, const char* str);
extern void WinLuaOnStart(int hDlgAsInt); extern void WinLuaOnStart(int hDlgAsInt);
extern void WinLuaOnStop(int hDlgAsInt); extern void WinLuaOnStop(int hDlgAsInt);
void TaseditorUpdateManualFunctionStatus();
#endif #endif
static lua_State *L; static lua_State *L;
@ -200,6 +196,9 @@ static const char* luaCallIDStrings [] =
"CALL_BEFOREEXIT", "CALL_BEFOREEXIT",
"CALL_BEFORESAVE", "CALL_BEFORESAVE",
"CALL_AFTERLOAD", "CALL_AFTERLOAD",
"CALL_TASEDITOR_AUTO",
"CALL_TASEDITOR_MANUAL",
}; };
//make sure we have the right number of strings //make sure we have the right number of strings
@ -237,6 +236,9 @@ static void FCEU_LuaOnStop() {
FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL); //TODO: Ideally lua returns the speed to the speed the user set before running the script FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL); //TODO: Ideally lua returns the speed to the speed the user set before running the script
//rather than returning it to normal, and turbo off. Perhaps some flags and a FCEUD_GetEmulationSpeed function //rather than returning it to normal, and turbo off. Perhaps some flags and a FCEUD_GetEmulationSpeed function
FCEUD_TurboOff(); //Turn off turbo FCEUD_TurboOff(); //Turn off turbo
#ifdef WIN32
TaseditorUpdateManualFunctionStatus();
#endif
} }
@ -374,6 +376,12 @@ static int emu_frameadvance(lua_State *L) {
// It's actually rather disappointing... // It's actually rather disappointing...
} }
// bool emu.paused() (getter)
static int emu_paused(lua_State *L)
{
lua_pushboolean(L, FCEUI_EmulationPaused() != 0);
return 1;
}
// emu.pause() // emu.pause()
// //
@ -1884,6 +1892,32 @@ void ForceExecuteLuaFrameFunctions()
CallRegisteredLuaFunctions(LUACALL_AFTEREMULATION); CallRegisteredLuaFunctions(LUACALL_AFTEREMULATION);
} }
void TaseditorAutoFunction()
{
CallRegisteredLuaFunctions(LUACALL_TASEDITOR_AUTO);
}
void TaseditorManualFunction()
{
CallRegisteredLuaFunctions(LUACALL_TASEDITOR_MANUAL);
}
void TaseditorUpdateManualFunctionStatus()
{
#ifdef WIN32
if (L)
{
// check if LUACALL_TASEDITOR_MANUAL function is not nil
lua_getfield(L, LUA_REGISTRYINDEX, luaCallIDStrings[LUACALL_TASEDITOR_MANUAL]);
if (lua_isfunction(L, -1))
taseditor_lua.EnableRunFunction();
else
taseditor_lua.DisableRunFunction();
lua_pop(L, 1);
} else taseditor_lua.DisableRunFunction();
#endif
}
// Not for the signed versions though // Not for the signed versions though
static int memory_readbytesigned(lua_State *L) { static int memory_readbytesigned(lua_State *L) {
signed char c = (signed char) FCEU_CheatGetByte(luaL_checkinteger(L,1)); signed char c = (signed char) FCEU_CheatGetByte(luaL_checkinteger(L,1));
@ -4261,10 +4295,42 @@ static int sound_get(lua_State *L)
// TAS Editor functions library // TAS Editor functions library
// bool taseditor.registerauto()
static int taseditor_registerauto(lua_State *L)
{
if (!lua_isnil(L,1))
luaL_checktype(L, 1, LUA_TFUNCTION);
lua_settop(L,1);
lua_getfield(L, LUA_REGISTRYINDEX, luaCallIDStrings[LUACALL_TASEDITOR_AUTO]);
lua_insert(L,1);
lua_setfield(L, LUA_REGISTRYINDEX, luaCallIDStrings[LUACALL_TASEDITOR_AUTO]);
//StopScriptIfFinished(luaStateToUIDMap[L]);
return 1;
}
// bool taseditor.registermanual()
static int taseditor_registermanual(lua_State *L)
{
if (!lua_isnil(L,1))
luaL_checktype(L, 1, LUA_TFUNCTION);
lua_settop(L,1);
lua_getfield(L, LUA_REGISTRYINDEX, luaCallIDStrings[LUACALL_TASEDITOR_MANUAL]);
lua_insert(L,1);
lua_setfield(L, LUA_REGISTRYINDEX, luaCallIDStrings[LUACALL_TASEDITOR_MANUAL]);
#ifdef WIN32
TaseditorUpdateManualFunctionStatus();
#endif
return 1;
}
// bool taseditor.engaged() // bool taseditor.engaged()
static int taseditor_engaged(lua_State *L) static int taseditor_engaged(lua_State *L)
{ {
lua_pushboolean(L, FCEUMOV_Mode(MOVIEMODE_TASEDIT)); #ifdef WIN32
lua_pushboolean(L, taseditor_lua.engaged());
#else
lua_pushboolean(L, false);
#endif
return 1; return 1;
} }
@ -4272,15 +4338,10 @@ static int taseditor_engaged(lua_State *L)
static int taseditor_markedframe(lua_State *L) static int taseditor_markedframe(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) lua_pushboolean(L, taseditor_lua.markedframe(luaL_checkinteger(L, 1)));
{ #else
int frame = luaL_checkinteger(L, 1); lua_pushboolean(L, false);
lua_pushboolean(L, current_markers.GetMarker(frame) != 0);
} else
#endif #endif
{
lua_pushboolean(L, false);
}
return 1; return 1;
} }
@ -4288,15 +4349,10 @@ static int taseditor_markedframe(lua_State *L)
static int taseditor_getmarker(lua_State *L) static int taseditor_getmarker(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) lua_pushinteger(L, taseditor_lua.getmarker(luaL_checkinteger(L, 1)));
{ #else
int frame = luaL_checkinteger(L, 1); lua_pushinteger(L, -1);
lua_pushinteger(L, current_markers.GetMarkerUp(frame));
} else
#endif #endif
{
lua_pushinteger(L, -1);
}
return 1; return 1;
} }
@ -4304,27 +4360,10 @@ static int taseditor_getmarker(lua_State *L)
static int taseditor_setmarker(lua_State *L) static int taseditor_setmarker(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) lua_pushinteger(L, taseditor_lua.setmarker(luaL_checkinteger(L, 1)));
{ #else
int frame = luaL_checkinteger(L, 1); lua_pushinteger(L, -1);
int marker_id = current_markers.GetMarker(frame);
if(!marker_id)
{
marker_id = current_markers.SetMarker(frame);
if (marker_id)
{
// new marker was created - register changes in TAS Editor
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_SET, frame);
selection.must_find_current_marker = playback.must_find_current_marker = true;
tasedit_list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
}
}
lua_pushinteger(L, marker_id);
} else
#endif #endif
{
lua_pushinteger(L, -1);
}
return 1; return 1;
} }
@ -4332,18 +4371,7 @@ static int taseditor_setmarker(lua_State *L)
static int taseditor_clearmarker(lua_State *L) static int taseditor_clearmarker(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) taseditor_lua.clearmarker(luaL_checkinteger(L, 1));
{
int frame = luaL_checkinteger(L, 1);
if (current_markers.GetMarker(frame))
{
current_markers.ClearMarker(frame);
// marker was deleted - register changes in TAS Editor
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_UNSET, frame);
selection.must_find_current_marker = playback.must_find_current_marker = true;
tasedit_list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
}
}
#endif #endif
return 0; return 0;
} }
@ -4352,15 +4380,10 @@ static int taseditor_clearmarker(lua_State *L)
static int taseditor_getnote(lua_State *L) static int taseditor_getnote(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) lua_pushstring(L, taseditor_lua.getnote(luaL_checkinteger(L, 1)));
{ #else
int index = luaL_checkinteger(L, 1); lua_pushnil(L);
lua_pushstring(L, current_markers.GetNote(index).c_str());
} else
#endif #endif
{
lua_pushnil(L);
}
return 1; return 1;
} }
@ -4368,19 +4391,7 @@ static int taseditor_getnote(lua_State *L)
static int taseditor_setnote(lua_State *L) static int taseditor_setnote(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) taseditor_lua.setnote(luaL_checkinteger(L, 1), luaL_checkstring(L, 2));
{
int index = luaL_checkinteger(L, 1);
char newtext[MAX_NOTE_LEN];
strncpy(newtext, luaL_checkstring(L, 2), MAX_NOTE_LEN - 1);
if (strcmp(current_markers.GetNote(index).c_str(), newtext))
{
// text differs from old note - rename
current_markers.SetNote(index, newtext);
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_RENAME, current_markers.GetMarkerFrame(index));
selection.must_find_current_marker = playback.must_find_current_marker = true;
}
}
#endif #endif
return 0; return 0;
} }
@ -4389,14 +4400,10 @@ static int taseditor_setnote(lua_State *L)
static int taseditor_getcurrentbranch(lua_State *L) static int taseditor_getcurrentbranch(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) lua_pushinteger(L, taseditor_lua.getcurrentbranch());
{ #else
lua_pushinteger(L, bookmarks.GetCurrentBranch()); lua_pushinteger(L, -1);
} else
#endif #endif
{
lua_pushinteger(L, -1);
}
return 1; return 1;
} }
@ -4404,14 +4411,10 @@ static int taseditor_getcurrentbranch(lua_State *L)
static int taseditor_getrecordermode(lua_State *L) static int taseditor_getrecordermode(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) lua_pushstring(L, taseditor_lua.getrecordermode());
{ #else
lua_pushstring(L, recorder.GetRecordingMode()); lua_pushnil(L);
} else
#endif #endif
{
lua_pushnil(L);
}
return 1; return 1;
} }
@ -4419,17 +4422,35 @@ static int taseditor_getrecordermode(lua_State *L)
static int taseditor_getplaybacktarget(lua_State *L) static int taseditor_getplaybacktarget(lua_State *L)
{ {
#ifdef WIN32 #ifdef WIN32
if (FCEUMOV_Mode(MOVIEMODE_TASEDIT)) lua_pushinteger(L, taseditor_lua.getplaybacktarget());
{ #else
lua_pushinteger(L, playback.pause_frame - 1); lua_pushinteger(L, -1);
} else
#endif #endif
{
lua_pushinteger(L, -1);
}
return 1; return 1;
} }
// taseditor.setplayback(int frame)
static int taseditor_setplayback(lua_State *L)
{
#ifdef WIN32
taseditor_lua.setplayback(luaL_checkinteger(L, 1));
#endif
return 0;
}
// taseditor.stopseeking()
static int taseditor_stopseeking(lua_State *L)
{
#ifdef WIN32
taseditor_lua.stopseeking();
#endif
return 0;
}
static int doPopup(lua_State *L, const char* deftype, const char* deficon) { static int doPopup(lua_State *L, const char* deftype, const char* deficon) {
const char *str = luaL_checkstring(L, 1); const char *str = luaL_checkstring(L, 1);
const char* type = lua_type(L,2) == LUA_TSTRING ? lua_tostring(L,2) : deftype; const char* type = lua_type(L,2) == LUA_TSTRING ? lua_tostring(L,2) : deftype;
@ -5018,6 +5039,7 @@ static const struct luaL_reg emulib [] = {
{"softreset", emu_softreset}, {"softreset", emu_softreset},
{"speedmode", emu_speedmode}, {"speedmode", emu_speedmode},
{"frameadvance", emu_frameadvance}, {"frameadvance", emu_frameadvance},
{"paused", emu_paused},
{"pause", emu_pause}, {"pause", emu_pause},
{"unpause", emu_unpause}, {"unpause", emu_unpause},
{"exec_count", emu_exec_count}, {"exec_count", emu_exec_count},
@ -5188,6 +5210,8 @@ static const struct luaL_reg soundlib[] = {
static const struct luaL_reg taseditorlib[] = { static const struct luaL_reg taseditorlib[] = {
{"registerauto", taseditor_registerauto},
{"registermanual", taseditor_registermanual},
{"engaged", taseditor_engaged}, {"engaged", taseditor_engaged},
{"markedframe", taseditor_markedframe}, {"markedframe", taseditor_markedframe},
{"getmarker", taseditor_getmarker}, {"getmarker", taseditor_getmarker},
@ -5198,6 +5222,8 @@ static const struct luaL_reg taseditorlib[] = {
{"getcurrentbranch", taseditor_getcurrentbranch}, {"getcurrentbranch", taseditor_getcurrentbranch},
{"getrecordermode", taseditor_getrecordermode}, {"getrecordermode", taseditor_getrecordermode},
{"getplaybacktarget", taseditor_getplaybacktarget}, {"getplaybacktarget", taseditor_getplaybacktarget},
{"setplayback", taseditor_setplayback},
{"stopseeking", taseditor_stopseeking},
{NULL,NULL} {NULL,NULL}
}; };

View File

@ -396,6 +396,7 @@ MovieData::MovieData()
, PPUflag(false) , PPUflag(false)
, rerecordCount(0) , rerecordCount(0)
, binaryFlag(false) , binaryFlag(false)
, loadFrameCount(-1)
, microphone(false) , microphone(false)
{ {
memset(&romChecksum,0,sizeof(MD5DATA)); memset(&romChecksum,0,sizeof(MD5DATA));

View File

@ -1,6 +1,6 @@
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010 # Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fceux", "vc10_fceux.vcxproj", "{6893EF44-FEA3-46DF-B236-C4C200F54294}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fceux", "vc10_fceux.vcxproj", "{6893EF44-FEA3-46DF-B236-C4C200F54294}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F8647A59-ED57-4975-B40C-054BA8588E4E}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F8647A59-ED57-4975-B40C-054BA8588E4E}"

View File

@ -428,10 +428,14 @@
<ClCompile Include="..\src\drivers\win\taseditlib\inputsnapshot.cpp" /> <ClCompile Include="..\src\drivers\win\taseditlib\inputsnapshot.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\markers.cpp" /> <ClCompile Include="..\src\drivers\win\taseditlib\markers.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\playback.cpp" /> <ClCompile Include="..\src\drivers\win\taseditlib\playback.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\popup_display.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\recorder.cpp" /> <ClCompile Include="..\src\drivers\win\taseditlib\recorder.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\screenshot_display.cpp" /> <ClCompile Include="..\src\drivers\win\taseditlib\taseditor_config.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\tasedit_list.cpp" /> <ClCompile Include="..\src\drivers\win\taseditlib\taseditor_list.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\tasedit_sel.cpp" /> <ClCompile Include="..\src\drivers\win\taseditlib\taseditor_lua.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_project.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_sel.cpp" />
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_window.cpp" />
<ClCompile Include="..\src\drivers\win\texthook.cpp" /> <ClCompile Include="..\src\drivers\win\texthook.cpp" />
<ClCompile Include="..\src\drivers\win\throttle.cpp" /> <ClCompile Include="..\src\drivers\win\throttle.cpp" />
<ClCompile Include="..\src\drivers\win\timing.cpp" /> <ClCompile Include="..\src\drivers\win\timing.cpp" />
@ -506,7 +510,6 @@
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsC</CompileAs> <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsC</CompileAs> <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsC</CompileAs>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\taseditproj.cpp" />
<ClCompile Include="..\src\emufile.cpp" /> <ClCompile Include="..\src\emufile.cpp" />
<ClCompile Include="..\src\input\arkanoid.cpp" /> <ClCompile Include="..\src\input\arkanoid.cpp" />
<ClCompile Include="..\src\input\bworld.cpp"> <ClCompile Include="..\src\input\bworld.cpp">
@ -749,10 +752,14 @@
<ClInclude Include="..\src\drivers\win\taseditlib\inputsnapshot.h" /> <ClInclude Include="..\src\drivers\win\taseditlib\inputsnapshot.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\markers.h" /> <ClInclude Include="..\src\drivers\win\taseditlib\markers.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\playback.h" /> <ClInclude Include="..\src\drivers\win\taseditlib\playback.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\popup_display.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\recorder.h" /> <ClInclude Include="..\src\drivers\win\taseditlib\recorder.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\screenshot_display.h" /> <ClInclude Include="..\src\drivers\win\taseditlib\taseditor_config.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\tasedit_list.h" /> <ClInclude Include="..\src\drivers\win\taseditlib\taseditor_list.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\tasedit_sel.h" /> <ClInclude Include="..\src\drivers\win\taseditlib\taseditor_lua.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_project.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_sel.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_window.h" />
<ClInclude Include="..\src\drivers\win\texthook.h" /> <ClInclude Include="..\src\drivers\win\texthook.h" />
<ClInclude Include="..\src\drivers\win\throttle.h" /> <ClInclude Include="..\src\drivers\win\throttle.h" />
<ClInclude Include="..\src\drivers\win\timing.h" /> <ClInclude Include="..\src\drivers\win\timing.h" />
@ -766,7 +773,6 @@
<ClInclude Include="..\src\drivers\win\lua\include\lua.hpp" /> <ClInclude Include="..\src\drivers\win\lua\include\lua.hpp" />
<ClInclude Include="..\src\drivers\win\lua\include\luaconf.h" /> <ClInclude Include="..\src\drivers\win\lua\include\luaconf.h" />
<ClInclude Include="..\src\drivers\win\lua\include\lualib.h" /> <ClInclude Include="..\src\drivers\win\lua\include\lualib.h" />
<ClInclude Include="..\src\drivers\win\taseditlib\taseditproj.h" />
<ClInclude Include="..\src\emufile.h" /> <ClInclude Include="..\src\emufile.h" />
<ClInclude Include="..\src\fir\c44100ntsc.h" /> <ClInclude Include="..\src\fir\c44100ntsc.h" />
<ClInclude Include="..\src\fir\c44100pal.h" /> <ClInclude Include="..\src\fir\c44100pal.h" />
@ -862,8 +868,8 @@
<None Include="..\src\drivers\win\res\icon4.ico" /> <None Include="..\src\drivers\win\res\icon4.ico" />
<None Include="..\src\drivers\win\res\ICON_1.ico" /> <None Include="..\src\drivers\win\res\ICON_1.ico" />
<None Include="..\src\drivers\win\res\ICON_2.ico" /> <None Include="..\src\drivers\win\res\ICON_2.ico" />
<None Include="..\src\drivers\win\res\tasedit-icon.ico" /> <None Include="..\src\drivers\win\res\taseditor-icon.ico" />
<None Include="..\src\drivers\win\res\tasedit-icon32.ico" /> <None Include="..\src\drivers\win\res\taseditor-icon32.ico" />
<None Include="..\src\drivers\win\res\te_0.bmp" /> <None Include="..\src\drivers\win\res\te_0.bmp" />
<None Include="..\src\drivers\win\res\te_1.bmp" /> <None Include="..\src\drivers\win\res\te_1.bmp" />
<None Include="..\src\drivers\win\res\te_10.bmp" /> <None Include="..\src\drivers\win\res\te_10.bmp" />
@ -901,8 +907,6 @@
</CustomBuild> </CustomBuild>
<None Include="..\src\pputile.inc" /> <None Include="..\src\pputile.inc" />
<None Include="ClassDiagram1.cd" /> <None Include="ClassDiagram1.cd" />
<None Include="res\tasedit-icon.ico" />
<None Include="res\tasedit-icon32.ico" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

View File

@ -445,9 +445,6 @@
<ClCompile Include="..\src\drivers\win\tasedit.cpp"> <ClCompile Include="..\src\drivers\win\tasedit.cpp">
<Filter>drivers\win</Filter> <Filter>drivers\win</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\taseditproj.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\texthook.cpp"> <ClCompile Include="..\src\drivers\win\texthook.cpp">
<Filter>drivers\win</Filter> <Filter>drivers\win</Filter>
</ClCompile> </ClCompile>
@ -931,16 +928,28 @@
<ClCompile Include="..\src\drivers\win\taseditlib\playback.cpp"> <ClCompile Include="..\src\drivers\win\taseditlib\playback.cpp">
<Filter>drivers\win\taseditlib</Filter> <Filter>drivers\win\taseditlib</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\tasedit_list.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\tasedit_sel.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\recorder.cpp"> <ClCompile Include="..\src\drivers\win\taseditlib\recorder.cpp">
<Filter>drivers\win\taseditlib</Filter> <Filter>drivers\win\taseditlib</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\screenshot_display.cpp"> <ClCompile Include="..\src\drivers\win\taseditlib\taseditor_config.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_list.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_lua.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_project.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_sel.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\taseditor_window.cpp">
<Filter>drivers\win\taseditlib</Filter>
</ClCompile>
<ClCompile Include="..\src\drivers\win\taseditlib\popup_display.cpp">
<Filter>drivers\win\taseditlib</Filter> <Filter>drivers\win\taseditlib</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
@ -1119,9 +1128,6 @@
<ClInclude Include="..\src\drivers\win\tasedit.h"> <ClInclude Include="..\src\drivers\win\tasedit.h">
<Filter>drivers\win</Filter> <Filter>drivers\win</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\taseditproj.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\texthook.h"> <ClInclude Include="..\src\drivers\win\texthook.h">
<Filter>drivers\win</Filter> <Filter>drivers\win</Filter>
</ClInclude> </ClInclude>
@ -1405,16 +1411,28 @@
<ClInclude Include="..\src\drivers\win\taseditlib\playback.h"> <ClInclude Include="..\src\drivers\win\taseditlib\playback.h">
<Filter>drivers\win\taseditlib</Filter> <Filter>drivers\win\taseditlib</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\tasedit_list.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\tasedit_sel.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\recorder.h"> <ClInclude Include="..\src\drivers\win\taseditlib\recorder.h">
<Filter>drivers\win\taseditlib</Filter> <Filter>drivers\win\taseditlib</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\screenshot_display.h"> <ClInclude Include="..\src\drivers\win\taseditlib\taseditor_window.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_config.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_list.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_lua.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_project.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\taseditor_sel.h">
<Filter>drivers\win\taseditlib</Filter>
</ClInclude>
<ClInclude Include="..\src\drivers\win\taseditlib\popup_display.h">
<Filter>drivers\win\taseditlib</Filter> <Filter>drivers\win\taseditlib</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
@ -1500,10 +1518,8 @@
</None> </None>
<None Include="..\src\drivers\win\res\icon3.ico" /> <None Include="..\src\drivers\win\res\icon3.ico" />
<None Include="..\src\drivers\win\res\icon4.ico" /> <None Include="..\src\drivers\win\res\icon4.ico" />
<None Include="res\tasedit-icon.ico" /> <None Include="..\src\drivers\win\res\taseditor-icon.ico" />
<None Include="..\src\drivers\win\res\tasedit-icon.ico" /> <None Include="..\src\drivers\win\res\taseditor-icon32.ico" />
<None Include="res\tasedit-icon32.ico" />
<None Include="..\src\drivers\win\res\tasedit-icon32.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuild Include="..\src\auxlib.lua" /> <CustomBuild Include="..\src\auxlib.lua" />