mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Generate mipmap levels for screenshot views.
This commit is contained in:
parent
6151f8ef9f
commit
5b402dd6e5
2 changed files with 5 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
|
@ -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_;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue