20 #include <unordered_map> 67 locator(
const std::string& filename);
69 locator(
const std::string& filename,
const map_location& loc,
int center_x,
int center_y,
const std::string& modifications =
"");
125 value(
const char *filename);
126 value(
const std::string& filename);
127 value(
const std::string& filename,
const std::string& modifications);
128 value(
const std::string& filename,
const map_location& loc,
int center_x,
int center_y,
const std::string& modifications);
TYPE
Used to specify the rendering format of images.
surface get_image(const image::locator &i_locator, TYPE type)
Caches and returns an image.
const std::string & get_modifications() const
void precache_file_existence(const std::string &subdir)
Precache the existence of files in a binary path subdirectory (e.g.
bool operator!=(const locator &a) const
void add_to_cache(cache_type< T > &cache, const T &data) const
bool operator==(const locator &a) const
bool precached_file_exists(const std::string &file)
surface reverse_image(const surface &surf)
Horizontally flips an image.
mini_terrain_cache_map mini_fogged_terrain_cache
save_result save_image(const locator &i_locator, const std::string &filename)
T & access_in_cache(cache_type< T > &cache) const
std::map< t_translation::terrain_code, surface > mini_terrain_cache_map
Standard hexagonal tile mask applied, removing portions that don't fit.
cache_type< lit_variants > lit_cache
Lit variants for each locator.
Same as SCALED_TO_HEX, but with Time of Day color tint applied.
cache_type< surface > image_cache
void flush_cache()
Purges all image caches.
bool exists(const image::locator &i_locator)
Returns true if the given image actually exists, without loading it.
const T & locate_in_cache(cache_type< T > &cache) const
light_string get_light_string(int op, int r, int g, int b)
Returns the light_string for one light operation.
std::string modifications_
std::unordered_map< value, int > locator_finder_t
void set_zoom(unsigned int amount)
Sets the scaling factor for images.
std::map< light_string, surface > lit_variants
Type used to pair light possibilities with the corresponding lit surface.
bool operator<(const locator &a) const
Generic locator abstracting the location of an image.
void set_color_adjustment(int r, int g, int b)
Changes Time of Day color tint for all applicable image types.
Image rescaled according to the zoom settings.
Encapsulates the map of the game.
surface load_from_disk(const locator &loc)
cache_type< bool > bool_cache
locator & operator=(const locator &a)
surface get_hexmask()
Retrieves the standard hexagonal tile mask.
std::basic_string< signed char > light_string
Type used to store color information of central and adjacent hexes.
mini_terrain_cache_map mini_highlighted_terrain_cache
const std::string & get_filename() const
bool is_in_hex(const locator &i_locator)
Checks if an image fits into a single hex.
bool operator<(const value &a) const
mini_terrain_cache_map mini_terrain_cache
surface get_lighted_image(const image::locator &i_locator, const light_string &ls, TYPE type)
Caches and returns an image with a lightmap applied to it.
const std::vector< std::string > & modifications(bool mp)
Image rescaled to fit into a hexagonal tile according to the zoom settings.
const map_location & get_loc() const
bool is_empty_hex(const locator &i_locator)
Checks if an image is empty after hex masking.
Functions to load and save images from/to disk.
bool operator==(const value &a) const
bool is_void() const
Returns true if the locator does not correspond to an actual image.
bool in_cache(cache_type< T > &cache) const
Unmodified original-size image.
bool file_exists() const
Tests whether the file the locator points at exists.
Same as TOD_COLORED, but also brightened.