Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2014-12-22 16:02:48 +0000
committerStijn Buys <ingar@osirion.org>2014-12-22 16:02:48 +0000
commit871552eab28d07c3aaf0cabb5fb167c0eb365bdf (patch)
tree0c91777d067e3b5323070b458c1affd6f11669da /src/client
parenta5aef07b4a2b85933f3a2f358a4d1b6fe27948b7 (diff)
Fixed a bug where the lad/savegame dialog wouldn't show the screenshot of the first selected savegame,
minor code cleamups in material handling.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/savegamemenu.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/savegamemenu.cc b/src/client/savegamemenu.cc
index 4b546ac..b91a45c 100644
--- a/src/client/savegamemenu.cc
+++ b/src/client/savegamemenu.cc
@@ -152,7 +152,7 @@ void SaveGameMenu::resize()
);
// resize screenshot
- model::Material *screenshotmaterial = model::Material::find("ui/screenshot");
+ const model::Material *screenshotmaterial = model::Material::find("ui/screenshot");
if (screenshotmaterial) {
float sx = savegamemenu_descrtitle->width() / screenshotmaterial->size().width();
float sy = ui::UI::elementsize.width() / screenshotmaterial->size().height();
@@ -280,6 +280,7 @@ void SaveGameMenu::hide()
if ((*lit)->texture().size()) {
render::Textures::unload((*lit)->texture());
(*lit)->set_texture("");
+ (*lit)->set_texture_id(0);
}
}
@@ -329,8 +330,7 @@ void SaveGameMenu::show_file_info()
model::Material *screenshotmaterial = model::Material::find("ui/screenshot");
if (!screenshotmaterial) {
- screenshotmaterial = new model::Material("ui/screenshot");
- model::Material::registry()[screenshotmaterial->name()] = screenshotmaterial;
+ screenshotmaterial = model::Material::add("ui/screenshot");
}
model::Layer *screenshotlayer = 0;
@@ -345,16 +345,16 @@ void SaveGameMenu::show_file_info()
screenshotlayer->set_texture("");
}
- std::string screenshotfilename("savegames/" + savename);
+ const std::string screenshotfilename("savegames/" + savename);
screenshotlayer->set_texture(screenshotfilename);
render::Textures::image_loader(screenshotlayer);
screenshotmaterial->set_size(screenshotlayer->size());
-
+
savegamemenu_screenshot->set_texture(screenshotmaterial->name());
savegamemenu_screenshot->show();
resize();
-
+
} else {
// new savegame, immediatly show the save game dialog
show_save_dialog();