#include <image.hpp>
Classes | |
struct | value |
Public Types | |
enum | type { NONE, FILE, SUB_FILE } |
typedef boost::unordered_map < value, int > | locator_finder_t |
Public Member Functions | |
locator () | |
locator (const locator &a, const std::string &mods="") | |
locator (const char *filename) | |
locator (const std::string &filename) | |
locator (const std::string &filename, const std::string &modifications) | |
locator (const std::string &filename, const map_location &loc, int center_x, int center_y, const std::string &modifications="") | |
locator & | operator= (const locator &a) |
bool | operator== (const locator &a) const |
bool | operator!= (const locator &a) const |
bool | operator< (const locator &a) const |
const std::string & | get_filename () const |
const map_location & | get_loc () const |
int | get_center_x () const |
int | get_center_y () const |
const std::string & | get_modifications () const |
type | get_type () const |
bool | is_void () const |
bool | file_exists () const |
Tests whether the file the locater points at exists. More... | |
template<typename T > | |
bool | in_cache (cache_type< T > &cache) const |
template<typename T > | |
T & | access_in_cache (cache_type< T > &cache) const |
template<typename T > | |
const T & | locate_in_cache (cache_type< T > &cache) const |
template<typename T > | |
void | add_to_cache (cache_type< T > &cache, const T &data) const |
Private Member Functions | |
void | init_index () |
void | parse_arguments () |
Private Attributes | |
int | index_ |
value | val_ |
Friends | |
size_t | hash_value (const value &) |
image::locator::locator | ( | const locator & | a, |
const std::string & | mods = "" |
||
) |
Definition at line 253 of file image.cpp.
References index_, init_index(), image::locator::value::modifications_, SUB_FILE, image::locator::value::type_, and val_.
image::locator::locator | ( | const char * | filename | ) |
Definition at line 265 of file image.cpp.
References init_index(), and parse_arguments().
image::locator::locator | ( | const std::string & | filename | ) |
Definition at line 273 of file image.cpp.
References init_index(), and parse_arguments().
image::locator::locator | ( | const std::string & | filename, |
const std::string & | modifications | ||
) |
Definition at line 281 of file image.cpp.
References init_index().
image::locator::locator | ( | const std::string & | filename, |
const map_location & | loc, | ||
int | center_x, | ||
int | center_y, | ||
const std::string & | modifications = "" |
||
) |
Definition at line 288 of file image.cpp.
References init_index().
T & image::locator::access_in_cache | ( | cache_type< T > & | cache | ) | const |
Definition at line 110 of file image.cpp.
References image::cache_type< T >::get_element(), and index_.
Referenced by image::get_lighted_image().
void image::locator::add_to_cache | ( | cache_type< T > & | cache, |
const T & | data | ||
) | const |
Definition at line 117 of file image.cpp.
References image::cache_type< T >::get_element(), and index_.
Referenced by image::get_hexed(), image::get_image(), image::get_lighted_image(), image::is_empty_hex(), image::is_in_hex(), and image::load_image_sub_file().
bool image::locator::file_exists | ( | ) | const |
Tests whether the file the locater points at exists.
is_void doesn't seem to work before the image is loaded and also in debug mode a placeholder is returned. So it's not possible to test for the existence of a file. So this function does that. (Note it tests for existence not whether or not it's a valid image.)
Definition at line 628 of file image.cpp.
References image::locator::value::filename_, filesystem::get_binary_file_location(), and val_.
Referenced by adjust_profile(), intf_get_image_size(), and arrow::update_symbols().
|
inline |
Definition at line 88 of file image.hpp.
References image::locator::value::center_x_, and val_.
Referenced by events::console_handler::do_layers(), and image::load_image_sub_file().
|
inline |
Definition at line 89 of file image.hpp.
References image::locator::value::center_y_, and val_.
Referenced by events::console_handler::do_layers(), and image::load_image_sub_file().
|
inline |
Definition at line 86 of file image.hpp.
References image::locator::value::filename_, and val_.
Referenced by unit_animation::add_anims(), events::console_handler::do_layers(), image::exists(), image::get_hexed(), unit_frame::get_overlaped_hex(), display::get_terrain_images(), image::load_image_file(), image::load_image_sub_file(), unit_frame::merge_parameters(), and unit_frame::redraw().
|
inline |
Definition at line 87 of file image.hpp.
References image::locator::value::loc_, and val_.
Referenced by events::console_handler::do_layers(), image::load_image_sub_file(), and image::simplify_type().
|
inline |
Definition at line 90 of file image.hpp.
References image::locator::value::modifications_, and val_.
Referenced by unit_animation::add_anims(), and image::load_image_sub_file().
|
inline |
Definition at line 91 of file image.hpp.
References image::locator::value::type_, and val_.
Referenced by image::exists(), and image::load_from_disk().
bool image::locator::in_cache | ( | cache_type< T > & | cache | ) | const |
Definition at line 97 of file image.cpp.
References image::cache_type< T >::get_element(), and index_.
Referenced by image::get_image(), image::get_lighted_image(), image::is_empty_hex(), and image::is_in_hex().
|
private |
|
inline |
Definition at line 96 of file image.hpp.
References NONE, image::locator::value::type_, and val_.
Referenced by image::get_image(), image::get_lighted_image(), unit_frame::get_overlaped_hex(), unit_frame::merge_parameters(), and unit_frame::redraw().
const T & image::locator::locate_in_cache | ( | cache_type< T > & | cache | ) | const |
Definition at line 103 of file image.cpp.
References image::cache_type< T >::get_element(), and index_.
Referenced by image::get_image(), image::get_lighted_image(), image::is_empty_hex(), and image::is_in_hex().
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 232 of file image.cpp.
References image::locator::value::filename_, image::locator::value::modifications_, SUB_FILE, image::locator::value::type_, and val_.
Referenced by locator().
|
friend |
Definition at line 374 of file image.cpp.
Referenced by image::hash_value().
|
private |
Definition at line 121 of file image.hpp.
Referenced by access_in_cache(), add_to_cache(), in_cache(), init_index(), locate_in_cache(), locator(), operator!=(), operator<(), operator=(), and operator==().
|
private |
Definition at line 122 of file image.hpp.
Referenced by file_exists(), get_center_x(), get_center_y(), get_filename(), get_loc(), get_modifications(), get_type(), init_index(), is_void(), locator(), operator=(), and parse_arguments().