#include "map/location.hpp"
#include "sdl/utils.hpp"
#include "sdl/image.hpp"
#include "terrain/translation.hpp"
#include "game_config.hpp"
#include <boost/unordered_map.hpp>
Go to the source code of this file.
Classes | |
singleton | image::cache_type< T > |
class | image::locator |
struct | image::locator::value |
struct | image::manager |
the image manager is responsible for setting up images, and destroying all images when the program exits. More... | |
class | image::color_adjustment_resetter |
Namespaces | |
image | |
this module manages the cache of images. | |
Typedefs | |
typedef cache_type< surface > | image::image_cache |
typedef cache_type< bool > | image::bool_cache |
typedef std::map < t_translation::t_terrain, surface > | image::mini_terrain_cache_map |
typedef std::basic_string < signed char > | image::light_string |
light_string store colors info of central and adjacent hexes. More... | |
typedef std::map< light_string, surface > | image::lit_variants |
typedef cache_type< lit_variants > | image::lit_cache |
Enumerations | |
enum | image::TYPE { image::UNSCALED, image::SCALED_TO_ZOOM, image::HEXED, image::SCALED_TO_HEX, image::TOD_COLORED, image::BRIGHTENED } |
UNSCALED : image will be drawn "as is" without changing size, even in case of redraw SCALED_TO_ZOOM : image will be scaled taking zoom into account HEXED : the hex mask is applied on the image SCALED_TO_HEX : image will be scaled to fit into a hex, taking zoom into account TOD_COLORED : same as SCALED_TO_HEX but ToD coloring is also applied BRIGHTENED : same as TOD_COLORED but also brightened. More... | |
Functions | |
surface | image::load_from_disk (const locator &loc) |
size_t | image::hash_value (const locator::value &val) |
light_string | image::get_light_string (int op, int r, int g, int b) |
return light_string of one light operation(see above) More... | |
void | image::flush_cache () |
void | image::set_color_adjustment (int r, int g, int b) |
will make all scaled images have these rgb values added to all their pixels. More... | |
void | image::set_team_colors (const std::vector< std::string > *colors=nullptr) |
set the team colors used by the TC image modification use a vector with one string for each team using nullptr will reset to default TC More... | |
const std::vector< std::string > & | image::get_team_colors () |
void | image::set_pixel_format (SDL_PixelFormat *format) |
sets the pixel format used by the images. More... | |
void | image::set_zoom (int zoom) |
sets the amount scaled images should be scaled. More... | |
surface | image::get_image (const locator &i_locator, TYPE type=UNSCALED) |
function to get the surface corresponding to an image. More... | |
surface | image::get_lighted_image (const image::locator &i_locator, const light_string &ls, TYPE type) |
function to get the surface corresponding to an image. More... | |
surface | image::get_hexmask () |
function to get the standard hex mask More... | |
bool | image::is_in_hex (const locator &i_locator) |
function to check if an image fit into an hex return false if the image has not the standard size. More... | |
bool | image::is_empty_hex (const locator &i_locator) |
function to check if an image is empty after hex cut should be only used on terrain image (cache the hex cut version) More... | |
surface | image::reverse_image (const surface &surf) |
function to reverse an image. More... | |
bool | image::exists (const locator &i_locator) |
returns true if the given image actually exists, without loading it. More... | |
void | image::precache_file_existence (const std::string &subdir="") |
precache the existence of files in the subdir (ex: "terrain/") More... | |
bool | image::precached_file_exists (const std::string &file) |
bool | image::update_from_preferences () |
initialize any private data, e.g. algorithm choices from preferences More... | |
bool | image::save_image (const locator &i_locator, const std::string &filename) |
bool | image::save_image (const surface &surf, const std::string &filename) |