15 #ifndef IMAGE_HPP_INCLUDED
16 #define IMAGE_HPP_INCLUDED
24 #include <boost/unordered_map.hpp>
47 value(
const char *filename);
110 template <
typename T>
112 template <
typename T>
114 template <
typename T>
116 template <
typename T>
128 sdl::timage load_texture(
const locator &loc);
158 typedef std::map<light_string, sdl::timage> lit_texture_variants;
190 void set_team_colors(
const std::vector<std::string>* colors =
nullptr);
229 bool is_in_hex(
const locator& i_locator);
240 bool exists(
const locator& i_locator);
TYPE
UNSCALED : image will be drawn "as is" without changing size, even in case of redraw SCALED_TO_ZOOM :...
surface get_image(const image::locator &i_locator, TYPE type)
function to get the surface corresponding to an image.
void precache_file_existence(const std::string &subdir)
precache the existence of files in the subdir (ex: "terrain/")
std::map< t_translation::t_terrain, surface > mini_terrain_cache_map
void set_pixel_format(SDL_PixelFormat *format)
sets the pixel format used by the images.
bool operator<(const value &a) const
void set_team_colors(const std::vector< std::string > *colors)
set the team colors used by the TC image modification use a vector with one string for each team usin...
bool precached_file_exists(const std::string &file)
GLuint GLuint GLsizei GLenum type
surface reverse_image(const surface &surf)
function to reverse an image.
bool file_exists() const
Tests whether the file the locater points at exists.
mini_terrain_cache_map mini_fogged_terrain_cache
color_adjustment_resetter()
friend size_t hash_value(const value &)
void add_to_cache(cache_type< T > &cache, const T &data) const
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
cache_type< lit_variants > lit_cache
const map_location & get_loc() const
cache_type< surface > image_cache
bool save_image(const locator &i_locator, const std::string &filename)
bool operator==(const locator &a) const
GLdouble GLdouble GLdouble b
bool exists(const image::locator &i_locator)
returns true if the given image actually exists, without loading it.
bool in_cache(cache_type< T > &cache) const
light_string get_light_string(int op, int r, int g, int b)
return light_string of one light operation(see above)
bool operator==(const value &a) const
std::string modifications_
GLboolean GLboolean GLboolean GLboolean a
std::map< light_string, surface > lit_variants
T & access_in_cache(cache_type< T > &cache) const
void set_color_adjustment(int r, int g, int b)
will make all scaled images have these rgb values added to all their pixels.
Encapsulates the map of the game.
const std::string & get_filename() const
const std::string & get_modifications() const
surface load_from_disk(const locator &loc)
cache_type< bool > bool_cache
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Contains a wrapper class for the GPU_Image class.
locator & operator=(const locator &a)
surface get_hexmask()
function to get the standard hex mask
std::basic_string< signed char > light_string
light_string store colors info of central and adjacent hexes.
size_t hash_value(const locator::value &val)
mini_terrain_cache_map mini_highlighted_terrain_cache
void set_zoom(int amount)
sets the amount scaled images should be scaled.
the image manager is responsible for setting up images, and destroying all images when the program ex...
GLdouble GLdouble GLdouble r
bool 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...
mini_terrain_cache_map mini_terrain_cache
surface get_lighted_image(const image::locator &i_locator, const light_string &ls, TYPE type)
function to get the surface corresponding to an image.
const T & locate_in_cache(cache_type< T > &cache) const
const std::vector< std::string > & modifications(bool mp)
bool 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 ...
bool operator<(const locator &a) const
this module manages the cache of images.
boost::unordered_map< value, int > locator_finder_t
const std::vector< std::string > & get_team_colors()
bool operator!=(const locator &a) const
bool update_from_preferences()
initialize any private data, e.g. algorithm choices from preferences
GLsizei const GLcharARB ** string