From d9e202faba7725551b51fdaa4c34067122d38b19 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Sun, 28 Aug 2016 13:27:38 +0200 Subject: [PATCH] MapRenderer::draw cleanup --- rwengine/src/render/MapRenderer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rwengine/src/render/MapRenderer.cpp b/rwengine/src/render/MapRenderer.cpp index 5c57b0e1..8db20085 100644 --- a/rwengine/src/render/MapRenderer.cpp +++ b/rwengine/src/render/MapRenderer.cpp @@ -174,24 +174,26 @@ void MapRenderer::draw(GameWorld* world, const MapInfo& mi) drawBlip(mi.worldCenter + glm::vec2(0.f, mi.worldSize), view, mi, "radar_north", 0.f, 24.f); - for(auto& blip : world->state->radarBlips) + for(auto& radarBlip : world->state->radarBlips) { - auto dm = blip.second.display; + const auto& blip = radarBlip.second; + + auto dm = blip.display; if( dm == BlipData::Hide || dm == BlipData::MarkerOnly ) { continue; } - glm::vec2 blippos( blip.second.coord ); - if( blip.second.target > 0 ) + glm::vec2 blippos( blip.coord ); + if( blip.target > 0 ) { - GameObject* object = world->getBlipTarget(blip.second); + GameObject* object = world->getBlipTarget(blip); if( object ) { blippos = glm::vec2( object->getPosition() ); } } - drawBlip(blippos, view, mi, blip.second.texture); + drawBlip(blippos, view, mi, blip.texture); } glBindVertexArray( 0 );