Windows: Make UI update significantly cheaper.

Setting menu strings, reloading shaders, and redrawing the menu were all
a bit slow.  This skips those things unless they've changed.
This commit is contained in:
Unknown W. Brackets committed 2017-04-04 20:33:22 -07:00
1 parent e99f1c00ff
commit 6642bf3170
6 files changed
+63 -21

No files matched your search

+3 -4
View File
@@ -863,8 +863,9 @@ namespace MainWindow
break;
case WM_USER_UPDATE_UI:
// This also calls ChangeMenu
TranslateMenus(hwndMain, menu);
// Update checked status immediately for accelerators.
UpdateMenus();
break;
case WM_USER_WINDOW_TITLE_CHANGED:
@@ -881,9 +882,7 @@ namespace MainWindow
case WM_MENUSELECT:
// Called when a menu is opened. Also when an item is selected, but meh.
// This is a good place to update the enabled/disabled state of menu items.
UpdateMenus();
SetIngameMenuItemStates(menu, GetUIState());
UpdateMenus(true);
WindowsRawInput::NotifyMenu();
break;