diff --git a/src/dialogs.cpp b/src/dialogs.cpp index db896017cc8f..6a21d65fd797 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -1242,7 +1242,21 @@ const unit_preview_pane::details units_list_preview_pane::get_details() const const unit &u = *units_[index_]; details det; - det.image = u.still_image(); + /** Get an SDL surface, ready for display for place where we need a still-image of the unit. */ + image::locator image_loc; + +#ifdef LOW_MEM + image_loc = image::locator(u.absolute_image()); +#else + std::string mods=u.image_mods(); + if(!mods.empty()){ + image_loc = image::locator(u.absolute_image(),mods); + } else { + image_loc = image::locator(u.absolute_image()); + } +#endif + det.image = image::get_image(image_loc, image::UNSCALED); + /***/ det.name = u.name(); det.type_name = u.type_name(); diff --git a/src/unit.cpp b/src/unit.cpp index 86aa5a2e9164..41618b5b845b 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -1718,25 +1718,6 @@ void unit::write(config& cfg) const } -const surface unit::still_image(bool scaled) const -{ - image::locator image_loc; - -#ifdef LOW_MEM - image_loc = image::locator(absolute_image()); -#else - std::string mods=image_mods(); - if(!mods.empty()){ - image_loc = image::locator(absolute_image(),mods); - } else { - image_loc = image::locator(absolute_image()); - } -#endif - - surface unit_image(image::get_image(image_loc, scaled ? image::SCALED_TO_ZOOM : image::UNSCALED)); - return unit_image; -} - void unit::set_facing(map_location::DIRECTION dir) const { if(dir != map_location::NDIRECTIONS) { facing_ = dir; diff --git a/src/unit.hpp b/src/unit.hpp index 62e67e0b2431..0d75f5ac540d 100644 --- a/src/unit.hpp +++ b/src/unit.hpp @@ -20,7 +20,7 @@ #include #include -#include "sdl/utils.hpp" +#include "sdl/utils.hpp" //only needed for SDL_Color #include "unit_types.hpp" #include "unit_map.hpp" #include "unit_ptr.hpp" @@ -245,9 +245,6 @@ class unit int damage_from(const attack_type& attack,bool attacker,const map_location& loc) const { return resistance_against(attack,attacker,loc); } - /** A SDL surface, ready for display for place where we need a still-image of the unit. */ - const surface still_image(bool scaled = false) const; - unit_animation_component & anim_comp() const { return *anim_comp_; } void set_facing(map_location::DIRECTION dir) const; map_location::DIRECTION facing() const { return facing_; }