mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-12 20:40:49 +00:00
UI: Display save state screenshots as icons.
This way the list is not just a bunch of words, if you have a lot of save states. Like me.
This commit is contained in:
parent
43218ea953
commit
21a15e4728
@ -443,6 +443,14 @@ handleELF:
|
||||
|
||||
case FILETYPE_PPSSPP_SAVESTATE:
|
||||
{
|
||||
// Let's use the screenshot as an icon, too.
|
||||
std::string screenshotPath = ReplaceAll(gamePath_, ".ppst", ".jpg");
|
||||
lock_guard guard(info_->lock);
|
||||
if (File::Exists(screenshotPath)) {
|
||||
if (readFileToString(false, screenshotPath.c_str(), info_->iconTextureData)) {
|
||||
info_->iconDataLoaded = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -709,7 +717,7 @@ again:
|
||||
void GameInfoCache::SetupTexture(GameInfo *info, std::string &textureData, Thin3DContext *thin3d, Thin3DTexture *&tex, double &loadTime) {
|
||||
if (textureData.size()) {
|
||||
if (!tex) {
|
||||
tex = thin3d->CreateTextureFromFileData((const uint8_t *)textureData.data(), (int)textureData.size(), T3DImageType::PNG);
|
||||
tex = thin3d->CreateTextureFromFileData((const uint8_t *)textureData.data(), (int)textureData.size(), T3DImageType::DETECT);
|
||||
if (tex) {
|
||||
loadTime = time_now_d();
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
root->Add(new TextView(savedata_detail, 0, true, new LinearLayoutParams(Margins(10, 0))));
|
||||
root->Add(new Spacer(3.0));
|
||||
} else {
|
||||
std::string image_path = ReplaceAll(savePath_, "ppst", "jpg");
|
||||
std::string image_path = ReplaceAll(savePath_, ".ppst", ".jpg");
|
||||
if (File::Exists(image_path)) {
|
||||
PrioritizedWorkQueue *wq = g_gameInfoCache.WorkQueue();
|
||||
toprow->Add(new AsyncImageFileView(image_path, IS_DEFAULT, wq, new UI::LayoutParams(500, 500/16*9)));
|
||||
@ -182,6 +182,11 @@ void SavedataButton::Draw(UIContext &dc) {
|
||||
float nw = h * tw / th;
|
||||
x += (w - nw) / 2.0f;
|
||||
w = nw;
|
||||
|
||||
if (texture->Width() >= w * 2 || texture->Height() >= h * 2) {
|
||||
// Better to use mipmaps, then. This is probably a large savestate screenshot.
|
||||
texture->AutoGenMipmaps();
|
||||
}
|
||||
}
|
||||
|
||||
int txOffset = down_ ? 4 : 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user