RAIntegration crashfix

This commit is contained in:
Henrik Rydgård committed 2026-07-27 18:37:28 +02:00
1 parent e30b90e709
commit 456cfb0f5a
3 files changed
+17 -2

No files matched your search

+15 -2
View File
@@ -674,6 +674,16 @@ void Initialize() {
rc_client_set_encore_mode_enabled(g_rcClient, g_Config.bAchievementsEncoreMode ? 1 : 0);
rc_client_set_unofficial_enabled(g_rcClient, g_Config.bAchievementsUnofficial ? 1 : 0);
#ifdef RC_CLIENT_SUPPORTS_RAINTEGRATION
if (!g_Config.bAchievementsEnableRAIntegration) {
TryLoginByToken(true);
}
#else
TryLoginByToken(true);
#endif
}
void InitializeRAIntegration(void *windowHandle) {
#ifdef RC_CLIENT_SUPPORTS_RAINTEGRATION
if (g_Config.bAchievementsEnableRAIntegration) {
wchar_t szFilePath[MAX_PATH];
@@ -684,12 +694,15 @@ void Initialize() {
break;
}
}
HWND hWnd = (HWND)System_GetPropertyInt(SYSPROP_MAIN_WINDOW_HANDLE);
HWND hWnd = (HWND)windowHandle;
if (!hWnd) {
ERROR_LOG(Log::Achievements, "RAIntegration is enabled, but no main window handle was found.");
return;
}
rc_client_begin_load_raintegration(g_rcClient, szFilePath, hWnd, "PPSSPP", PPSSPP_GIT_VERSION, &load_integration_callback, hWnd);
return;
}
#endif
TryLoginByToken(true);
}
bool HasToken() {
+1
View File
@@ -71,6 +71,7 @@ bool RAIntegrationDirty();
rc_client_t *GetClient();
void Initialize();
void InitializeRAIntegration(void *windowHandle); // This must be call after the main window exists.
void UpdateSettings();
bool LoginProblems(std::string *errorString);
+1
View File
@@ -1205,6 +1205,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
MainWindow::Show(_hInstance);
HWND hwndMain = MainWindow::GetHWND();
Achievements::InitializeRAIntegration(hwndMain);
//initialize custom controls
CtrlDisAsmView::init();