lilypad: Remove saveStateTitle and leftovers TitleHackWndProc, PCSX2_overrideConfig.

This commit is contained in:
lightningterror 2020-09-03 02:41:47 +02:00
parent 27542901c8
commit c1ec6337a4
4 changed files with 1 additions and 57 deletions

View File

@ -42,16 +42,8 @@ const wchar_t *padTypes[] = {
L"PS1 Mouse", L"PS1 Mouse",
L"neGcon"}; L"neGcon"};
// Hacks or configurations which PCSX2 needs with a specific value
void PCSX2_overrideConfig(GeneralConfig &config_in_out)
{
config_in_out.saveStateTitle = 0; // Not required - handled internally by PCSX2
}
GeneralConfig config; GeneralConfig config;
HWND hWndProp = 0; HWND hWndProp = 0;
int selected = 0; int selected = 0;
bool quickSetup = false; bool quickSetup = false;
@ -1133,8 +1125,6 @@ int LoadSettings(int force, wchar_t *file)
RefreshEnabledDevicesAndDisplay(1); RefreshEnabledDevicesAndDisplay(1);
PCSX2_overrideConfig(config);
return 0; return 0;
} }

View File

@ -61,7 +61,6 @@ public:
u8 debug; u8 debug;
u8 saveStateTitle;
u8 GH2; u8 GH2;
}; };
u8 bools[15]; u8 bools[15];

View File

@ -910,35 +910,6 @@ static const u8 queryMode[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const u8 setNativeMode[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A}; static const u8 setNativeMode[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A};
#ifdef _MSC_VER #ifdef _MSC_VER
// Implements a couple of the hacks that affect whatever top-level window
// the GS viewport belongs to (title, screensaver)
ExtraWndProcResult TitleHackWndProc(HWND hWndTop, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *output)
{
switch (uMsg) {
case WM_SETTEXT:
if (config.saveStateTitle) {
wchar_t text[200];
int len;
if (IsWindowUnicode(hWndTop)) {
len = wcslen((wchar_t *)lParam);
if (len < sizeof(text) / sizeof(wchar_t))
wcscpy(text, (wchar_t *)lParam);
} else {
len = MultiByteToWideChar(CP_ACP, 0, (char *)lParam, -1, text, sizeof(text) / sizeof(wchar_t));
}
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;
}
}
break;
default:
break;
}
return CONTINUE_BLISSFULLY;
}
// Useful sequence before changing into active/inactive state. // Useful sequence before changing into active/inactive state.
// Handles hooking/unhooking of mouse and KB and also mouse cursor visibility. // Handles hooking/unhooking of mouse and KB and also mouse cursor visibility.
// towardsActive==true indicates we're gaining activity (on focus etc), false is for losing activity (on close, kill focus, etc). // towardsActive==true indicates we're gaining activity (on focus etc), false is for losing activity (on close, kill focus, etc).
@ -1035,17 +1006,6 @@ DWORD WINAPI RenameWindowThreadProc(void *lpParameter)
} }
return 0; return 0;
} }
void SaveStateChanged()
{
if (config.saveStateTitle) {
// GSDX only checks its window's message queue at certain points or something, so
// have to do this in another thread to prevent deadlock.
HANDLE hThread = CreateThread(0, 0, RenameWindowThreadProc, 0, 0, 0);
if (hThread)
CloseHandle(hThread);
}
}
#endif #endif
s32 CALLBACK PADopen(void *pDsp) s32 CALLBACK PADopen(void *pDsp)
@ -1091,14 +1051,11 @@ s32 CALLBACK PADopen(void *pDsp)
openCount = 0; openCount = 0;
return -1; return -1;
} }
hWndTopProc.Eat(TitleHackWndProc, 0); }
} else
hWndGSProc.Eat(TitleHackWndProc, 0);
if (config.forceHide) { if (config.forceHide) {
hWndGSProc.Eat(HideCursorProc, 0); hWndGSProc.Eat(HideCursorProc, 0);
} }
SaveStateChanged();
windowThreadId = GetWindowThreadProcessId(hWndTop, 0); windowThreadId = GetWindowThreadProcessId(hWndTop, 0);
} }
@ -1575,7 +1532,6 @@ keyEvent *CALLBACK PADkeyEvent()
if (ev.key == VK_F2 && ev.evt == KEYPRESS) { if (ev.key == VK_F2 && ev.evt == KEYPRESS) {
saveStateIndex += 1 - 2 * shiftDown; saveStateIndex += 1 - 2 * shiftDown;
saveStateIndex = (saveStateIndex + 10) % 10; saveStateIndex = (saveStateIndex + 10) % 10;
SaveStateChanged();
} }
// So don't change skip mode on alt-F4. // So don't change skip mode on alt-F4.

View File

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