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-13 20:20:10 +0000
committerStijn Buys <ingar@osirion.org>2014-12-13 20:20:10 +0000
commit300db69911bec3a17f9fb695d09be3d9830e3648 (patch)
tree9add4eb17754f5f5b7c4ce50c1ddb106916a878c /src/client
parent2c4d6e947546f2732dd59d13fb331ec1412315ee (diff)
Minro cleanup, added Model::add_layer() method.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/savegamemenu.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/savegamemenu.cc b/src/client/savegamemenu.cc
index 6983ef6..4b546ac 100644
--- a/src/client/savegamemenu.cc
+++ b/src/client/savegamemenu.cc
@@ -330,15 +330,14 @@ void SaveGameMenu::show_file_info()
model::Material *screenshotmaterial = model::Material::find("ui/screenshot");
if (!screenshotmaterial) {
screenshotmaterial = new model::Material("ui/screenshot");
- model::Material::registry()["ui/screenshot"] = screenshotmaterial;
+ model::Material::registry()[screenshotmaterial->name()] = screenshotmaterial;
}
model::Layer *screenshotlayer = 0;
if (screenshotmaterial->layers().size() > 0) {
screenshotlayer = (*screenshotmaterial->layers().begin());
} else {
- screenshotlayer = new model::Layer();
- screenshotmaterial->layers().push_back(screenshotlayer);
+ screenshotlayer = screenshotmaterial->add_layer();
screenshotlayer->set_fullbright(true);
}
if (screenshotlayer->texture().size()) {
@@ -351,7 +350,7 @@ void SaveGameMenu::show_file_info()
render::Textures::image_loader(screenshotlayer);
screenshotmaterial->set_size(screenshotlayer->size());
- savegamemenu_screenshot->set_texture("ui/screenshot");
+ savegamemenu_screenshot->set_texture(screenshotmaterial->name());
savegamemenu_screenshot->show();
resize();