mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
RAIntegration crashfix
This commit is contained in:
1 parent
e30b90e709
commit
456cfb0f5a
3 files changed
+17
-2
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user