diff options
author | LaG1924 <lag1924@gmail.com> | 2023-07-08 20:30:25 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2023-07-08 21:24:04 +0200 |
commit | c984afdf47ef31511024c6b70bd4b4c4e64f56a6 (patch) | |
tree | 3c539c9e7de841c6616f532dadb7c8c1ef552d95 /src/Rml.cpp | |
parent | Merge pull request #80 from LaG1924/ftr/better-water (diff) | |
download | AltCraft-c984afdf47ef31511024c6b70bd4b4c4e64f56a6.tar AltCraft-c984afdf47ef31511024c6b70bd4b4c4e64f56a6.tar.gz AltCraft-c984afdf47ef31511024c6b70bd4b4c4e64f56a6.tar.bz2 AltCraft-c984afdf47ef31511024c6b70bd4b4c4e64f56a6.tar.lz AltCraft-c984afdf47ef31511024c6b70bd4b4c4e64f56a6.tar.xz AltCraft-c984afdf47ef31511024c6b70bd4b4c4e64f56a6.tar.zst AltCraft-c984afdf47ef31511024c6b70bd4b4c4e64f56a6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Rml.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Rml.cpp b/src/Rml.cpp index f6fff44..7f114cd 100644 --- a/src/Rml.cpp +++ b/src/Rml.cpp @@ -161,7 +161,8 @@ bool RmlRenderInterface::GenerateTexture(Rml::TextureHandle& texture_handle, con } void RmlRenderInterface::ReleaseTexture(Rml::TextureHandle texture) { - textures.erase(textures.find(texture)); + if (auto it = textures.find(texture); it != textures.end()) + textures.erase(it); } void RmlRenderInterface::Update(unsigned int windowWidth, unsigned int windowHeight) { @@ -183,7 +184,7 @@ Rml::FileHandle RmlFileInterface::Open(const Rml::String& path) { handle.filePos = 0; if (handle.assetPtr != nullptr) - handles.insert(std::make_pair(fileId, handle)); + handles.try_emplace(fileId, handle); else fileId = 0; return fileId; |