| 634 | } |
| 635 | |
| 636 | std::shared_ptr<LoadedTexture> TextureCache::LoadTextureFromMemoryDeferred( |
| 637 | const std::shared_ptr<vfs::IBlob>& data, |
| 638 | const std::string& name, |
| 639 | const std::string& mimeType, |
| 640 | bool sRGB) |
| 641 | { |
| 642 | std::shared_ptr<TextureData> texture = CreateTextureData(); |
| 643 | |
| 644 | texture->forceSRGB = sRGB; |
| 645 | texture->path = name; |
| 646 | texture->mimeType = mimeType; |
| 647 | |
| 648 | if (FillTextureData(data, texture, "", mimeType)) |
| 649 | { |
| 650 | TextureLoaded(texture); |
| 651 | |
| 652 | std::lock_guard<std::mutex> guard(m_TexturesToFinalizeMutex); |
| 653 | |
| 654 | m_TexturesToFinalize.push(texture); |
| 655 | } |
| 656 | |
| 657 | ++m_TexturesLoaded; |
| 658 | |
| 659 | return texture; |
| 660 | } |
| 661 | |
| 662 | |
| 663 | std::shared_ptr<TextureData> TextureCache::GetLoadedTexture(std::filesystem::path const& path) |