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