From c6191a4474b4cab60cc9886860c8b6de7c4e146b Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Fri, 13 Aug 2010 01:32:56 +0000 Subject: dfxvideo: Readded windows support. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@56047 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- win32/gui/Win32.h | 1 - win32/gui/WndMain.c | 29 ++++++++++------------------- win32/gui/plugin.c | 2 -- 3 files changed, 10 insertions(+), 22 deletions(-) (limited to 'win32/gui') diff --git a/win32/gui/Win32.h b/win32/gui/Win32.h index 39aa59f3..bfe51543 100644 --- a/win32/gui/Win32.h +++ b/win32/gui/Win32.h @@ -58,7 +58,6 @@ void PADhandleKey(int key); int LoadConfig(); void SaveConfig(); -void UpdateMenuSlots(); void ResetMenuSlots(); void InitLanguages(); diff --git a/win32/gui/WndMain.c b/win32/gui/WndMain.c index 2e1ae141..cee6a11f 100644 --- a/win32/gui/WndMain.c +++ b/win32/gui/WndMain.c @@ -210,26 +210,16 @@ void RestoreWindow() { ShowCursor(TRUE); } -int Slots[5] = { -1, -1, -1, -1, -1 }; - -void ResetMenuSlots() { - int i; - - for (i = 0; i < 5; i++) { - if (Slots[i] == -1) - EnableMenuItem(GetSubMenu(gApp.hMenu, 0), ID_FILE_STATES_LOAD_SLOT1+i, MF_GRAYED); - else - EnableMenuItem(GetSubMenu(gApp.hMenu, 0), ID_FILE_STATES_LOAD_SLOT1+i, MF_ENABLED); - } -} - -void UpdateMenuSlots() { +void ResetMenuSlots() { char str[256]; int i; - for (i = 0; i < 5; i++) { - GetStateFilename(str, i); - Slots[i] = CheckState(str); + for (i = 0; i < 9; i++) { + GetStateFilename(str, i); + if (CheckState(str) == -1) + EnableMenuItem(gApp.hMenu, ID_FILE_STATES_LOAD_SLOT1+i, MF_GRAYED); + else + EnableMenuItem(gApp.hMenu, ID_FILE_STATES_LOAD_SLOT1+i, MF_ENABLED); } } @@ -1603,7 +1593,9 @@ void CreateMainMenu() { EnableMenuItem(gApp.hMenu, ID_CONFIGURATION, MF_BYCOMMAND | MF_GRAYED); if (!UsingIso()) { EnableMenuItem(gApp.hMenu, ID_EMULATOR_SWITCH_ISO, MF_BYCOMMAND | MF_GRAYED); - } + } + + ResetMenuSlots(); } else { EnableMenuItem(gApp.hMenu, ID_EMULATOR_RESET, MF_BYCOMMAND | MF_GRAYED); EnableMenuItem(gApp.hMenu, ID_EMULATOR_RUN, MF_BYCOMMAND | MF_GRAYED); @@ -1662,7 +1654,6 @@ void CreateMainWindow(int nCmdShow) { NULL); gApp.hWnd = hWnd; - ResetMenuSlots(); CreateMainMenu(); SetMenu(gApp.hWnd, gApp.hMenu); diff --git a/win32/gui/plugin.c b/win32/gui/plugin.c index 57171a34..b3939028 100644 --- a/win32/gui/plugin.c +++ b/win32/gui/plugin.c @@ -308,8 +308,6 @@ void ClosePlugins() { PAD1_close(); PAD2_close(); - UpdateMenuSlots(); - ret = CDR_close(); if (ret < 0) { SysMessage (_("Error Closing CDR Plugin")); return; } ret = GPU_close(); -- cgit v1.2.3