mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Fix issue where after a backend change restart, the new instance was considered secondary.
This commit is contained in:
1 parent
ff248ff94f
commit
f9a1a0eee5
2 files changed
+10
-2
No files matched your search
+2
-2
@@ -136,9 +136,9 @@ void InitInstanceCounter() {
|
||||
|
||||
void ShutdownInstanceCounter() {
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
if (hIDMapFile != NULL) {
|
||||
if (hIDMapFile) {
|
||||
CloseHandle(hIDMapFile); // If program exited(or crashed?) or the last handle reference closed the shared memory object will be deleted.
|
||||
hIDMapFile = NULL;
|
||||
hIDMapFile = nullptr;
|
||||
}
|
||||
#elif PPSSPP_PLATFORM(ANDROID)
|
||||
// Do nothing
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "Core/Config.h"
|
||||
#include "Core/ConfigValues.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/Instance.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/TextureReplacer.h"
|
||||
@@ -229,6 +230,11 @@ void GameSettingsScreen::CreateViews() {
|
||||
renderingBackendChoice->HideChoice((int)GPUBackend::DIRECT3D11);
|
||||
if (!g_Config.IsBackendEnabled(GPUBackend::VULKAN))
|
||||
renderingBackendChoice->HideChoice((int)GPUBackend::VULKAN);
|
||||
|
||||
if (!IsFirstInstance()) {
|
||||
// If we're not the first instance, can't save the setting, and it requires a restart, so...
|
||||
renderingBackendChoice->SetEnabled(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
Draw::DrawContext *draw = screenManager()->getDrawContext();
|
||||
@@ -1273,6 +1279,8 @@ void GameSettingsScreen::TriggerRestart(const char *why) {
|
||||
} else if (!gamePath_.empty()) {
|
||||
param += " \"" + ReplaceAll(ReplaceAll(gamePath_, "\\", "\\\\"), "\"", "\\\"") + "\"";
|
||||
}
|
||||
// Make sure the new instance is considered the first.
|
||||
ShutdownInstanceCounter();
|
||||
System_SendMessage("graphics_restart", param.c_str());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user