From 81c78f54779b44b886dc27cf20cd7eb368ccc443 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Wed, 7 Sep 2022 16:18:33 +0300 Subject: [PATCH] Keep savegame screenshots up-to-date --- apps/openmw/mwgui/savegamedialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 605e9a2f57..10e2ae32fc 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -427,6 +427,10 @@ namespace MWGui mInfoText->setCaptionWithReplacing(text.str()); + // Reset the image for the case we're unable to recover a screenshot + mScreenshotTexture.reset(); + mScreenshot->setRenderItemTexture(nullptr); + mScreenshot->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); // Decode screenshot const std::vector& data = mCurrentSlot->mProfile.mScreenshot; @@ -463,8 +467,6 @@ namespace MWGui texture->setUnRefImageDataAfterApply(true); mScreenshotTexture = std::make_unique(texture); - mScreenshot->setRenderItemTexture(mScreenshotTexture.get()); - mScreenshot->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f)); } }