mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 16:19:44 +00:00
Pause rendering when minimized, when appropriate (hopefully? This is sort of hard to test.).
This commit is contained in:
parent
1fbd94d589
commit
8a78f5e814
@ -419,6 +419,7 @@ enum SkipDrawReasonFlags {
|
||||
SKIPDRAW_SKIPFRAME = 1,
|
||||
SKIPDRAW_NON_DISPLAYED_FB = 2, // Skip drawing to FBO:s that have not been displayed.
|
||||
SKIPDRAW_BAD_FB_TEXTURE = 4,
|
||||
SKIPDRAW_WINDOW_MINIMIZED = 8, // Don't draw when the host window is minimized.
|
||||
};
|
||||
|
||||
bool vertTypeIsSkinningEnabled(u32 vertType);
|
||||
|
@ -224,6 +224,12 @@ void EmuScreen::sendMessage(const char *message, const char *value) {
|
||||
if (PSP_IsInited()) {
|
||||
currentMIPS->UpdateCore(g_Config.bJit ? CPU_JIT : CPU_INTERPRETER);
|
||||
}
|
||||
} else if (!strcmp(message, "window minimized")) {
|
||||
if (!strcmp(value, "true")) {
|
||||
gstate_c.skipDrawReason |= SKIPDRAW_WINDOW_MINIMIZED;
|
||||
} else {
|
||||
gstate_c.skipDrawReason &= ~SKIPDRAW_WINDOW_MINIMIZED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "Core/HLE/sceUtility.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "GPU/GPUState.h"
|
||||
|
||||
#include "ui_atlas.h"
|
||||
|
||||
@ -197,6 +198,12 @@ void UIDialogScreenWithBackground::sendMessage(const char *message, const char *
|
||||
auto langScreen = new NewLanguageScreen(de->T("Language"));
|
||||
langScreen->OnChoice.Handle(this, &UIDialogScreenWithBackground::OnLanguageChange);
|
||||
screenManager()->push(langScreen);
|
||||
} else if (!strcmp(message, "window minimized")) {
|
||||
if (!strcmp(value, "true")) {
|
||||
gstate_c.skipDrawReason |= SKIPDRAW_WINDOW_MINIMIZED;
|
||||
} else {
|
||||
gstate_c.skipDrawReason &= ~SKIPDRAW_WINDOW_MINIMIZED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1093,11 +1093,17 @@ namespace MainWindow
|
||||
case SIZE_MAXIMIZED:
|
||||
case SIZE_RESTORED:
|
||||
Core_NotifyWindowHidden(false);
|
||||
if (!g_Config.bPauseWhenMinimized) {
|
||||
NativeMessageReceived("window minimized", "false");
|
||||
}
|
||||
SavePosition();
|
||||
ResizeDisplay();
|
||||
break;
|
||||
case SIZE_MINIMIZED:
|
||||
Core_NotifyWindowHidden(g_Config.bPauseWhenMinimized);
|
||||
if (!g_Config.bPauseWhenMinimized) {
|
||||
NativeMessageReceived("window minimized", "true");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user