mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Merge pull request #8814 from LunaMoo/screenshot
Create screenshot directory if not exist when using Report Feedback
This commit is contained in:
commit
0519b3ef79
1 file changed
+7
-1
+7
-1
@@ -26,6 +26,7 @@
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/Screenshot.h"
|
||||
#include "Core/System.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/Log.h"
|
||||
|
||||
using namespace UI;
|
||||
@@ -222,7 +223,11 @@ void ReportScreen::CreateViews() {
|
||||
reportingNotice_ = nullptr;
|
||||
}
|
||||
|
||||
screenshotFilename_ = GetSysDirectory(DIRECTORY_SCREENSHOT) + ".reporting.jpg";
|
||||
std::string path = GetSysDirectory(DIRECTORY_SCREENSHOT);
|
||||
if (!File::Exists(path)) {
|
||||
File::CreateDir(path);
|
||||
}
|
||||
screenshotFilename_ = path + ".reporting.jpg";
|
||||
int shotWidth = 0, shotHeight = 0;
|
||||
if (TakeGameScreenshot(screenshotFilename_.c_str(), SCREENSHOT_JPG, SCREENSHOT_RENDER, &shotWidth, &shotHeight, 4)) {
|
||||
float scale = 340.0f * (1.0f / g_dpi_scale) * (1.0f / shotHeight);
|
||||
@@ -230,6 +235,7 @@ void ReportScreen::CreateViews() {
|
||||
screenshot_ = leftColumnItems->Add(new AsyncImageFileView(screenshotFilename_, IS_DEFAULT, nullptr, new LinearLayoutParams(shotWidth * scale, shotHeight * scale, Margins(12, 0))));
|
||||
} else {
|
||||
includeScreenshot_ = false;
|
||||
screenshot_ = nullptr;
|
||||
}
|
||||
|
||||
leftColumnItems->Add(new CompatRatingChoice("Overall", &overall_))->SetEnabledPtr(&enableReporting_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
|
||||
|
||||
Reference in new issue
Block a user