mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 18:32:36 +00:00
Merge branch 'fix_create_texture' into 'master'
Fix inserting texture to map See merge request OpenMW/openmw!2191
This commit is contained in:
commit
e0a23aaa72
@ -530,13 +530,8 @@ bool RenderManager::isFormatSupported(MyGUI::PixelFormat /*format*/, MyGUI::Text
|
|||||||
|
|
||||||
MyGUI::ITexture* RenderManager::createTexture(const std::string &name)
|
MyGUI::ITexture* RenderManager::createTexture(const std::string &name)
|
||||||
{
|
{
|
||||||
auto item = mTextures.find(name);
|
const auto it = mTextures.insert_or_assign(name, OSGTexture(name, mImageManager)).first;
|
||||||
if (item != mTextures.end())
|
return &it->second;
|
||||||
mTextures.erase(item);
|
|
||||||
|
|
||||||
item = mTextures.emplace_hint(item, name, OSGTexture(name, mImageManager));
|
|
||||||
|
|
||||||
return &item->second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderManager::destroyTexture(MyGUI::ITexture *texture)
|
void RenderManager::destroyTexture(MyGUI::ITexture *texture)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user