MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / image

Method image

launcher/minecraft/mod/TexturePack.cpp:54–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54QPixmap TexturePack::image(QSize size, Qt::AspectRatioMode mode) const
55{
56 QPixmap cached_image;
57 if (PixmapCache::find(m_pack_image_cache_key.key, &cached_image)) {
58 if (size.isNull())
59 return cached_image;
60 return cached_image.scaled(size, mode, Qt::SmoothTransformation);
61 }
62
63 // No valid image we can get
64 if (!m_pack_image_cache_key.was_ever_used) {
65 return {};
66 } else {
67 qDebug() << "Texture Pack" << name() << "Had it's image evicted from the cache. reloading...";
68 PixmapCache::markCacheMissByEviciton();
69 }
70
71 // Imaged got evicted from the cache. Re-process it and retry.
72 TexturePackUtils::processPackPNG(*this);
73 return image(size);
74}
75
76bool TexturePack::valid() const
77{

Callers 4

updateWithTexturePackMethod · 0.45
dataMethod · 0.45
dataMethod · 0.45

Calls 1

processPackPNGFunction · 0.50

Tested by

no test coverage detected