Merge pull request #16409 from hrydgard/preserve-framebuffers

Preserve framebuffer on pause screen even if render resolution is changed
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2022-11-22 10:03:47 +01:00
commit ddd2c6e343
30 files changed
+165 -151

No files matched your search

+22 -13
View File
@@ -1167,7 +1167,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
#if !PPSSPP_PLATFORM(WINDOWS) && !defined(ANDROID)
PSP_CoreParameter().pixelWidth = pixel_xres;
PSP_CoreParameter().pixelHeight = pixel_yres;
NativeMessageReceived("gpu_resized", "");
NativeMessageReceived("gpu_displayResized", "");
#endif
} else {
// INFO_LOG(G3D, "Polling graphics context");
@@ -1188,10 +1188,10 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
if (msg == "inputDeviceConnectedID") {
nextInputDeviceID = parseLong(value);
}
if (msg == "inputDeviceConnected") {
else if (msg == "inputDeviceConnected") {
KeyMap::NotifyPadConnected(nextInputDeviceID, value);
}
if (msg == "bgImage_updated") {
else if (msg == "bgImage_updated") {
if (!value.empty()) {
Path dest = GetSysDirectory(DIRECTORY_SYSTEM) / (endsWithNoCase(value, ".jpg") ? "background.jpg" : "background.png");
File::Copy(Path(value), dest);
@@ -1199,20 +1199,29 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
UIBackgroundShutdown();
// It will init again automatically. We can't init outside a frame on Vulkan.
}
if (msg == "savestate_displayslot") {
else if (msg == "savestate_displayslot") {
auto sy = GetI18NCategory("System");
std::string msg = StringFromFormat("%s: %d", sy->T("Savestate Slot"), SaveState::GetCurrentSlot() + 1);
// Show for the same duration as the preview.
osm.Show(msg, 2.0f, 0xFFFFFF, -1, true, "savestate_slot");
}
if (msg == "gpu_resized" || msg == "gpu_clearCache") {
else if (msg == "gpu_displayResized") {
if (gpu) {
gpu->ClearCacheNextFrame();
gpu->Resized();
gpu->NotifyDisplayResized();
}
}
else if (msg == "gpu_renderResized") {
if (gpu) {
gpu->NotifyRenderResized();
}
}
else if (msg == "gpu_configChanged") {
if (gpu) {
gpu->NotifyConfigChanged();
}
Reporting::UpdateConfig();
}
if (msg == "core_powerSaving") {
else if (msg == "core_powerSaving") {
if (value != "false") {
auto sy = GetI18NCategory("System");
#if PPSSPP_PLATFORM(ANDROID)
@@ -1223,7 +1232,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
}
Core_SetPowerSaving(value != "false");
}
if (msg == "permission_granted" && value == "storage") {
else if (msg == "permission_granted" && value == "storage") {
#if PPSSPP_PLATFORM(ANDROID)
CreateDirectoriesAndroid();
#endif
@@ -1239,7 +1248,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
PostLoadConfig();
g_Config.iGPUBackend = gpuBackend;
}
if (msg == "app_resumed" || msg == "got_focus") {
else if (msg == "app_resumed" || msg == "got_focus") {
// Assume that the user may have modified things.
MemoryStick_NotifyWrite();
}
@@ -1344,7 +1353,7 @@ bool NativeAxis(const AxisInput &axis) {
// only handle tilt events if tilt is enabled.
if (g_Config.iTiltInputType == TILT_NULL) {
// if tilt events are disabled, then run it through the usual way.
// if tilt events are disabled, then run it through the usual way.
if (screenManager) {
return screenManager->axis(axis);
} else {
@@ -1410,7 +1419,7 @@ bool NativeAxis(const AxisInput &axis) {
currentTilt.y_ = -axis.value;
}
break;
case JOYSTICK_AXIS_OUYA_UNKNOWN1:
case JOYSTICK_AXIS_OUYA_UNKNOWN2:
case JOYSTICK_AXIS_OUYA_UNKNOWN3:
@@ -1432,7 +1441,7 @@ bool NativeAxis(const AxisInput &axis) {
//then a value of 70-80 is the way to go.
float xSensitivity = g_Config.iTiltSensitivityX / 50.0;
float ySensitivity = g_Config.iTiltSensitivityY / 50.0;
//now transform out current tilt to the calibrated coordinate system
Tilt trueTilt = GenTilt(baseTilt, currentTilt, g_Config.bInvertTiltX, g_Config.bInvertTiltY, g_Config.fDeadzoneRadius, xSensitivity, ySensitivity);