mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Settings: Don't keep the draw and UI contexts in page callbacks
Android replaces both when it loses the surface (a recreate, which
changing the display resolution does, or switching away), but the
settings screen and its views live on. The external display setting's
enabled check, which runs on every draw, then called into the deleted
DrawContext ("Pure virtual function called!"). The UI scale and
"Reload UI atlas" handlers had the same problem with the UIContext.
Look them up through the screen manager when needed instead.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
aa9dfa85f6
commit
ac8440e35d
3 files changed
+10
-8
No files matched your search
@@ -175,8 +175,10 @@ void BuildGraphicsSettings(SettingsPage *page) {
|
||||
|
||||
#if (PPSSPP_PLATFORM(IOS) && !PPSSPP_PLATFORM(TVOS)) || PPSSPP_PLATFORM(ANDROID)
|
||||
// Showing the game there needs a second swapchain. Otherwise the system mirrors the screen.
|
||||
page->Setting(&g_Config.iExternalDisplay).EnabledFunc([draw] {
|
||||
return draw->GetDeviceCaps().multipleSwapchains;
|
||||
// Looked up each time: the draw context is replaced when Android loses the surface, and this page isn't rebuilt.
|
||||
page->Setting(&g_Config.iExternalDisplay).EnabledFunc([host] {
|
||||
Draw::DrawContext *draw = host->PageScreenManager()->getDrawContext();
|
||||
return draw && draw->GetDeviceCaps().multipleSwapchains;
|
||||
}).OnChange([previous = g_Config.iExternalDisplay](UI::EventParams &e) mutable {
|
||||
// Picking the current value again would rebuild the TV's output for nothing (iOS starts over on a change).
|
||||
if (g_Config.iExternalDisplay == previous) {
|
||||
|
||||
Reference in new issue
Block a user