mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Fix reporting screenshots, screen darkening in skipbuffer run-behind mode
This commit is contained in:
1 parent
1846163985
commit
fa46bc25e7
2 files changed
+13
-7
No files matched your search
+4
-6
@@ -60,13 +60,8 @@ using namespace std::placeholders;
|
||||
#include "Core/Util/PathUtil.h"
|
||||
#include "Core/System.h"
|
||||
#include "GPU/Common/PresentationCommon.h"
|
||||
#include "Core/FileSystems/VirtualDiscFileSystem.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/GPUCommon.h"
|
||||
#include "GPU/Common/FramebufferManagerCommon.h"
|
||||
#if !PPSSPP_PLATFORM(UWP)
|
||||
#include "GPU/Vulkan/DebugVisVulkan.h"
|
||||
#endif
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
#include "Core/HLE/sceCtrl.h"
|
||||
#include "Core/HLE/sceSas.h"
|
||||
@@ -83,7 +78,6 @@ using namespace std::placeholders;
|
||||
#include "Core/HW/Display.h"
|
||||
|
||||
#include "UI/BackgroundAudio.h"
|
||||
#include "UI/OnScreenDisplay.h"
|
||||
#include "UI/GamepadEmu.h"
|
||||
#include "UI/PauseScreen.h"
|
||||
#include "UI/MainScreen.h"
|
||||
@@ -1616,6 +1610,8 @@ ScreenRenderFlags EmuScreen::PreRender(ScreenRenderMode mode) {
|
||||
const DisplayLayoutConfig &displayLayoutConfig = g_Config.GetDisplayLayoutConfig(orientation);
|
||||
// We run just the post shaders.
|
||||
gpu->PrepareCopyDisplayToOutput(displayLayoutConfig);
|
||||
// Screens on top like reporting might want to take screenshots of existing framebuffers.
|
||||
ScreenshotNotifyPostGameRender(screenManager()->getDrawContext());
|
||||
}
|
||||
}
|
||||
return ScreenRenderFlags::NONE;
|
||||
@@ -1687,6 +1683,8 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
|
||||
// We're in run-behind mode, but we don't want to draw chat, debug UI and stuff. We do draw the imdebugger though.
|
||||
// So, darken and bail here.
|
||||
// Reset viewport/scissor to be sure.
|
||||
draw->SetViewport(viewport);
|
||||
draw->SetScissorRect(0, 0, g_display.pixel_xres, g_display.pixel_yres);
|
||||
darken();
|
||||
return screenRenderFlags;
|
||||
}
|
||||
|
||||
+9
-1
@@ -167,6 +167,7 @@ ReportScreen::ReportScreen(const Path &gamePath)
|
||||
}
|
||||
|
||||
ScreenRenderFlags ReportScreen::PreRender(ScreenRenderMode mode) {
|
||||
Path screenshotPath = GetSysDirectory(DIRECTORY_SCREENSHOT) / ".reporting.jpg";
|
||||
if ((mode & ScreenRenderMode::TOP) && !tookScreenshot_ && !g_Config.bSkipBufferEffects) {
|
||||
// We do this in PreRender because we need it to be before the main render pass.
|
||||
// We could do it mid-frame, but then we have to reapply viewport/scissor.
|
||||
@@ -174,7 +175,7 @@ ScreenRenderFlags ReportScreen::PreRender(ScreenRenderMode mode) {
|
||||
if (!File::Exists(path)) {
|
||||
File::CreateDir(path);
|
||||
}
|
||||
screenshotFilename_ = path / ".reporting.jpg";
|
||||
screenshotFilename_ = screenshotPath;
|
||||
ScheduleScreenshot(screenshotFilename_, ScreenshotFormat::JPG, ScreenshotType::Display, 4, [this](ScreenshotResult result) {
|
||||
if (result == ScreenshotResult::Success) {
|
||||
// Redo the views already, now with a screenshot included.
|
||||
@@ -184,8 +185,15 @@ ScreenRenderFlags ReportScreen::PreRender(ScreenRenderMode mode) {
|
||||
screenshotFilename_.clear();
|
||||
}
|
||||
});
|
||||
|
||||
tookScreenshot_ = true;
|
||||
} else if (g_Config.bSkipBufferEffects && !tookScreenshot_) {
|
||||
// Delete a leftover screenshot if we didn't take one now.
|
||||
File::Delete(screenshotPath);
|
||||
tookScreenshot_ = true;
|
||||
screenshotFilename_.clear();
|
||||
}
|
||||
|
||||
return ScreenRenderFlags::NONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user