Classes | |
struct | cache_item |
class | locator |
struct | manager |
the image manager is responsible for setting up images, and destroying all images when the program exits. More... | |
Typedefs | |
typedef std::vector < cache_item< surface > > | image_cache |
typedef std::vector < cache_item< locator > > | locator_cache |
typedef std::map < t_translation::t_terrain, surface > | mini_terrain_cache_map |
Enumerations | |
enum | TYPE { UNSCALED, HEXED, UNMASKED, SCALED_TO_HEX, SCALED_TO_ZOOM, BRIGHTENED, SEMI_BRIGHTENED } |
Functions | |
void | flush_cache () |
void | set_wm_icon () |
function to set the program's icon to the window manager. | |
void | set_pixel_format (SDL_PixelFormat *format) |
sets the pixel format used by the images. | |
void | set_colour_adjustment (int r, int g, int b) |
will make all scaled images have these rgb values added to all their pixels. | |
void | set_team_colors (const std::vector< std::string > *colors=NULL) |
set the team colors used by the TC image modification use a vector with one string for each team using NULL will reset to default TC | |
void | set_image_mask (const std::string &image_name) |
function which sets a certain image as a 'mask' for all scaled images. | |
void | set_zoom (int zoom) |
sets the amount scaled images should be scaled. | |
static surface | get_hexed (const locator i_locator) |
static surface | get_unmasked (const locator i_locator) |
static surface | get_scaled_to_hex (const locator i_locator) |
static surface | get_scaled_to_zoom (const locator i_locator) |
static surface | get_brightened (const locator i_locator) |
static surface | get_semi_brightened (const locator i_locator) |
surface | get_image (const locator &i_locator, TYPE type=UNSCALED, bool add_to_cache=true) |
function to get the surface corresponding to an image. | |
surface | reverse_image (const surface &surf) |
function to reverse an image. | |
bool | exists (const image::locator &i_locator) |
surface | getMinimap (int w, int h, const gamemap &map_, const viewpoint *vm=NULL) |
function to create the minimap for a given map the surface returned must be freed by the user | |
Variables | |
mini_terrain_cache_map | mini_terrain_cache |
mini_terrain_cache_map | mini_fogged_terrain_cache |
SDL_PixelFormat * | pixel_format = NULL |
const int | tile_size = 72 |
With an image name, you can get the surface corresponding to that image. images come in a number of varieties:
typedef std::vector<cache_item<surface> > image::image_cache |
typedef std::vector<cache_item<locator> > image::locator_cache |
enum image::TYPE |
bool image::exists | ( | const image::locator & | i_locator | ) |
Definition at line 733 of file image.cpp.
References cache, get_binary_file_location(), image::locator::get_filename(), image::locator::get_type(), image_existance_map, loc, and type.
Referenced by display::get_fog_shroud_graphics(), and terrain_builder::rule_valid().
void image::flush_cache | ( | ) |
Definition at line 88 of file image.cpp.
References brightened_images_, hexed_images_, image_existance_map, images_, mini_fogged_terrain_cache, mini_terrain_cache, reset_cache(), reversed_images_, scaled_to_hex_images_, scaled_to_zoom_, semi_brightened_images_, and unmasked_images_.
Referenced by events::console_handler::do_refresh(), map_editor::edit_refresh(), set_pixel_format(), and image::manager::~manager().
static surface image::get_brightened | ( | const locator | i_locator | ) | [static] |
Definition at line 605 of file image.cpp.
References brighten_image(), ftofxp, get_image(), and SCALED_TO_HEX.
Referenced by get_image().
static surface image::get_hexed | ( | const locator | i_locator | ) | [static] |
Definition at line 547 of file image.cpp.
References get_image(), mask_surface(), game_config::terrain_mask_image, and UNSCALED.
Referenced by get_image().
surface image::get_image | ( | const locator & | i_locator, | |
TYPE | type = UNSCALED , |
|||
bool | add_to_cache = true | |||
) |
function to get the surface corresponding to an image.
note that this surface must be freed by the user by calling SDL_FreeSurface()
Definition at line 617 of file image.cpp.
References image::locator::add_to_cache(), BRIGHTENED, brightened_images_, create_optimized_surface(), get_brightened(), get_hexed(), get_scaled_to_hex(), get_scaled_to_zoom(), get_semi_brightened(), get_unmasked(), HEXED, hexed_images_, images_, image::locator::in_cache(), image::locator::is_void(), image::locator::load_from_disk(), image::locator::locate_in_cache(), SCALED_TO_HEX, scaled_to_hex_images_, SCALED_TO_ZOOM, scaled_to_zoom_, SEMI_BRIGHTENED, semi_brightened_images_, tile_size, UNMASKED, unmasked_images_, UNSCALED, and zoom.
Referenced by help::help_text_area::add_img_item(), gui::button::button(), game_display::draw(), map_editor::brush_bar::draw(), map_editor::terrain_palette::draw(), editor_display::draw(), cursor::draw(), draw_background(), game_display::draw_bar(), display::draw_border(), gui::scrollbar::draw_contents(), mp::wait::leader_preview_pane::draw_contents(), mp::ui::draw_contents(), dialogs::campaign_preview_pane::draw_contents(), draw_label(), game_display::draw_movement_info(), draw_panel(), mp::gamebrowser::draw_row(), gui::menu::draw_row(), fade_logo(), game_display::footsteps_images(), get_brightened(), get_cursor(), dialogs::unit_types_preview_pane::get_details(), game_display::get_flag(), get_hexed(), gui::menu::style::get_item_image(), get_scaled_to_hex(), get_scaled_to_zoom(), get_semi_brightened(), display::get_terrain_images(), get_unmasked(), getMinimap(), image_width(), unit_frame::invalidate(), gui::menu::imgsel_style::load_image(), image::locator::load_image_sub_file(), game_display::new_turn(), unit_frame::redraw(), unit::redraw_unit(), display::refresh_report(), gui::scrollbar::scrollbar(), map_editor::set_mouseover_overlay(), set_wm_icon(), about::show_about(), show_intro_part(), unit::still_image(), and gui2::timage::timage().
static surface image::get_scaled_to_hex | ( | const locator | i_locator | ) | [static] |
Definition at line 569 of file image.cpp.
References adjust_surface_colour(), blue_adjust, get_image(), green_adjust, red_adjust, and UNMASKED.
Referenced by get_image().
static surface image::get_scaled_to_zoom | ( | const locator | i_locator | ) | [static] |
Definition at line 591 of file image.cpp.
References surface::get(), get_image(), surface::null(), scale_surface(), tile_size, UNSCALED, and zoom.
Referenced by get_image().
static surface image::get_semi_brightened | ( | const locator | i_locator | ) | [static] |
Definition at line 611 of file image.cpp.
References brighten_image(), ftofxp, get_image(), and SCALED_TO_HEX.
Referenced by get_image().
static surface image::get_unmasked | ( | const locator | i_locator | ) | [static] |
Definition at line 558 of file image.cpp.
References get_image(), HEXED, scale_surface(), tile_size, and zoom.
Referenced by get_image().
function to create the minimap for a given map the surface returned must be freed by the user
Definition at line 28 of file minimap.cpp.
References _, adjust_surface_colour(), blit_surface(), cache, create_compatible_surface(), DBG_DP, viewpoint::fogged(), get_image(), gamemap::get_terrain_info(), gamemap::h(), HEXED, terrain_type::is_combined(), is_odd(), loc, maximum(), mini_fogged_terrain_cache, mini_terrain_cache, terrain_type::minimap_image(), terrain_type::minimap_image_overlay(), gamemap::on_board(), pixel_format, r, scale_surface(), scale_surface_blended(), viewpoint::shrouded(), gamemap::total_height(), gamemap::total_width(), VALIDATE, vgettext(), t_translation::VOID_TERRAIN, gamemap::w(), and t_translation::write_terrain_code().
Referenced by display::draw_minimap(), mp::create::hide_children(), mp::create::process_event(), and mp::gamebrowser::set_game_items().
function to reverse an image.
The image MUST have originally been returned from an image:: function. Returned images have the same semantics as for get_image() and must be freed using SDL_FreeSurface()
Definition at line 711 of file image.cpp.
References flip_surface(), and reversed_images_.
Referenced by dialogs::unit_preview_pane::draw_contents(), and display::render_unit_image().
void image::set_colour_adjustment | ( | int | r, | |
int | g, | |||
int | b | |||
) |
will make all scaled images have these rgb values added to all their pixels.
i.e. add a certain colour hint to images. useful for representing day/night. Invalidates all scaled images.
Definition at line 488 of file image.cpp.
References blue_adjust, brightened_images_, green_adjust, red_adjust, reset_cache(), reversed_images_, scaled_to_hex_images_, and semi_brightened_images_.
Referenced by game_display::adjust_colours(), editor_display::draw(), and game_display::new_turn().
void image::set_image_mask | ( | const std::string & | image_name | ) |
function which sets a certain image as a 'mask' for all scaled images.
the 'mask' is blitted onto all scaled images.
Definition at line 510 of file image.cpp.
Referenced by game_display::new_turn().
void image::set_pixel_format | ( | SDL_PixelFormat * | format | ) |
sets the pixel format used by the images.
Is called every time the video mode changes. Invalidates all images.
Definition at line 482 of file image.cpp.
References flush_cache(), and pixel_format.
Referenced by CVideo::make_fake(), and CVideo::setMode().
void image::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 using NULL will reset to default TC
Definition at line 501 of file image.cpp.
References team_colors.
Referenced by game_display::game_display(), and play_game().
void image::set_wm_icon | ( | ) |
function to set the program's icon to the window manager.
must be called after SDL_Init() is called, but before setting the video mode
Definition at line 470 of file image.cpp.
References game_config::game_icon, get_image(), and UNSCALED.
Referenced by main().
void image::set_zoom | ( | int | zoom | ) |
sets the amount scaled images should be scaled.
Invalidates all scaled images.
Definition at line 527 of file image.cpp.
References brightened_images_, cached_zoom, reset_cache(), reversed_images_, scaled_to_hex_images_, scaled_to_zoom_, semi_brightened_images_, tile_size, unmasked_images_, and zoom.
Referenced by display::bounds_check_position(), display::display(), and display::set_zoom().
SDL_PixelFormat * image::pixel_format = NULL |
const int image::tile_size = 72 |
Definition at line 39 of file image.hpp.
Referenced by get_image(), get_scaled_to_zoom(), get_unmasked(), display::get_zoom_factor(), image::locator::load_image_sub_file(), and set_zoom().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |