Skip to content

Commit

Permalink
Fix update priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerboa-app committed Aug 22, 2024
1 parent 80147c4 commit 0456384
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/jGL/spriteRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,13 @@ namespace jGL
{
if (sprites.find(id) == sprites.end()){ return; }

for (auto & e : ids)
std::multimap<RenderPriority, SpriteId>::iterator iter;
for (iter = ids.begin(); iter != ids.end(); iter++)
{
if (e.second == id)
if (iter->second == id)
{
ids.erase(e.first);
ids.insert(std::pair(newPriority, e.second));
ids.erase(iter);
ids.insert(std::pair(newPriority, id));
break;
}
}
Expand Down

0 comments on commit 0456384

Please sign in to comment.