Buffer new icons when placefile changes

This commit is contained in:
Dan Paulat 2023-08-20 22:38:16 -05:00
parent c85e4cef58
commit ddf11884a8

View file

@ -433,7 +433,7 @@ void PlacefileIcons::Impl::UpdateBuffers()
void PlacefileIcons::Impl::Update(bool textureAtlasChanged) void PlacefileIcons::Impl::Update(bool textureAtlasChanged)
{ {
// If the texture atlas has changed // If the texture atlas has changed
if (textureAtlasChanged) if (dirty_ || textureAtlasChanged)
{ {
// Update texture coordinates // Update texture coordinates
for (auto& iconFile : currentIconFiles_) for (auto& iconFile : currentIconFiles_)
@ -443,10 +443,7 @@ void PlacefileIcons::Impl::Update(bool textureAtlasChanged)
// Update OpenGL buffer data // Update OpenGL buffer data
UpdateBuffers(); UpdateBuffers();
}
if (dirty_)
{
gl::OpenGLFunctions& gl = context_->gl(); gl::OpenGLFunctions& gl = context_->gl();
// Buffer vertex data // Buffer vertex data