diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index cab3c55de1..e7ce2c46a5 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -80,6 +80,8 @@ void AsyncImageFileView::Draw(UIContext &dc) { texture_ = dc.GetThin3DContext()->CreateTextureFromFile(filename_.c_str(), DETECT); if (!texture_) textureFailed_ = true; + else if (textureAutoGen_) + texture_->AutoGenMipmaps(); } if (HasFocus()) { diff --git a/UI/PauseScreen.h b/UI/PauseScreen.h index c730f16816..0057b778f3 100644 --- a/UI/PauseScreen.h +++ b/UI/PauseScreen.h @@ -68,7 +68,7 @@ class PrioritizedWorkQueue; class AsyncImageFileView : public UI::Clickable { public: AsyncImageFileView(const std::string &filename, UI::ImageSizeMode sizeMode, PrioritizedWorkQueue *wq, UI::LayoutParams *layoutParams = 0) - : UI::Clickable(layoutParams), canFocus_(true), filename_(filename), color_(0xFFFFFFFF), sizeMode_(sizeMode), texture_(NULL), textureFailed_(false), fixedSizeW_(0.0f), fixedSizeH_(0.0f) {} + : UI::Clickable(layoutParams), canFocus_(true), filename_(filename), color_(0xFFFFFFFF), sizeMode_(sizeMode), texture_(NULL), textureFailed_(false), textureAutoGen_(true), fixedSizeW_(0.0f), fixedSizeH_(0.0f) {} ~AsyncImageFileView() { delete texture_; } @@ -81,6 +81,7 @@ public: void SetOverlayText(std::string text) { text_ = text; } void SetFixedSize(float fixW, float fixH) { fixedSizeW_ = fixW; fixedSizeH_ = fixH; } void SetCanBeFocused(bool can) { canFocus_ = can; } + void SetAutoGenMipmaps(bool a) { textureAutoGen_ = a; } bool CanBeFocused() const override { return canFocus_; } @@ -95,6 +96,7 @@ private: Thin3DTexture *texture_; bool textureFailed_; + bool textureAutoGen_; float fixedSizeW_; float fixedSizeH_; };