From 566cd41a05579a51a58c6969304297d5951223be Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 8 Nov 2013 21:16:59 +0000 Subject: Corrected a bug when loading new corona textures for the map. --- src/client/mapwidget.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/client') diff --git a/src/client/mapwidget.cc b/src/client/mapwidget.cc index 770abb2..52fe074 100644 --- a/src/client/mapwidget.cc +++ b/src/client/mapwidget.cc @@ -153,8 +153,11 @@ void MapWidget::draw() if (globe->has_flag(core::Entity::Bright)) { - // load globe corona texture + gl::end(); + + // load globe corona texture if (!globe->corona_id() && globe->coronaname().size()) { + globe->set_corona_id(render::Textures::load("textures/" + globe->coronaname())); if (!globe->corona_id()) { globe->set_coronaname(""); @@ -163,8 +166,6 @@ void MapWidget::draw() // draw corona if (globe->corona_id()) { - gl::end(); - texture_current = render::Textures::bind(globe->corona_id()); gl::begin(gl::Quads); @@ -180,14 +181,16 @@ void MapWidget::draw() glTexCoord2f(0.0f, 1.0f); gl::vertex(icon_location.x() - r * 2.0f, icon_location.y() + r * 2.0f); + gl::end(); } // bind bright globe icon texture if (texture_current != texture_bright) { - gl::end(); texture_current = render::Textures::bind(texture_bright); - gl::begin(gl::Quads); } + + gl::begin(gl::Quads); + } else { // bind globe icon texture -- cgit v1.2.3