diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 75f80c79d1..36b428cd4a 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -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(); } diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 1aba394a9c..73c6ca3bb5 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -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;