Allow taking screenshots in the app menu

This commit is contained in:
Henrik Rydgård committed 2024-05-10 21:10:11 +02:00
1 parent e0e96200b9
commit d21fef52ae
8 files changed
+34 -19

No files matched your search

+3 -3
View File
@@ -968,7 +968,7 @@ void NativeShutdownGraphics() {
INFO_LOG(SYSTEM, "NativeShutdownGraphics done");
}
static void TakeScreenshot() {
static void TakeScreenshot(Draw::DrawContext *draw) {
Path path = GetSysDirectory(DIRECTORY_SCREENSHOT);
if (!File::Exists(path)) {
File::CreateDir(path);
@@ -991,7 +991,7 @@ static void TakeScreenshot() {
i++;
}
bool success = TakeGameScreenshot(filename, g_Config.bScreenshotsAsPNG ? ScreenshotFormat::PNG : ScreenshotFormat::JPG, SCREENSHOT_OUTPUT);
bool success = TakeGameScreenshot(draw, filename, g_Config.bScreenshotsAsPNG ? ScreenshotFormat::PNG : ScreenshotFormat::JPG, SCREENSHOT_OUTPUT);
if (success) {
g_OSD.Show(OSDType::MESSAGE_FILE_LINK, filename.ToString(), 0.0f, "screenshot_link");
if (System_GetPropertyBool(SYSPROP_CAN_SHOW_FILE)) {
@@ -1012,7 +1012,7 @@ static void TakeScreenshot() {
void CallbackPostRender(UIContext *dc, void *userdata) {
if (g_TakeScreenshot) {
TakeScreenshot();
TakeScreenshot(dc->GetDrawContext());
g_TakeScreenshot = false;
}
}