* Hexeditor: changed "Highlight Activity" workings, added "Highlighting" submenu
* Taseditor: an experiment with somewhat different colors for HotChanges
This commit is contained in:
parent
7008dfd8d1
commit
24edc16a2e
|
@ -87,6 +87,8 @@ extern int DbgSizeX,DbgSizeY;
|
||||||
extern int MemViewSizeX,MemViewSizeY;
|
extern int MemViewSizeX,MemViewSizeY;
|
||||||
extern int MemView_wndx, MemView_wndy;
|
extern int MemView_wndx, MemView_wndy;
|
||||||
extern bool MemView_HighlightActivity;
|
extern bool MemView_HighlightActivity;
|
||||||
|
extern unsigned int MemView_HighlightActivity_FadingPeriod;
|
||||||
|
extern bool MemView_HighlightActivity_FadeWhenPaused;
|
||||||
extern int MemFind_wndx, MemFind_wndy;
|
extern int MemFind_wndx, MemFind_wndy;
|
||||||
extern int NTViewPosX,NTViewPosY;
|
extern int NTViewPosX,NTViewPosY;
|
||||||
extern int PPUViewPosX,PPUViewPosY;
|
extern int PPUViewPosX,PPUViewPosY;
|
||||||
|
@ -287,6 +289,8 @@ static CFGSTRUCT fceuconfig[] =
|
||||||
AC(MemView_wndx),
|
AC(MemView_wndx),
|
||||||
AC(MemView_wndy),
|
AC(MemView_wndy),
|
||||||
AC(MemView_HighlightActivity),
|
AC(MemView_HighlightActivity),
|
||||||
|
AC(MemView_HighlightActivity_FadingPeriod),
|
||||||
|
AC(MemView_HighlightActivity_FadeWhenPaused),
|
||||||
AC(MemFind_wndx),
|
AC(MemFind_wndx),
|
||||||
AC(MemFind_wndy),
|
AC(MemFind_wndy),
|
||||||
AC(NTViewPosX),
|
AC(NTViewPosX),
|
||||||
|
|
|
@ -47,6 +47,8 @@ extern Name* ramBankNames;
|
||||||
extern unsigned char *cdloggervdata;
|
extern unsigned char *cdloggervdata;
|
||||||
extern unsigned int cdloggerVideoDataSize;
|
extern unsigned int cdloggerVideoDataSize;
|
||||||
|
|
||||||
|
extern bool JustFrameAdvanced;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define MODE_NES_MEMORY 0
|
#define MODE_NES_MEMORY 0
|
||||||
|
@ -60,6 +62,7 @@ using namespace std;
|
||||||
#define ID_ADDRESS_SEEK_IN_ROM 5
|
#define ID_ADDRESS_SEEK_IN_ROM 5
|
||||||
#define ID_ADDRESS_CREATE_GG_CODE 6
|
#define ID_ADDRESS_CREATE_GG_CODE 6
|
||||||
#define ID_ADDRESS_BOOKMARK 20
|
#define ID_ADDRESS_BOOKMARK 20
|
||||||
|
#define BOOKMARKS_SUBMENU_POS 4
|
||||||
|
|
||||||
#define ID_ADDRESS_FRZ_TOGGLE_STATE 1
|
#define ID_ADDRESS_FRZ_TOGGLE_STATE 1
|
||||||
#define ID_ADDRESS_FRZ_FREEZE 50
|
#define ID_ADDRESS_FRZ_FREEZE 50
|
||||||
|
@ -68,10 +71,10 @@ using namespace std;
|
||||||
#define ID_ADDRESS_FRZ_UNFREEZE_ALL 53
|
#define ID_ADDRESS_FRZ_UNFREEZE_ALL 53
|
||||||
|
|
||||||
#define HIGHLIGHT_ACTIVITY_MIN_VALUE 0
|
#define HIGHLIGHT_ACTIVITY_MIN_VALUE 0
|
||||||
#define HIGHLIGHT_ACTIVITY_MAX_VALUE 16
|
#define HIGHLIGHT_ACTIVITY_NUM_COLORS 16
|
||||||
#define PREVIOUS_VALUE_UNDEFINED -1
|
#define PREVIOUS_VALUE_UNDEFINED -1
|
||||||
|
|
||||||
COLORREF highlightActivityColors[HIGHLIGHT_ACTIVITY_MAX_VALUE] = { 0x0, 0x495249, 0x666361, 0x855a45, 0xa13620, 0xbd003f, 0xd6006f, 0xcc008b, 0xba00a1, 0x8b00ad, 0x5c00bf, 0x0003d1, 0x0059d6, 0x0077d9, 0x0096db, 0x00aede };
|
COLORREF highlightActivityColors[HIGHLIGHT_ACTIVITY_NUM_COLORS] = { 0x0, 0x005252, 0x227322, 0x768046, 0x99641f, 0xbf0003, 0xe00056, 0xd90090, 0xcc00b4, 0x8500ba, 0x7100d4, 0x1c00d1, 0x003ce0, 0x0069d9, 0x008ae5, 0x4ea2de };
|
||||||
|
|
||||||
string memviewhelp = "HexEditor"; //Hex Editor Help Page
|
string memviewhelp = "HexEditor"; //Hex Editor Help Page
|
||||||
|
|
||||||
|
@ -157,6 +160,8 @@ int TableFileLoaded;
|
||||||
int MemView_wndx, MemView_wndy;
|
int MemView_wndx, MemView_wndy;
|
||||||
int MemFind_wndx, MemFind_wndy;
|
int MemFind_wndx, MemFind_wndy;
|
||||||
bool MemView_HighlightActivity = true;
|
bool MemView_HighlightActivity = true;
|
||||||
|
unsigned int MemView_HighlightActivity_FadingPeriod = HIGHLIGHT_ACTIVITY_NUM_COLORS;
|
||||||
|
bool MemView_HighlightActivity_FadeWhenPaused = false;
|
||||||
int MemViewSizeX = 580, MemViewSizeY = 248;
|
int MemViewSizeX = 580, MemViewSizeY = 248;
|
||||||
static RECT newMemViewRect;
|
static RECT newMemViewRect;
|
||||||
|
|
||||||
|
@ -178,7 +183,7 @@ COLORREF *BGColorList;
|
||||||
COLORREF *TextColorList;
|
COLORREF *TextColorList;
|
||||||
int PreviousCurOffset;
|
int PreviousCurOffset;
|
||||||
int *PreviousValues; // for HighlightActivity feature and for speedhack too
|
int *PreviousValues; // for HighlightActivity feature and for speedhack too
|
||||||
int *HighlightedBytes;
|
unsigned int *HighlightedBytes;
|
||||||
|
|
||||||
int lbuttondown, lbuttondownx, lbuttondowny;
|
int lbuttondown, lbuttondownx, lbuttondowny;
|
||||||
int mousex, mousey;
|
int mousex, mousey;
|
||||||
|
@ -435,6 +440,7 @@ void UpdateMemoryView(int draw_all)
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
int byteValue;
|
int byteValue;
|
||||||
|
int byteHighlightingValue;
|
||||||
//LPVOID lpMsgBuf;
|
//LPVOID lpMsgBuf;
|
||||||
//int curlength;
|
//int curlength;
|
||||||
char str[100];
|
char str[100];
|
||||||
|
@ -475,9 +481,10 @@ void UpdateMemoryView(int draw_all)
|
||||||
for(j = 0;j < 16;j++)
|
for(j = 0;j < 16;j++)
|
||||||
{
|
{
|
||||||
byteValue = GetMemViewData(i+j);
|
byteValue = GetMemViewData(i+j);
|
||||||
if (MemView_HighlightActivity)
|
if (MemView_HighlightActivity && ((PreviousValues[i+j-CurOffset] != byteValue) && (PreviousValues[i+j-CurOffset] != PREVIOUS_VALUE_UNDEFINED)))
|
||||||
if ((PreviousValues[i+j-CurOffset] != byteValue) && (PreviousValues[i+j-CurOffset] != PREVIOUS_VALUE_UNDEFINED))
|
byteHighlightingValue = HighlightedBytes[i+j-CurOffset] = MemView_HighlightActivity_FadingPeriod;
|
||||||
HighlightedBytes[i+j-CurOffset] = HIGHLIGHT_ACTIVITY_MAX_VALUE;
|
else
|
||||||
|
byteHighlightingValue = HighlightedBytes[i+j-CurOffset];
|
||||||
|
|
||||||
if ((CursorEndAddy == -1) && (CursorStartAddy == i+j))
|
if ((CursorEndAddy == -1) && (CursorStartAddy == i+j))
|
||||||
{
|
{
|
||||||
|
@ -507,8 +514,8 @@ void UpdateMemoryView(int draw_all)
|
||||||
// 2nd nybble
|
// 2nd nybble
|
||||||
MoveToEx(HDataDC, MemFontWidth + 8 * MemFontWidth + (j * 3 * MemFontWidth), MemFontHeight * ((i - CurOffset) / 16), NULL);
|
MoveToEx(HDataDC, MemFontWidth + 8 * MemFontWidth + (j * 3 * MemFontWidth), MemFontHeight * ((i - CurOffset) / 16), NULL);
|
||||||
sprintf(str,"%X", byteValue % 16);
|
sprintf(str,"%X", byteValue % 16);
|
||||||
SetTextColor(HDataDC,TextColorList[i+j-CurOffset]); //single address highlight 2nd address
|
SetTextColor(HDataDC,TextColorList[i+j-CurOffset]);
|
||||||
SetBkColor(HDataDC,RGB(HexBackColorR,HexBackColorG,HexBackColorB));
|
SetBkColor(HDataDC,BGColorList[i+j-CurOffset]);
|
||||||
TextOut(HDataDC,0,0,str,1);
|
TextOut(HDataDC,0,0,str,1);
|
||||||
}
|
}
|
||||||
//TextOut(HDataDC,0,0," ",1);
|
//TextOut(HDataDC,0,0," ",1);
|
||||||
|
@ -524,16 +531,28 @@ void UpdateMemoryView(int draw_all)
|
||||||
TextOut(HDataDC,0,0,str,1);
|
TextOut(HDataDC,0,0,str,1);
|
||||||
|
|
||||||
PreviousValues[i+j-CurOffset] = PREVIOUS_VALUE_UNDEFINED; //set it to redraw this one next time
|
PreviousValues[i+j-CurOffset] = PREVIOUS_VALUE_UNDEFINED; //set it to redraw this one next time
|
||||||
} else if (draw_all || (PreviousValues[i+j-CurOffset] != byteValue) || (HighlightedBytes[i+j-CurOffset]))
|
} else if (draw_all || (PreviousValues[i+j-CurOffset] != byteValue) || byteHighlightingValue)
|
||||||
{
|
{
|
||||||
// print up normal text
|
// print up normal text
|
||||||
if (HighlightedBytes[i+j-CurOffset])
|
if (byteHighlightingValue)
|
||||||
{
|
{
|
||||||
// fade out 1 step
|
// fade out 1 step
|
||||||
if (--HighlightedBytes[i+j-CurOffset] > 0)
|
if (MemView_HighlightActivity_FadeWhenPaused || !FCEUI_EmulationPaused() || JustFrameAdvanced)
|
||||||
SetTextColor(HDataDC, highlightActivityColors[HighlightedBytes[i+j-CurOffset]]);//(8+j*3)*MemFontWidth
|
byteHighlightingValue = (--HighlightedBytes[i+j-CurOffset]);
|
||||||
else
|
|
||||||
SetTextColor(HDataDC,TextColorList[i+j-CurOffset]);//(8+j*3)*MemFontWidth
|
if (byteHighlightingValue > 0)
|
||||||
|
{
|
||||||
|
if (byteHighlightingValue == MemView_HighlightActivity_FadingPeriod - 1 || byteHighlightingValue >= HIGHLIGHT_ACTIVITY_NUM_COLORS)
|
||||||
|
// if the byte was changed in current frame, use brightest color, even if the "fading period" demands different color
|
||||||
|
// also use the last color if byteHighlightingValue points outside the array of predefined colors
|
||||||
|
SetTextColor(HDataDC, highlightActivityColors[HIGHLIGHT_ACTIVITY_NUM_COLORS - 1]);
|
||||||
|
else
|
||||||
|
SetTextColor(HDataDC, highlightActivityColors[byteHighlightingValue]);
|
||||||
|
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
SetTextColor(HDataDC,TextColorList[i+j-CurOffset]);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
SetTextColor(HDataDC,TextColorList[i+j-CurOffset]);//(8+j*3)*MemFontWidth
|
SetTextColor(HDataDC,TextColorList[i+j-CurOffset]);//(8+j*3)*MemFontWidth
|
||||||
|
@ -1197,7 +1216,7 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
TextColorList = (COLORREF*)malloc(DataAmount*sizeof(COLORREF));
|
TextColorList = (COLORREF*)malloc(DataAmount*sizeof(COLORREF));
|
||||||
BGColorList = (COLORREF*)malloc(DataAmount*sizeof(COLORREF));
|
BGColorList = (COLORREF*)malloc(DataAmount*sizeof(COLORREF));
|
||||||
PreviousValues = (int*)malloc(DataAmount*sizeof(int));
|
PreviousValues = (int*)malloc(DataAmount*sizeof(int));
|
||||||
HighlightedBytes = (int*)malloc(DataAmount*sizeof(int));
|
HighlightedBytes = (unsigned int*)malloc(DataAmount*sizeof(unsigned int));
|
||||||
resetHighlightingActivityLog();
|
resetHighlightingActivityLog();
|
||||||
EditingText = CurOffset = 0;
|
EditingText = CurOffset = 0;
|
||||||
EditingMode = MODE_NES_MEMORY;
|
EditingMode = MODE_NES_MEMORY;
|
||||||
|
@ -1211,9 +1230,10 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
{
|
{
|
||||||
CheckMenuItem(GetMenu(hwnd), MENU_MV_VIEW_RAM + i, (EditingMode == i) ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(GetMenu(hwnd), MENU_MV_VIEW_RAM + i, (EditingMode == i) ? MF_CHECKED : MF_UNCHECKED);
|
||||||
}
|
}
|
||||||
CheckMenuItem(GetMenu(hwnd), ID_VIEW_HIGHLIGHT_ACTIVITY, (MemView_HighlightActivity) ? MF_CHECKED: MF_UNCHECKED);
|
CheckMenuItem(GetMenu(hwnd), ID_HIGHLIGHTING_HIGHLIGHT_ACTIVITY, (MemView_HighlightActivity) ? MF_CHECKED: MF_UNCHECKED);
|
||||||
|
CheckMenuItem(GetMenu(hwnd), ID_HIGHLIGHTING_FADEWHENPAUSED, (MemView_HighlightActivity_FadeWhenPaused) ? MF_CHECKED: MF_UNCHECKED);
|
||||||
|
|
||||||
updateBookmarkMenus(GetSubMenu(GetMenu(hwnd), 3));
|
updateBookmarkMenus(GetSubMenu(GetMenu(hwnd), BOOKMARKS_SUBMENU_POS));
|
||||||
return 0;
|
return 0;
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
@ -1709,7 +1729,7 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
updateBookmarkMenus(GetSubMenu(GetMenu(hwnd), 3));
|
updateBookmarkMenus(GetSubMenu(GetMenu(hwnd), BOOKMARKS_SUBMENU_POS));
|
||||||
UpdateColorTable();
|
UpdateColorTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1763,7 +1783,7 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
TextColorList = (COLORREF*)realloc(TextColorList,DataAmount*sizeof(COLORREF));
|
TextColorList = (COLORREF*)realloc(TextColorList,DataAmount*sizeof(COLORREF));
|
||||||
BGColorList = (COLORREF*)realloc(BGColorList,DataAmount*sizeof(COLORREF));
|
BGColorList = (COLORREF*)realloc(BGColorList,DataAmount*sizeof(COLORREF));
|
||||||
PreviousValues = (int*)realloc(PreviousValues,(DataAmount)*sizeof(int));
|
PreviousValues = (int*)realloc(PreviousValues,(DataAmount)*sizeof(int));
|
||||||
HighlightedBytes = (int*)realloc(HighlightedBytes,(DataAmount)*sizeof(int));
|
HighlightedBytes = (unsigned int*)realloc(HighlightedBytes,(DataAmount)*sizeof(unsigned int));
|
||||||
resetHighlightingActivityLog();
|
resetHighlightingActivityLog();
|
||||||
}
|
}
|
||||||
//Set vertical scroll bar range and page size
|
//Set vertical scroll bar range and page size
|
||||||
|
@ -1927,20 +1947,48 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
UpdateCaption();
|
UpdateCaption();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case ID_VIEW_HIGHLIGHT_ACTIVITY:
|
case ID_HIGHLIGHTING_HIGHLIGHT_ACTIVITY:
|
||||||
{
|
{
|
||||||
MemView_HighlightActivity ^= 1;
|
MemView_HighlightActivity ^= 1;
|
||||||
CheckMenuItem(GetMenu(hMemView), ID_VIEW_HIGHLIGHT_ACTIVITY, (MemView_HighlightActivity) ? MF_CHECKED: MF_UNCHECKED);
|
CheckMenuItem(GetMenu(hMemView), ID_HIGHLIGHTING_HIGHLIGHT_ACTIVITY, (MemView_HighlightActivity) ? MF_CHECKED: MF_UNCHECKED);
|
||||||
|
resetHighlightingActivityLog();
|
||||||
|
if (!MemView_HighlightActivity)
|
||||||
|
UpdateMemoryView(1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
case ID_HIGHLIGHTING_SETFADINGPERIOD:
|
||||||
|
{
|
||||||
|
int newValue = MemView_HighlightActivity_FadingPeriod - 1;
|
||||||
|
if (CWin32InputBox::GetInteger("Highlighting fading period", "Highlight changed bytes for how many frames?", newValue, hMemView) == IDOK)
|
||||||
|
{
|
||||||
|
if (newValue <= 0)
|
||||||
|
newValue = HIGHLIGHT_ACTIVITY_NUM_COLORS;
|
||||||
|
else
|
||||||
|
newValue++;
|
||||||
|
|
||||||
|
if (MemView_HighlightActivity_FadingPeriod != newValue)
|
||||||
|
{
|
||||||
|
MemView_HighlightActivity_FadingPeriod = newValue;
|
||||||
|
resetHighlightingActivityLog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
case ID_HIGHLIGHTING_FADEWHENPAUSED:
|
||||||
|
{
|
||||||
|
MemView_HighlightActivity_FadeWhenPaused ^= 1;
|
||||||
|
CheckMenuItem(GetMenu(hMemView), ID_HIGHLIGHTING_FADEWHENPAUSED, (MemView_HighlightActivity_FadeWhenPaused) ? MF_CHECKED: MF_UNCHECKED);
|
||||||
resetHighlightingActivityLog();
|
resetHighlightingActivityLog();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ################################## Start of SP CODE ###########################
|
// ################################## Start of SP CODE ###########################
|
||||||
case MENU_MV_BOOKMARKS_RM_ALL:
|
case MENU_MV_BOOKMARKS_RM_ALL:
|
||||||
if (nextBookmark)
|
if (nextBookmark)
|
||||||
{
|
{
|
||||||
if (MessageBox(hwnd, "Remove All Bookmarks?", "Bookmarks", MB_YESNO) == IDYES)
|
if (MessageBox(hwnd, "Remove All Bookmarks?", "Bookmarks", MB_YESNO) == IDYES)
|
||||||
{
|
{
|
||||||
removeAllBookmarks(GetSubMenu(GetMenu(hwnd), 3));
|
removeAllBookmarks(GetSubMenu(GetMenu(hwnd), BOOKMARKS_SUBMENU_POS));
|
||||||
UpdateColorTable();
|
UpdateColorTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,8 +343,12 @@ BEGIN
|
||||||
MENUITEM "&NES Memory", MENU_MV_VIEW_RAM
|
MENUITEM "&NES Memory", MENU_MV_VIEW_RAM
|
||||||
MENUITEM "&PPU Memory", MENU_MV_VIEW_PPU
|
MENUITEM "&PPU Memory", MENU_MV_VIEW_PPU
|
||||||
MENUITEM "&ROM File", MENU_MV_VIEW_ROM
|
MENUITEM "&ROM File", MENU_MV_VIEW_ROM
|
||||||
MENUITEM SEPARATOR
|
END
|
||||||
MENUITEM "Highlight Activity", ID_VIEW_HIGHLIGHT_ACTIVITY
|
POPUP "Highlighting"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Highlight Activity", ID_HIGHLIGHTING_HIGHLIGHT_ACTIVITY
|
||||||
|
MENUITEM "Set fading period...", ID_HIGHLIGHTING_SETFADINGPERIOD
|
||||||
|
MENUITEM "Fade when paused", ID_HIGHLIGHTING_FADEWHENPAUSED
|
||||||
END
|
END
|
||||||
POPUP "&Bookmarks"
|
POPUP "&Bookmarks"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
|
@ -1188,6 +1188,9 @@
|
||||||
#define ID_VIEW_A 40583
|
#define ID_VIEW_A 40583
|
||||||
#define ID_VIEW_HIGHLIGHT 40584
|
#define ID_VIEW_HIGHLIGHT 40584
|
||||||
#define ID_VIEW_HIGHLIGHT_ACTIVITY 40585
|
#define ID_VIEW_HIGHLIGHT_ACTIVITY 40585
|
||||||
|
#define ID_HIGHLIGHTING_FADEWHENPAUSED 40586
|
||||||
|
#define ID_HIGHLIGHTING_SETFADINGPERIOD 40587
|
||||||
|
#define ID_HIGHLIGHTING_HIGHLIGHT_ACTIVITY 40588
|
||||||
#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
|
||||||
|
@ -1200,7 +1203,7 @@
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 290
|
#define _APS_NEXT_RESOURCE_VALUE 290
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40586
|
#define _APS_NEXT_COMMAND_VALUE 40589
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1289
|
#define _APS_NEXT_CONTROL_VALUE 1289
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,7 +54,8 @@ LRESULT APIENTRY markerDragBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
|
||||||
// resources
|
// resources
|
||||||
char pianoRollSaveID[PIANO_ROLL_ID_LEN] = "PIANO_ROLL";
|
char pianoRollSaveID[PIANO_ROLL_ID_LEN] = "PIANO_ROLL";
|
||||||
char pianoRollSkipSaveID[PIANO_ROLL_ID_LEN] = "PIANO_ROLX";
|
char pianoRollSkipSaveID[PIANO_ROLL_ID_LEN] = "PIANO_ROLX";
|
||||||
COLORREF hotChangesColors[16] = { 0x0, 0x495249, 0x666361, 0x855a45, 0xa13620, 0xbd003f, 0xd6006f, 0xcc008b, 0xba00a1, 0x8b00ad, 0x5c00bf, 0x0003d1, 0x0059d6, 0x0077d9, 0x0096db, 0x00aede };
|
//COLORREF hotChangesColors[16] = { 0x0, 0x495249, 0x666361, 0x855a45, 0xa13620, 0xbd003f, 0xd6006f, 0xcc008b, 0xba00a1, 0x8b00ad, 0x5c00bf, 0x0003d1, 0x0059d6, 0x0077d9, 0x0096db, 0x00aede };
|
||||||
|
COLORREF hotChangesColors[16] = { 0x0, 0x005252, 0x227322, 0x768046, 0x99641f, 0xbf0003, 0xe00056, 0xd90090, 0xcc00b4, 0x8500ba, 0x7100d4, 0x1c00d1, 0x003ce0, 0x0069d9, 0x008ae5, 0x4ea2de };
|
||||||
COLORREF headerLightsColors[11] = { 0x0, 0x007313, 0x009100, 0x1daf00, 0x42c700, 0x65d900, 0x91e500, 0xb0f000, 0xdaf700, 0xf0fc7c, 0xfcffba };
|
COLORREF headerLightsColors[11] = { 0x0, 0x007313, 0x009100, 0x1daf00, 0x42c700, 0x65d900, 0x91e500, 0xb0f000, 0xdaf700, 0xf0fc7c, 0xfcffba };
|
||||||
|
|
||||||
char markerDragBoxClassName[] = "MarkerDragBox";
|
char markerDragBoxClassName[] = "MarkerDragBox";
|
||||||
|
|
|
@ -224,16 +224,16 @@ void TASEDITOR_WINDOW::init()
|
||||||
{
|
{
|
||||||
// for static text we specify rectangle
|
// for static text we specify rectangle
|
||||||
toolInfo.uFlags = TTF_SUBCLASS;
|
toolInfo.uFlags = TTF_SUBCLASS;
|
||||||
RECT tool_rect;
|
RECT toolRect;
|
||||||
GetWindowRect(GetDlgItem(hwndTASEditor, windowItems[i].id), &tool_rect);
|
GetWindowRect(GetDlgItem(hwndTASEditor, windowItems[i].id), &toolRect);
|
||||||
POINT pt;
|
POINT pt;
|
||||||
pt.x = tool_rect.left;
|
pt.x = toolRect.left;
|
||||||
pt.y = tool_rect.top;
|
pt.y = toolRect.top;
|
||||||
ScreenToClient(hwndTASEditor, &pt);
|
ScreenToClient(hwndTASEditor, &pt);
|
||||||
toolInfo.rect.left = pt.x;
|
toolInfo.rect.left = pt.x;
|
||||||
toolInfo.rect.right = toolInfo.rect.left + (tool_rect.right - tool_rect.left);
|
toolInfo.rect.right = toolInfo.rect.left + (toolRect.right - toolRect.left);
|
||||||
toolInfo.rect.top = pt.y;
|
toolInfo.rect.top = pt.y;
|
||||||
toolInfo.rect.bottom = toolInfo.rect.top + (tool_rect.bottom - tool_rect.top);
|
toolInfo.rect.bottom = toolInfo.rect.top + (toolRect.bottom - toolRect.top);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// for other controls we provide hwnd
|
// for other controls we provide hwnd
|
||||||
|
@ -328,7 +328,7 @@ void TASEDITOR_WINDOW::update()
|
||||||
if (mustUpdateMouseCursor)
|
if (mustUpdateMouseCursor)
|
||||||
{
|
{
|
||||||
// change mouse cursor depending on what it points at
|
// change mouse cursor depending on what it points at
|
||||||
LPCSTR cursor_icon = IDC_ARROW;
|
LPCSTR cursorIcon = IDC_ARROW;
|
||||||
switch (pianoRoll.dragMode)
|
switch (pianoRoll.dragMode)
|
||||||
{
|
{
|
||||||
case DRAG_MODE_NONE:
|
case DRAG_MODE_NONE:
|
||||||
|
@ -336,23 +336,23 @@ void TASEDITOR_WINDOW::update()
|
||||||
// normal mouseover
|
// normal mouseover
|
||||||
if (bookmarks.editMode == EDIT_MODE_BRANCHES)
|
if (bookmarks.editMode == EDIT_MODE_BRANCHES)
|
||||||
{
|
{
|
||||||
int branch_under_mouse = bookmarks.itemUnderMouse;
|
int branchUnderMouse = bookmarks.itemUnderMouse;
|
||||||
if (branch_under_mouse >= 0 && branch_under_mouse < TOTAL_BOOKMARKS && bookmarks.bookmarksArray[branch_under_mouse].notEmpty)
|
if (branchUnderMouse >= 0 && branchUnderMouse < TOTAL_BOOKMARKS && bookmarks.bookmarksArray[branchUnderMouse].notEmpty)
|
||||||
{
|
{
|
||||||
int current_branch = branches.getCurrentBranch();
|
int currentBranch = branches.getCurrentBranch();
|
||||||
if (current_branch >= 0 && current_branch < TOTAL_BOOKMARKS)
|
if (currentBranch >= 0 && currentBranch < TOTAL_BOOKMARKS)
|
||||||
{
|
{
|
||||||
// find if the Branch belongs to the current timeline
|
// find if the Branch belongs to the current timeline
|
||||||
int timeline_branch = branches.findFullTimelineForBranch(current_branch);
|
int timelineBranch = branches.findFullTimelineForBranch(currentBranch);
|
||||||
while (timeline_branch != ITEM_UNDER_MOUSE_CLOUD)
|
while (timelineBranch != ITEM_UNDER_MOUSE_CLOUD)
|
||||||
{
|
{
|
||||||
if (timeline_branch == branch_under_mouse)
|
if (timelineBranch == branchUnderMouse)
|
||||||
break;
|
break;
|
||||||
timeline_branch = branches.getParentOf(timeline_branch);
|
timelineBranch = branches.getParentOf(timelineBranch);
|
||||||
}
|
}
|
||||||
if (timeline_branch == ITEM_UNDER_MOUSE_CLOUD)
|
if (timelineBranch == ITEM_UNDER_MOUSE_CLOUD)
|
||||||
// branch_under_mouse wasn't found in current timeline
|
// branchUnderMouse wasn't found in current timeline - change mouse cursor to a "?" mark
|
||||||
cursor_icon = IDC_HELP;
|
cursorIcon = IDC_HELP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -362,13 +362,13 @@ void TASEDITOR_WINDOW::update()
|
||||||
{
|
{
|
||||||
// user is dragging Playback cursor - show either normal arrow or arrow+wait
|
// user is dragging Playback cursor - show either normal arrow or arrow+wait
|
||||||
if (playback.getPauseFrame() >= 0)
|
if (playback.getPauseFrame() >= 0)
|
||||||
cursor_icon = IDC_APPSTARTING;
|
cursorIcon = IDC_APPSTARTING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DRAG_MODE_MARKER:
|
case DRAG_MODE_MARKER:
|
||||||
{
|
{
|
||||||
// user is dragging Marker
|
// user is dragging Marker
|
||||||
cursor_icon = IDC_SIZEALL;
|
cursorIcon = IDC_SIZEALL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DRAG_MODE_OBSERVE:
|
case DRAG_MODE_OBSERVE:
|
||||||
|
@ -379,7 +379,7 @@ void TASEDITOR_WINDOW::update()
|
||||||
// user is drawing/selecting - show normal arrow
|
// user is drawing/selecting - show normal arrow
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SetCursor(LoadCursor(0, cursor_icon));
|
SetCursor(LoadCursor(0, cursorIcon));
|
||||||
mustUpdateMouseCursor = false;
|
mustUpdateMouseCursor = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,10 +515,10 @@ void TASEDITOR_WINDOW::changeBookmarksListHeight(int newHeight)
|
||||||
if (!delta)
|
if (!delta)
|
||||||
return;
|
return;
|
||||||
// shift down all items that are below the Bookmarks List
|
// shift down all items that are below the Bookmarks List
|
||||||
int BookmarksList_bottom = windowItems[WINDOWITEMS_BOOKMARKS_LIST].y + windowItems[WINDOWITEMS_BOOKMARKS_LIST].height;
|
int BookmarksListBottom = windowItems[WINDOWITEMS_BOOKMARKS_LIST].y + windowItems[WINDOWITEMS_BOOKMARKS_LIST].height;
|
||||||
for (int i = 0; i < TASEDITOR_WINDOW_TOTAL_ITEMS; ++i)
|
for (int i = 0; i < TASEDITOR_WINDOW_TOTAL_ITEMS; ++i)
|
||||||
{
|
{
|
||||||
if (windowItems[i].y > BookmarksList_bottom)
|
if (windowItems[i].y > BookmarksListBottom)
|
||||||
windowItems[i].y += delta;
|
windowItems[i].y += delta;
|
||||||
}
|
}
|
||||||
// adjust Bookmarks List size
|
// adjust Bookmarks List size
|
||||||
|
@ -556,21 +556,21 @@ void TASEDITOR_WINDOW::updateTooltips()
|
||||||
|
|
||||||
void TASEDITOR_WINDOW::updateCaption()
|
void TASEDITOR_WINDOW::updateCaption()
|
||||||
{
|
{
|
||||||
char new_caption[300];
|
char newCaption[300];
|
||||||
strcpy(new_caption, windowCaptioBase);
|
strcpy(newCaption, windowCaptioBase);
|
||||||
if (!movie_readonly)
|
if (!movie_readonly)
|
||||||
strcat(new_caption, recorder.getRecordingCaption());
|
strcat(newCaption, recorder.getRecordingCaption());
|
||||||
// add project name
|
// add project name
|
||||||
std::string projectname = project.getProjectName();
|
std::string projectname = project.getProjectName();
|
||||||
if (!projectname.empty())
|
if (!projectname.empty())
|
||||||
{
|
{
|
||||||
strcat(new_caption, " - ");
|
strcat(newCaption, " - ");
|
||||||
strcat(new_caption, projectname.c_str());
|
strcat(newCaption, projectname.c_str());
|
||||||
}
|
}
|
||||||
// and * if project has unsaved changes
|
// and * if project has unsaved changes
|
||||||
if (project.getProjectChanged())
|
if (project.getProjectChanged())
|
||||||
strcat(new_caption, "*");
|
strcat(newCaption, "*");
|
||||||
SetWindowText(hwndTASEditor, new_caption);
|
SetWindowText(hwndTASEditor, newCaption);
|
||||||
}
|
}
|
||||||
void TASEDITOR_WINDOW::redraw()
|
void TASEDITOR_WINDOW::redraw()
|
||||||
{
|
{
|
||||||
|
@ -1040,33 +1040,33 @@ BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
break;
|
break;
|
||||||
case ID_CONFIG_SETGREENZONECAPACITY:
|
case ID_CONFIG_SETGREENZONECAPACITY:
|
||||||
{
|
{
|
||||||
int new_capacity = taseditorConfig.greenzoneCapacity;
|
int newValue = taseditorConfig.greenzoneCapacity;
|
||||||
if (CWin32InputBox::GetInteger("Greenzone capacity", "Keep savestates for how many frames?\n(actual limit of savestates can be 5 times more than the number provided)", new_capacity, hWnd) == IDOK)
|
if (CWin32InputBox::GetInteger("Greenzone capacity", "Keep savestates for how many frames?\n(actual limit of savestates can be 5 times more than the number provided)", newValue, hWnd) == IDOK)
|
||||||
{
|
{
|
||||||
if (new_capacity < GREENZONE_CAPACITY_MIN)
|
if (newValue < GREENZONE_CAPACITY_MIN)
|
||||||
new_capacity = GREENZONE_CAPACITY_MIN;
|
newValue = GREENZONE_CAPACITY_MIN;
|
||||||
else if (new_capacity > GREENZONE_CAPACITY_MAX)
|
else if (newValue > GREENZONE_CAPACITY_MAX)
|
||||||
new_capacity = GREENZONE_CAPACITY_MAX;
|
newValue = GREENZONE_CAPACITY_MAX;
|
||||||
if (new_capacity < taseditorConfig.greenzoneCapacity)
|
if (newValue < taseditorConfig.greenzoneCapacity)
|
||||||
{
|
{
|
||||||
taseditorConfig.greenzoneCapacity = new_capacity;
|
taseditorConfig.greenzoneCapacity = newValue;
|
||||||
greenzone.runGreenzoneCleaning();
|
greenzone.runGreenzoneCleaning();
|
||||||
} else taseditorConfig.greenzoneCapacity = new_capacity;
|
} else taseditorConfig.greenzoneCapacity = newValue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ID_CONFIG_SETMAXUNDOLEVELS:
|
case ID_CONFIG_SETMAXUNDOLEVELS:
|
||||||
{
|
{
|
||||||
int new_size = taseditorConfig.maxUndoLevels;
|
int newValue = taseditorConfig.maxUndoLevels;
|
||||||
if (CWin32InputBox::GetInteger("Max undo levels", "Keep history of how many changes?", new_size, hWnd) == IDOK)
|
if (CWin32InputBox::GetInteger("Max undo levels", "Keep history of how many changes?", newValue, hWnd) == IDOK)
|
||||||
{
|
{
|
||||||
if (new_size < UNDO_LEVELS_MIN)
|
if (newValue < UNDO_LEVELS_MIN)
|
||||||
new_size = UNDO_LEVELS_MIN;
|
newValue = UNDO_LEVELS_MIN;
|
||||||
else if (new_size > UNDO_LEVELS_MAX)
|
else if (newValue > UNDO_LEVELS_MAX)
|
||||||
new_size = UNDO_LEVELS_MAX;
|
newValue = UNDO_LEVELS_MAX;
|
||||||
if (new_size != taseditorConfig.maxUndoLevels)
|
if (newValue != taseditorConfig.maxUndoLevels)
|
||||||
{
|
{
|
||||||
taseditorConfig.maxUndoLevels = new_size;
|
taseditorConfig.maxUndoLevels = newValue;
|
||||||
history.updateHistoryLogSize();
|
history.updateHistoryLogSize();
|
||||||
selection.updateHistoryLogSize();
|
selection.updateHistoryLogSize();
|
||||||
}
|
}
|
||||||
|
@ -1287,10 +1287,10 @@ BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
// transpose Selection to the beginning and scroll to it
|
// transpose Selection to the beginning and scroll to it
|
||||||
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
||||||
{
|
{
|
||||||
int selection_beginning = selection.getCurrentRowsSelectionBeginning();
|
int selectionBeginning = selection.getCurrentRowsSelectionBeginning();
|
||||||
if (selection_beginning >= 0)
|
if (selectionBeginning >= 0)
|
||||||
{
|
{
|
||||||
selection.transposeVertically(-selection_beginning);
|
selection.transposeVertically(-selectionBeginning);
|
||||||
pianoRoll.ensureTheLineIsVisible(0);
|
pianoRoll.ensureTheLineIsVisible(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1301,10 +1301,10 @@ BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
// transpose Selection to the end and scroll to it
|
// transpose Selection to the end and scroll to it
|
||||||
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
||||||
{
|
{
|
||||||
int selection_end = selection.getCurrentRowsSelectionEnd();
|
int selectionEnd = selection.getCurrentRowsSelectionEnd();
|
||||||
if (selection_end >= 0)
|
if (selectionEnd >= 0)
|
||||||
{
|
{
|
||||||
selection.transposeVertically(currMovieData.getNumRecords() - 1 - selection_end);
|
selection.transposeVertically(currMovieData.getNumRecords() - 1 - selectionEnd);
|
||||||
pianoRoll.ensureTheLineIsVisible(currMovieData.getNumRecords() - 1);
|
pianoRoll.ensureTheLineIsVisible(currMovieData.getNumRecords() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1323,9 +1323,9 @@ BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
||||||
{
|
{
|
||||||
selection.transposeVertically(-1);
|
selection.transposeVertically(-1);
|
||||||
int selection_beginning = selection.getCurrentRowsSelectionBeginning();
|
int selectionBeginning = selection.getCurrentRowsSelectionBeginning();
|
||||||
if (selection_beginning >= 0)
|
if (selectionBeginning >= 0)
|
||||||
pianoRoll.ensureTheLineIsVisible(selection_beginning);
|
pianoRoll.ensureTheLineIsVisible(selectionBeginning);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACCEL_CTRL_DOWN:
|
case ACCEL_CTRL_DOWN:
|
||||||
|
@ -1333,9 +1333,9 @@ BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION)
|
||||||
{
|
{
|
||||||
selection.transposeVertically(1);
|
selection.transposeVertically(1);
|
||||||
int selection_end = selection.getCurrentRowsSelectionEnd();
|
int selectionEnd = selection.getCurrentRowsSelectionEnd();
|
||||||
if (selection_end >= 0)
|
if (selectionEnd >= 0)
|
||||||
pianoRoll.ensureTheLineIsVisible(selection_end);
|
pianoRoll.ensureTheLineIsVisible(selectionEnd);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACCEL_CTRL_LEFT:
|
case ACCEL_CTRL_LEFT:
|
||||||
|
|
Loading…
Reference in New Issue