diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/savegamemenu.cc | 7 |
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(); |