diff --git a/trunk/src/drivers/win/config.cpp b/trunk/src/drivers/win/config.cpp index 180079b4..04ed5a9c 100644 --- a/trunk/src/drivers/win/config.cpp +++ b/trunk/src/drivers/win/config.cpp @@ -87,6 +87,8 @@ extern int DbgSizeX,DbgSizeY; extern int MemViewSizeX,MemViewSizeY; extern int MemView_wndx, MemView_wndy; extern bool MemView_HighlightActivity; +extern unsigned int MemView_HighlightActivity_FadingPeriod; +extern bool MemView_HighlightActivity_FadeWhenPaused; extern int MemFind_wndx, MemFind_wndy; extern int NTViewPosX,NTViewPosY; extern int PPUViewPosX,PPUViewPosY; @@ -287,6 +289,8 @@ static CFGSTRUCT fceuconfig[] = AC(MemView_wndx), AC(MemView_wndy), AC(MemView_HighlightActivity), + AC(MemView_HighlightActivity_FadingPeriod), + AC(MemView_HighlightActivity_FadeWhenPaused), AC(MemFind_wndx), AC(MemFind_wndy), AC(NTViewPosX), diff --git a/trunk/src/drivers/win/memview.cpp b/trunk/src/drivers/win/memview.cpp index bf6361df..cdd9f810 100644 --- a/trunk/src/drivers/win/memview.cpp +++ b/trunk/src/drivers/win/memview.cpp @@ -47,6 +47,8 @@ extern Name* ramBankNames; extern unsigned char *cdloggervdata; extern unsigned int cdloggerVideoDataSize; +extern bool JustFrameAdvanced; + using namespace std; #define MODE_NES_MEMORY 0 @@ -60,6 +62,7 @@ using namespace std; #define ID_ADDRESS_SEEK_IN_ROM 5 #define ID_ADDRESS_CREATE_GG_CODE 6 #define ID_ADDRESS_BOOKMARK 20 +#define BOOKMARKS_SUBMENU_POS 4 #define ID_ADDRESS_FRZ_TOGGLE_STATE 1 #define ID_ADDRESS_FRZ_FREEZE 50 @@ -68,10 +71,10 @@ using namespace std; #define ID_ADDRESS_FRZ_UNFREEZE_ALL 53 #define HIGHLIGHT_ACTIVITY_MIN_VALUE 0 -#define HIGHLIGHT_ACTIVITY_MAX_VALUE 16 +#define HIGHLIGHT_ACTIVITY_NUM_COLORS 16 #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 @@ -157,6 +160,8 @@ int TableFileLoaded; int MemView_wndx, MemView_wndy; int MemFind_wndx, MemFind_wndy; bool MemView_HighlightActivity = true; +unsigned int MemView_HighlightActivity_FadingPeriod = HIGHLIGHT_ACTIVITY_NUM_COLORS; +bool MemView_HighlightActivity_FadeWhenPaused = false; int MemViewSizeX = 580, MemViewSizeY = 248; static RECT newMemViewRect; @@ -178,7 +183,7 @@ COLORREF *BGColorList; COLORREF *TextColorList; int PreviousCurOffset; int *PreviousValues; // for HighlightActivity feature and for speedhack too -int *HighlightedBytes; +unsigned int *HighlightedBytes; int lbuttondown, lbuttondownx, lbuttondowny; int mousex, mousey; @@ -435,6 +440,7 @@ void UpdateMemoryView(int draw_all) int i, j; int byteValue; + int byteHighlightingValue; //LPVOID lpMsgBuf; //int curlength; char str[100]; @@ -475,10 +481,11 @@ void UpdateMemoryView(int draw_all) for(j = 0;j < 16;j++) { byteValue = GetMemViewData(i+j); - if (MemView_HighlightActivity) - if ((PreviousValues[i+j-CurOffset] != byteValue) && (PreviousValues[i+j-CurOffset] != PREVIOUS_VALUE_UNDEFINED)) - HighlightedBytes[i+j-CurOffset] = HIGHLIGHT_ACTIVITY_MAX_VALUE; - + if (MemView_HighlightActivity && ((PreviousValues[i+j-CurOffset] != byteValue) && (PreviousValues[i+j-CurOffset] != PREVIOUS_VALUE_UNDEFINED))) + byteHighlightingValue = HighlightedBytes[i+j-CurOffset] = MemView_HighlightActivity_FadingPeriod; + else + byteHighlightingValue = HighlightedBytes[i+j-CurOffset]; + if ((CursorEndAddy == -1) && (CursorStartAddy == i+j)) { //print up single highlighted text @@ -507,8 +514,8 @@ void UpdateMemoryView(int draw_all) // 2nd nybble MoveToEx(HDataDC, MemFontWidth + 8 * MemFontWidth + (j * 3 * MemFontWidth), MemFontHeight * ((i - CurOffset) / 16), NULL); sprintf(str,"%X", byteValue % 16); - SetTextColor(HDataDC,TextColorList[i+j-CurOffset]); //single address highlight 2nd address - SetBkColor(HDataDC,RGB(HexBackColorR,HexBackColorG,HexBackColorB)); + SetTextColor(HDataDC,TextColorList[i+j-CurOffset]); + SetBkColor(HDataDC,BGColorList[i+j-CurOffset]); TextOut(HDataDC,0,0,str,1); } //TextOut(HDataDC,0,0," ",1); @@ -524,16 +531,28 @@ void UpdateMemoryView(int draw_all) TextOut(HDataDC,0,0,str,1); 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 - if (HighlightedBytes[i+j-CurOffset]) + if (byteHighlightingValue) { // fade out 1 step - if (--HighlightedBytes[i+j-CurOffset] > 0) - SetTextColor(HDataDC, highlightActivityColors[HighlightedBytes[i+j-CurOffset]]);//(8+j*3)*MemFontWidth - else - SetTextColor(HDataDC,TextColorList[i+j-CurOffset]);//(8+j*3)*MemFontWidth + if (MemView_HighlightActivity_FadeWhenPaused || !FCEUI_EmulationPaused() || JustFrameAdvanced) + byteHighlightingValue = (--HighlightedBytes[i+j-CurOffset]); + + 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 { 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)); BGColorList = (COLORREF*)malloc(DataAmount*sizeof(COLORREF)); PreviousValues = (int*)malloc(DataAmount*sizeof(int)); - HighlightedBytes = (int*)malloc(DataAmount*sizeof(int)); + HighlightedBytes = (unsigned int*)malloc(DataAmount*sizeof(unsigned int)); resetHighlightingActivityLog(); EditingText = CurOffset = 0; 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), 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; case WM_PAINT: hdc = BeginPaint(hwnd, &ps); @@ -1709,7 +1729,7 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa } else { - updateBookmarkMenus(GetSubMenu(GetMenu(hwnd), 3)); + updateBookmarkMenus(GetSubMenu(GetMenu(hwnd), BOOKMARKS_SUBMENU_POS)); UpdateColorTable(); } } @@ -1763,7 +1783,7 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa TextColorList = (COLORREF*)realloc(TextColorList,DataAmount*sizeof(COLORREF)); BGColorList = (COLORREF*)realloc(BGColorList,DataAmount*sizeof(COLORREF)); PreviousValues = (int*)realloc(PreviousValues,(DataAmount)*sizeof(int)); - HighlightedBytes = (int*)realloc(HighlightedBytes,(DataAmount)*sizeof(int)); + HighlightedBytes = (unsigned int*)realloc(HighlightedBytes,(DataAmount)*sizeof(unsigned int)); resetHighlightingActivityLog(); } //Set vertical scroll bar range and page size @@ -1927,20 +1947,48 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa UpdateCaption(); return 0; - case ID_VIEW_HIGHLIGHT_ACTIVITY: + case ID_HIGHLIGHTING_HIGHLIGHT_ACTIVITY: { 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(); return 0; } + // ################################## Start of SP CODE ########################### case MENU_MV_BOOKMARKS_RM_ALL: if (nextBookmark) { if (MessageBox(hwnd, "Remove All Bookmarks?", "Bookmarks", MB_YESNO) == IDYES) { - removeAllBookmarks(GetSubMenu(GetMenu(hwnd), 3)); + removeAllBookmarks(GetSubMenu(GetMenu(hwnd), BOOKMARKS_SUBMENU_POS)); UpdateColorTable(); } } diff --git a/trunk/src/drivers/win/res.rc b/trunk/src/drivers/win/res.rc index a438f701..ecf8821a 100644 --- a/trunk/src/drivers/win/res.rc +++ b/trunk/src/drivers/win/res.rc @@ -343,8 +343,12 @@ BEGIN MENUITEM "&NES Memory", MENU_MV_VIEW_RAM MENUITEM "&PPU Memory", MENU_MV_VIEW_PPU MENUITEM "&ROM File", MENU_MV_VIEW_ROM - MENUITEM SEPARATOR - MENUITEM "Highlight Activity", ID_VIEW_HIGHLIGHT_ACTIVITY + END + 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 POPUP "&Bookmarks" BEGIN diff --git a/trunk/src/drivers/win/resource.h b/trunk/src/drivers/win/resource.h index 7bb52dfd..b8cfe5b7 100644 --- a/trunk/src/drivers/win/resource.h +++ b/trunk/src/drivers/win/resource.h @@ -1188,6 +1188,9 @@ #define ID_VIEW_A 40583 #define ID_VIEW_HIGHLIGHT 40584 #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 MW_ValueLabel2 65423 #define MW_ValueLabel1 65426 @@ -1200,7 +1203,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #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_SYMED_VALUE 101 #endif diff --git a/trunk/src/drivers/win/taseditor/piano_roll.cpp b/trunk/src/drivers/win/taseditor/piano_roll.cpp index cc0dbdc0..96b71516 100644 --- a/trunk/src/drivers/win/taseditor/piano_roll.cpp +++ b/trunk/src/drivers/win/taseditor/piano_roll.cpp @@ -54,7 +54,8 @@ LRESULT APIENTRY markerDragBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LP // resources char pianoRollSaveID[PIANO_ROLL_ID_LEN] = "PIANO_ROLL"; 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 }; char markerDragBoxClassName[] = "MarkerDragBox"; diff --git a/trunk/src/drivers/win/taseditor/taseditor_window.cpp b/trunk/src/drivers/win/taseditor/taseditor_window.cpp index a1eae3a8..736a2cb7 100644 --- a/trunk/src/drivers/win/taseditor/taseditor_window.cpp +++ b/trunk/src/drivers/win/taseditor/taseditor_window.cpp @@ -224,16 +224,16 @@ void TASEDITOR_WINDOW::init() { // for static text we specify rectangle toolInfo.uFlags = TTF_SUBCLASS; - RECT tool_rect; - GetWindowRect(GetDlgItem(hwndTASEditor, windowItems[i].id), &tool_rect); + RECT toolRect; + GetWindowRect(GetDlgItem(hwndTASEditor, windowItems[i].id), &toolRect); POINT pt; - pt.x = tool_rect.left; - pt.y = tool_rect.top; + pt.x = toolRect.left; + pt.y = toolRect.top; ScreenToClient(hwndTASEditor, &pt); 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.bottom = toolInfo.rect.top + (tool_rect.bottom - tool_rect.top); + toolInfo.rect.bottom = toolInfo.rect.top + (toolRect.bottom - toolRect.top); } else { // for other controls we provide hwnd @@ -328,7 +328,7 @@ void TASEDITOR_WINDOW::update() if (mustUpdateMouseCursor) { // change mouse cursor depending on what it points at - LPCSTR cursor_icon = IDC_ARROW; + LPCSTR cursorIcon = IDC_ARROW; switch (pianoRoll.dragMode) { case DRAG_MODE_NONE: @@ -336,23 +336,23 @@ void TASEDITOR_WINDOW::update() // normal mouseover if (bookmarks.editMode == EDIT_MODE_BRANCHES) { - int branch_under_mouse = bookmarks.itemUnderMouse; - if (branch_under_mouse >= 0 && branch_under_mouse < TOTAL_BOOKMARKS && bookmarks.bookmarksArray[branch_under_mouse].notEmpty) + int branchUnderMouse = bookmarks.itemUnderMouse; + if (branchUnderMouse >= 0 && branchUnderMouse < TOTAL_BOOKMARKS && bookmarks.bookmarksArray[branchUnderMouse].notEmpty) { - int current_branch = branches.getCurrentBranch(); - if (current_branch >= 0 && current_branch < TOTAL_BOOKMARKS) + int currentBranch = branches.getCurrentBranch(); + if (currentBranch >= 0 && currentBranch < TOTAL_BOOKMARKS) { // find if the Branch belongs to the current timeline - int timeline_branch = branches.findFullTimelineForBranch(current_branch); - while (timeline_branch != ITEM_UNDER_MOUSE_CLOUD) + int timelineBranch = branches.findFullTimelineForBranch(currentBranch); + while (timelineBranch != ITEM_UNDER_MOUSE_CLOUD) { - if (timeline_branch == branch_under_mouse) + if (timelineBranch == branchUnderMouse) break; - timeline_branch = branches.getParentOf(timeline_branch); + timelineBranch = branches.getParentOf(timelineBranch); } - if (timeline_branch == ITEM_UNDER_MOUSE_CLOUD) - // branch_under_mouse wasn't found in current timeline - cursor_icon = IDC_HELP; + if (timelineBranch == ITEM_UNDER_MOUSE_CLOUD) + // branchUnderMouse wasn't found in current timeline - change mouse cursor to a "?" mark + cursorIcon = IDC_HELP; } } } @@ -362,13 +362,13 @@ void TASEDITOR_WINDOW::update() { // user is dragging Playback cursor - show either normal arrow or arrow+wait if (playback.getPauseFrame() >= 0) - cursor_icon = IDC_APPSTARTING; + cursorIcon = IDC_APPSTARTING; break; } case DRAG_MODE_MARKER: { // user is dragging Marker - cursor_icon = IDC_SIZEALL; + cursorIcon = IDC_SIZEALL; break; } case DRAG_MODE_OBSERVE: @@ -379,7 +379,7 @@ void TASEDITOR_WINDOW::update() // user is drawing/selecting - show normal arrow break; } - SetCursor(LoadCursor(0, cursor_icon)); + SetCursor(LoadCursor(0, cursorIcon)); mustUpdateMouseCursor = false; } } @@ -515,10 +515,10 @@ void TASEDITOR_WINDOW::changeBookmarksListHeight(int newHeight) if (!delta) return; // 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) { - if (windowItems[i].y > BookmarksList_bottom) + if (windowItems[i].y > BookmarksListBottom) windowItems[i].y += delta; } // adjust Bookmarks List size @@ -556,21 +556,21 @@ void TASEDITOR_WINDOW::updateTooltips() void TASEDITOR_WINDOW::updateCaption() { - char new_caption[300]; - strcpy(new_caption, windowCaptioBase); + char newCaption[300]; + strcpy(newCaption, windowCaptioBase); if (!movie_readonly) - strcat(new_caption, recorder.getRecordingCaption()); + strcat(newCaption, recorder.getRecordingCaption()); // add project name std::string projectname = project.getProjectName(); if (!projectname.empty()) { - strcat(new_caption, " - "); - strcat(new_caption, projectname.c_str()); + strcat(newCaption, " - "); + strcat(newCaption, projectname.c_str()); } // and * if project has unsaved changes if (project.getProjectChanged()) - strcat(new_caption, "*"); - SetWindowText(hwndTASEditor, new_caption); + strcat(newCaption, "*"); + SetWindowText(hwndTASEditor, newCaption); } void TASEDITOR_WINDOW::redraw() { @@ -1040,33 +1040,33 @@ BOOL CALLBACK TASEditorWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara break; case ID_CONFIG_SETGREENZONECAPACITY: { - int new_capacity = 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) + 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)", newValue, hWnd) == IDOK) { - if (new_capacity < GREENZONE_CAPACITY_MIN) - new_capacity = GREENZONE_CAPACITY_MIN; - else if (new_capacity > GREENZONE_CAPACITY_MAX) - new_capacity = GREENZONE_CAPACITY_MAX; - if (new_capacity < taseditorConfig.greenzoneCapacity) + if (newValue < GREENZONE_CAPACITY_MIN) + newValue = GREENZONE_CAPACITY_MIN; + else if (newValue > GREENZONE_CAPACITY_MAX) + newValue = GREENZONE_CAPACITY_MAX; + if (newValue < taseditorConfig.greenzoneCapacity) { - taseditorConfig.greenzoneCapacity = new_capacity; + taseditorConfig.greenzoneCapacity = newValue; greenzone.runGreenzoneCleaning(); - } else taseditorConfig.greenzoneCapacity = new_capacity; + } else taseditorConfig.greenzoneCapacity = newValue; } break; } case ID_CONFIG_SETMAXUNDOLEVELS: { - int new_size = taseditorConfig.maxUndoLevels; - if (CWin32InputBox::GetInteger("Max undo levels", "Keep history of how many changes?", new_size, hWnd) == IDOK) + int newValue = taseditorConfig.maxUndoLevels; + if (CWin32InputBox::GetInteger("Max undo levels", "Keep history of how many changes?", newValue, hWnd) == IDOK) { - if (new_size < UNDO_LEVELS_MIN) - new_size = UNDO_LEVELS_MIN; - else if (new_size > UNDO_LEVELS_MAX) - new_size = UNDO_LEVELS_MAX; - if (new_size != taseditorConfig.maxUndoLevels) + if (newValue < UNDO_LEVELS_MIN) + newValue = UNDO_LEVELS_MIN; + else if (newValue > UNDO_LEVELS_MAX) + newValue = UNDO_LEVELS_MAX; + if (newValue != taseditorConfig.maxUndoLevels) { - taseditorConfig.maxUndoLevels = new_size; + taseditorConfig.maxUndoLevels = newValue; history.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 if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION) { - int selection_beginning = selection.getCurrentRowsSelectionBeginning(); - if (selection_beginning >= 0) + int selectionBeginning = selection.getCurrentRowsSelectionBeginning(); + if (selectionBeginning >= 0) { - selection.transposeVertically(-selection_beginning); + selection.transposeVertically(-selectionBeginning); 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 if (pianoRoll.dragMode != DRAG_MODE_SELECTION && pianoRoll.dragMode != DRAG_MODE_DESELECTION) { - int selection_end = selection.getCurrentRowsSelectionEnd(); - if (selection_end >= 0) + int selectionEnd = selection.getCurrentRowsSelectionEnd(); + if (selectionEnd >= 0) { - selection.transposeVertically(currMovieData.getNumRecords() - 1 - selection_end); + selection.transposeVertically(currMovieData.getNumRecords() - 1 - selectionEnd); 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) { selection.transposeVertically(-1); - int selection_beginning = selection.getCurrentRowsSelectionBeginning(); - if (selection_beginning >= 0) - pianoRoll.ensureTheLineIsVisible(selection_beginning); + int selectionBeginning = selection.getCurrentRowsSelectionBeginning(); + if (selectionBeginning >= 0) + pianoRoll.ensureTheLineIsVisible(selectionBeginning); } break; 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) { selection.transposeVertically(1); - int selection_end = selection.getCurrentRowsSelectionEnd(); - if (selection_end >= 0) - pianoRoll.ensureTheLineIsVisible(selection_end); + int selectionEnd = selection.getCurrentRowsSelectionEnd(); + if (selectionEnd >= 0) + pianoRoll.ensureTheLineIsVisible(selectionEnd); } break; case ACCEL_CTRL_LEFT: