HiresTexture: Fix prefetching with broken textures
This commit is contained in:
parent
6ff3fcee59
commit
c69cc91f00
|
@ -190,16 +190,22 @@ void HiresTexture::Prefetch()
|
||||||
// But bad luck, SOIL isn't, so TODO: remove SOIL usage here and use libpng directly
|
// But bad luck, SOIL isn't, so TODO: remove SOIL usage here and use libpng directly
|
||||||
// Also TODO: remove s_textureCacheAquireMutex afterwards. It won't be needed as the main mutex will be locked rarely
|
// Also TODO: remove s_textureCacheAquireMutex afterwards. It won't be needed as the main mutex will be locked rarely
|
||||||
//lk.unlock();
|
//lk.unlock();
|
||||||
std::shared_ptr<HiresTexture> ptr(Load(base_filename, 0, 0));
|
HiresTexture* t = Load(base_filename, 0, 0);
|
||||||
//lk.lock();
|
//lk.lock();
|
||||||
|
if (t)
|
||||||
|
{
|
||||||
|
std::shared_ptr<HiresTexture> ptr(t);
|
||||||
iter = s_textureCache.insert(iter, std::make_pair(base_filename, ptr));
|
iter = s_textureCache.insert(iter, std::make_pair(base_filename, ptr));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (iter != s_textureCache.end())
|
||||||
|
{
|
||||||
for (const Level& l : iter->second->m_levels)
|
for (const Level& l : iter->second->m_levels)
|
||||||
{
|
{
|
||||||
size_sum += l.data_size;
|
size_sum += l.data_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (s_textureCacheAbortLoading.IsSet())
|
if (s_textureCacheAbortLoading.IsSet())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue