| 57 | } |
| 58 | |
| 59 | QPixmap ResourcePack::image(QSize size) |
| 60 | { |
| 61 | QPixmap cached_image; |
| 62 | if (QPixmapCache::find(m_pack_image_cache_key.key, &cached_image)) { |
| 63 | if (size.isNull()) |
| 64 | return cached_image; |
| 65 | return cached_image.scaled(size); |
| 66 | } |
| 67 | |
| 68 | // No valid image we can get |
| 69 | if (!m_pack_image_cache_key.was_ever_used) |
| 70 | return {}; |
| 71 | |
| 72 | // Imaged got evicted from the cache. Re-process it and retry. |
| 73 | ResourcePackUtils::process(*this); |
| 74 | return image(size); |
| 75 | } |
| 76 | |
| 77 | std::pair<Version, Version> ResourcePack::compatibleVersions() const |
| 78 | { |