77 bool operator==(const
locator& a) const;
105 friend struct std::hash<
locator>;
186 bool skip_cache =
false);
204 bool skip_cache =
false);
234 point get_size(
const locator& i_locator,
bool skip_cache =
false);
239 bool is_in_hex(
const locator& i_locator);
252 bool exists(
const locator& i_locator);
Generic locator abstracting the location of an image.
locator(locator &&) noexcept=default
bool is_void() const
Returns true if the locator does not correspond to an actual image.
const std::string & get_filename() const
const std::string & get_modifications() const
const map_location & get_loc() const
bool operator<(const locator &a) const
bool operator==(const locator &a) const
locator clone(const std::string &mods) const
Returns a copy of this locator with the given IPF.
std::string modifications_
Wrapper class to encapsulate creation and management of an SDL_Texture.
Functions to load and save images from/to disk.
bool is_empty_hex(const locator &i_locator)
Checks if an image is empty after hex masking.
bool precached_file_exists(const std::string &file)
bool exists(const image::locator &i_locator)
Returns true if the given image actually exists, without loading it.
void flush_cache()
Purges all image caches.
surface get_surface(const image::locator &i_locator, TYPE type, bool skip_cache)
Returns an image surface suitable for software manipulation.
surface get_hexmask()
Retrieves the standard hexagonal tile mask.
std::ostream & operator<<(std::ostream &s, const locator &l)
texture get_lighted_texture(const image::locator &i_locator, const light_string &ls)
save_result save_image(const locator &i_locator, const std::string &filename)
std::basic_string< signed char > light_string
Type used to store color information of central and adjacent hexes.
void precache_file_existence(const std::string &subdir)
Precache the existence of files in a binary path subdirectory (e.g.
TYPE
Used to specify the rendering format of images.
@ HEXED
Standard hexagonal tile mask applied, removing portions that don't fit.
@ TOD_COLORED
Same as HEXED, but with Time of Day color tint applied.
@ UNSCALED
Unmodified original-size image.
texture get_texture(const image::locator &i_locator, TYPE type, bool skip_cache)
Returns an image texture suitable for hardware-accelerated rendering.
point get_size(const locator &i_locator, bool skip_cache)
Returns the width and height of an image.
surface get_lighted_image(const image::locator &i_locator, const light_string &ls)
Caches and returns an image with a lightmap applied to it.
void set_color_adjustment(int r, int g, int b)
Changes Time of Day color tint for all applicable image types.
light_string get_light_string(int op, int r, int g, int b)
Returns the light_string for one light operation.
bool is_in_hex(const locator &i_locator)
Checks if an image fits into a single hex.
std::string filename
Filename.
Encapsulates the map of the game.