Allow reload texture with threads
This commit is contained in:
parent
ed9b16fe7b
commit
6b3441d2a0
@ -250,9 +250,16 @@ core::stringw STKTexManager::reloadTexture(const irr::core::stringw& name)
|
|||||||
if (p.second == NULL || !p.second->isMeshTexture())
|
if (p.second == NULL || !p.second->isMeshTexture())
|
||||||
continue;
|
continue;
|
||||||
p.second->reload();
|
p.second->reload();
|
||||||
|
if (p.second->useThreadedLoading())
|
||||||
|
{
|
||||||
|
m_all_tex_loaders[m_tlt_added++ % m_thread_size]
|
||||||
|
->addTexture(p.second);
|
||||||
|
uploadBatch();
|
||||||
|
}
|
||||||
Log::info("STKTexManager", "%s reloaded",
|
Log::info("STKTexManager", "%s reloaded",
|
||||||
p.second->getName().getPtr());
|
p.second->getName().getPtr());
|
||||||
}
|
}
|
||||||
|
m_tlt_added = 0;
|
||||||
return L"All textures reloaded.";
|
return L"All textures reloaded.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,11 +279,18 @@ core::stringw STKTexManager::reloadTexture(const irr::core::stringw& name)
|
|||||||
if (fname == tex_name || fname == tex_path)
|
if (fname == tex_name || fname == tex_path)
|
||||||
{
|
{
|
||||||
p.second->reload();
|
p.second->reload();
|
||||||
|
if (p.second->useThreadedLoading())
|
||||||
|
{
|
||||||
|
m_all_tex_loaders[m_tlt_added++ % m_thread_size]
|
||||||
|
->addTexture(p.second);
|
||||||
|
uploadBatch();
|
||||||
|
}
|
||||||
result += tex_name.c_str();
|
result += tex_name.c_str();
|
||||||
result += L" ";
|
result += L" ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_tlt_added = 0;
|
||||||
}
|
}
|
||||||
if (result.empty())
|
if (result.empty())
|
||||||
return L"Texture(s) not found!";
|
return L"Texture(s) not found!";
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class STKTexture;
|
class STKTexture;
|
||||||
class STKTexManager;
|
|
||||||
|
|
||||||
class ThreadedTexLoader : public NoCopy
|
class ThreadedTexLoader : public NoCopy
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user