diff options
author | Stijn Buys <ingar@osirion.org> | 2013-11-08 21:16:59 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-11-08 21:16:59 +0000 |
commit | 566cd41a05579a51a58c6969304297d5951223be (patch) | |
tree | 170837ae38df615ac53e58f771dc41fec9ac42ff /src/client | |
parent | dd2162af7727c0f30d77cc7ae33ccbb346611b20 (diff) |
Corrected a bug when loading new corona textures for the map.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/mapwidget.cc | 13 |
1 files changed, 8 insertions, 5 deletions
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 |