GUI: BUGFIX: (Save)State in GS window title can get out of sync with actual current slot (after loading/saving state via the menu).

Details:
- It seems that due to legacy reasons, Lilypad is setting the current state at the GS window title, as a hack which is enabled by default (at Lilypad's main GUI tab). However, it's buggy because it only changes the display when (shift/)F2 is pressed, while the current slot actually also changes when loading/saving state via the PCSX2 main menu, so it can get out of sync (possibly with unpleasant results, especially when saving). Now it's disabled by default at Lilypad, and if enabled, displayed as "State(Lilypad)".

- PCSX2 itself now properly handles the current State slot at the GS title window.

Note: ZeroGS still changes its title independently (not via the "standard" PCSX2 mechanism) so Lilypad's title hack might still be useful for it. However, it's still buggy and can get still out of sync.

TODO: Remove this option completely from Lilypad because it's buggy? ZeroGS can still use it, but I think it can cause more harm than good. What do you think?

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4656 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
avihal@gmail.com 2011-05-17 11:18:45 +00:00
parent de826932e4
commit 1420318b04
4 changed files with 7 additions and 6 deletions

View File

@ -71,4 +71,4 @@ extern void States_CycleSlotForward();
extern void States_CycleSlotBackward();
extern void States_SetCurrentSlot( int slot );
extern int States_GetCurrentSlot( int slot );
extern int States_GetCurrentSlot();

View File

@ -17,6 +17,7 @@
#include "App.h"
#include "GSFrame.h"
#include "AppAccelerators.h"
#include "AppSaveStates.h"
#include "GS.h"
#include "MSWstuff.h"
@ -454,11 +455,11 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt )
const u64& smode2 = *(u64*)PS2GS_BASE(GS_SMODE2);
SetTitle( pxsFmt( L"%s | %s (%s) | Limiter: %s | fps: %6.02f%s",
SetTitle( pxsFmt( L"%s | %s (%s) | Limiter: %s | fps: %6.02f%s | State %d",
fromUTF8(gsDest).c_str(),
(smode2 & 1) ? L"Interlaced" : L"Progressive",
(smode2 & 2) ? L"frame" : L"field",
limiterStr, fps, cpuUsage.c_str() )
limiterStr, fps, cpuUsage.c_str(), States_GetCurrentSlot() )
);
//States_GetCurrentSlot()

View File

@ -57,7 +57,7 @@ const GeneralSettingsBool BoolOptionsInfo[] = {
{L"Disable Screen Saver", IDC_DISABLE_SCREENSAVER, 1},
{L"Logging", IDC_DEBUG_FILE, 0},
{L"Save State in Title", IDC_SAVE_STATE_TITLE, 1},
{L"Save State in Title", IDC_SAVE_STATE_TITLE, 0}, //No longer required, PCSX2 now handles it - avih 2011-05-17
{L"GH2", IDC_GH2_HACK, 0},
{L"Vista Volume", IDC_VISTA_VOLUME, 1},

View File

@ -823,8 +823,8 @@ ExtraWndProcResult TitleHackWndProc(HWND hWndTop, UINT uMsg, WPARAM wParam, LPAR
else {
len = MultiByteToWideChar(CP_ACP, 0, (char*) lParam, -1, text, sizeof(text)/sizeof(wchar_t));
}
if (len > 0 && len < 150 && !wcsstr(text, L" | State ")) {
wsprintfW(text+len, L" | State %i", saveStateIndex);
if (len > 0 && len < 150 && !wcsstr(text, L" | State(Lilypad) ")) {
wsprintfW(text+len, L" | State(Lilypad) %i", saveStateIndex);
SetWindowText(hWndTop, text);
return NO_WND_PROC;
}