Skip to content

Commit

Permalink
Merge pull request #18558 from hrydgard/savestate-screenshot-maxsize
Browse files Browse the repository at this point in the history
Enforce a max size for save state screenshot regardless of resolution mode
  • Loading branch information
hrydgard committed Dec 15, 2023
2 parents bbcaeb9 + bac4a01 commit 58e12ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Core/SaveState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ namespace SaveState

case SAVESTATE_SAVE_SCREENSHOT:
{
int maxRes = g_Config.iInternalResolution > 2 ? 2 : -1;
tempResult = TakeGameScreenshot(op.filename, ScreenshotFormat::JPG, SCREENSHOT_DISPLAY, nullptr, nullptr, maxRes);
int maxResMultiplier = 2;
tempResult = TakeGameScreenshot(op.filename, ScreenshotFormat::JPG, SCREENSHOT_DISPLAY, nullptr, nullptr, maxResMultiplier);
callbackResult = tempResult ? Status::SUCCESS : Status::FAILURE;
if (!tempResult) {
ERROR_LOG(SAVESTATE, "Failed to take a screenshot for the savestate! %s", op.filename.c_str());
Expand Down
2 changes: 0 additions & 2 deletions Core/Screenshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ bool TakeGameScreenshot(const Path &filename, ScreenshotFormat fmt, ScreenshotTy

if (type == SCREENSHOT_DISPLAY || type == SCREENSHOT_RENDER) {
success = gpuDebug->GetCurrentFramebuffer(buf, type == SCREENSHOT_RENDER ? GPU_DBG_FRAMEBUF_RENDER : GPU_DBG_FRAMEBUF_DISPLAY, maxRes);

// Only crop to the top left when using a render screenshot.
w = maxRes > 0 ? 480 * maxRes : PSP_CoreParameter().renderWidth;
h = maxRes > 0 ? 272 * maxRes : PSP_CoreParameter().renderHeight;
} else if (g_display.rotation != DisplayRotation::ROTATE_0) {
Expand Down

0 comments on commit 58e12ac

Please sign in to comment.