From 300db69911bec3a17f9fb695d09be3d9830e3648 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 13 Dec 2014 20:20:10 +0000 Subject: Minro cleanup, added Model::add_layer() method. --- src/client/savegamemenu.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/client') 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(); -- cgit v1.2.3