diff options
author | Stijn Buys <ingar@osirion.org> | 2014-12-13 20:20:10 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2014-12-13 20:20:10 +0000 |
commit | 300db69911bec3a17f9fb695d09be3d9830e3648 (patch) | |
tree | 9add4eb17754f5f5b7c4ce50c1ddb106916a878c /src/client | |
parent | 2c4d6e947546f2732dd59d13fb331ec1412315ee (diff) |
Minro cleanup, added Model::add_layer() method.
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(); |