Freeciv-3.3
|
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "astring.h"
#include "bitvector.h"
#include "capability.h"
#include "deprecations.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "rand.h"
#include "registry.h"
#include "shared.h"
#include "string_vector.h"
#include "support.h"
#include "base.h"
#include "effects.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "modpack.h"
#include "movement.h"
#include "nation.h"
#include "player.h"
#include "road.h"
#include "specialist.h"
#include "unit.h"
#include "unitlist.h"
#include "dialogs_g.h"
#include "graphics_g.h"
#include "gui_main_g.h"
#include "mapview_g.h"
#include "menu_g.h"
#include "themes_g.h"
#include "citydlg_common.h"
#include "client_main.h"
#include "climap.h"
#include "colors_common.h"
#include "control.h"
#include "editor.h"
#include "goto.h"
#include "gui_properties.h"
#include "helpdata.h"
#include "options.h"
#include "svgflag.h"
#include "themes_common.h"
#include "tilespec.h"
#include "specenum_gen.h"
#include "speclist.h"
#include "spechash.h"
Go to the source code of this file.
Data Structures | |
struct | anim |
struct | drawing_data |
struct | drawing_data::drawing_layer |
struct | city_style_threshold |
struct | city_sprite |
struct | river_sprites |
struct | citizen_graphic |
struct | citizen_set |
struct | style_citizen_set |
struct | named_sprites |
struct | specfile |
struct | small_sprite |
struct | tileset |
struct | tileset::tileset_layer |
struct | ts_list_data |
Enumerations | |
enum | direction4 { DIR4_NORTH = 0 , DIR4_SOUTH , DIR4_EAST , DIR4_WEST } |
enum | match_style { MATCH_NONE , MATCH_SAME , MATCH_PAIR , MATCH_FULL } |
enum | sprite_type { CELL_WHOLE , CELL_CORNER } |
enum | spec_file_types { SFILE_COMMON , SFILE_SVG , SFILE_PIXEL , SFILE_LAST } |
Variables | |
static const char | direction4letters [4] = "udrl" |
static const char | edge_name [EDGE_COUNT][3] = {"ns", "we", "ud", "lr"} |
static const int | DIR4_TO_DIR8 [4] |
struct tileset * | tileset = NULL |
struct tileset * | unscaled_tileset = NULL |
static bool | focus_unit_state = FALSE |
static bool | tileset_update = FALSE |
static int | global_anim_time = 0 |
#define ADD_ANIM_FULL | ( | s | ) |
Definition at line 4681 of file tilespec.c.
#define ADD_ANIM_SPRITE | ( | s, | |
draw_fog, | |||
x_offset, | |||
y_offset | |||
) | ADD_SPRITE(anim_get_current_frame(s), draw_fog, x_offset, y_offset) |
Definition at line 4677 of file tilespec.c.
#define ADD_ANIM_SPRITE_SIMPLE | ( | s | ) | ADD_SPRITE(anim_get_current_frame(s), TRUE, 0, 0) |
Definition at line 4679 of file tilespec.c.
#define ADD_FRAME0_FULL | ( | s | ) | ADD_SPRITE_FULL(s->sprites[0]) |
Definition at line 4686 of file tilespec.c.
#define ADD_FRAME0_SIMPLE | ( | s | ) | ADD_SPRITE_SIMPLE(s->sprites[0]) |
Definition at line 4685 of file tilespec.c.
#define ADD_SPRITE_FULL | ( | s | ) | ADD_SPRITE(s, TRUE, FULL_TILE_X_OFFSET, FULL_TILE_Y_OFFSET) |
Definition at line 4674 of file tilespec.c.
#define ADD_SPRITE_SIMPLE | ( | s | ) | ADD_SPRITE(s, TRUE, 0, 0) |
Definition at line 4673 of file tilespec.c.
Definition at line 482 of file tilespec.c.
#define anim_hash_iterate_end HASH_ITERATE_END |
Definition at line 485 of file tilespec.c.
#define FULL_TILE_X_OFFSET ((t->normal_tile_width - t->full_tile_width) / 2) |
Definition at line 4663 of file tilespec.c.
#define FULL_TILE_Y_OFFSET (t->normal_tile_height - t->full_tile_height) |
Definition at line 4664 of file tilespec.c.
#define LOAD_FACING_SPRITE | ( | dir | ) |
#define MATCH | ( | dir | ) |
#define MAX_INDEX_CARDINAL 64 |
Definition at line 110 of file tilespec.c.
#define MAX_INDEX_HALF 16 |
Definition at line 111 of file tilespec.c.
#define MAX_INDEX_VALID 256 |
Definition at line 112 of file tilespec.c.
#define MAX_NUM_LAYERS 3 |
Definition at line 182 of file tilespec.c.
#define MAX_NUM_MATCH_WITH 8 |
Definition at line 188 of file tilespec.c.
#define MAX_NUM_UPKEEP_SPRITES 10 |
Definition at line 116 of file tilespec.c.
#define NUM_CORNER_DIRS 4 |
Definition at line 555 of file tilespec.c.
#define NUM_TILES_DIGITS 10 |
Definition at line 115 of file tilespec.c.
#define NUM_TILES_HP_BAR 11 |
Definition at line 114 of file tilespec.c.
Definition at line 2978 of file tilespec.c.
#define SET_EDITOR_SPRITE | ( | x | ) | SET_SPRITE(editor.x, "editor." #x) |
#define SET_GOTO_TURN_SPRITE | ( | state, | |
state_name, | |||
factor, | |||
factor_name | |||
) |
Definition at line 2907 of file tilespec.c.
Definition at line 2971 of file tilespec.c.
Definition at line 2950 of file tilespec.c.
Definition at line 2917 of file tilespec.c.
#define SET_SPRITE_OPT | ( | field, | |
tag | |||
) | t->sprites.field = load_sprite(t, tag, TRUE, TRUE, FALSE) |
Definition at line 2968 of file tilespec.c.
Definition at line 2926 of file tilespec.c.
#define small_sprite_list_iterate | ( | list, | |
pitem | |||
) | TYPED_LIST_ITERATE(struct small_sprite, list, pitem) |
Definition at line 463 of file tilespec.c.
#define small_sprite_list_iterate_end LIST_ITERATE_END |
Definition at line 465 of file tilespec.c.
Definition at line 98 of file tilespec.c.
#define SPECENUM_COUNT ESTYLE_COUNT |
Definition at line 135 of file tilespec.c.
Definition at line 118 of file tilespec.c.
#define SPECENUM_VALUE0 ESTYLE_ROAD_ALL_SEPARATE |
Definition at line 119 of file tilespec.c.
#define SPECENUM_VALUE0NAME "RoadAllSeparate" |
Definition at line 120 of file tilespec.c.
#define SPECENUM_VALUE1 ESTYLE_ROAD_PARITY_COMBINED |
Definition at line 121 of file tilespec.c.
#define SPECENUM_VALUE1NAME "RoadParityCombined" |
Definition at line 122 of file tilespec.c.
#define SPECENUM_VALUE2 ESTYLE_ROAD_ALL_COMBINED |
Definition at line 123 of file tilespec.c.
#define SPECENUM_VALUE2NAME "RoadAllCombined" |
Definition at line 124 of file tilespec.c.
#define SPECENUM_VALUE3 ESTYLE_RIVER |
Definition at line 125 of file tilespec.c.
#define SPECENUM_VALUE3NAME "River" |
Definition at line 126 of file tilespec.c.
#define SPECENUM_VALUE4 ESTYLE_SINGLE1 |
Definition at line 127 of file tilespec.c.
#define SPECENUM_VALUE4NAME "Single1" |
Definition at line 128 of file tilespec.c.
#define SPECENUM_VALUE5 ESTYLE_SINGLE2 |
Definition at line 129 of file tilespec.c.
#define SPECENUM_VALUE5NAME "Single2" |
Definition at line 130 of file tilespec.c.
#define SPECENUM_VALUE6 ESTYLE_3LAYER |
Definition at line 131 of file tilespec.c.
#define SPECENUM_VALUE6NAME "3Layer" |
Definition at line 132 of file tilespec.c.
#define SPECENUM_VALUE7 ESTYLE_CARDINALS |
Definition at line 133 of file tilespec.c.
#define SPECENUM_VALUE7NAME "Cardinals" |
Definition at line 134 of file tilespec.c.
Definition at line 434 of file tilespec.c.
#define specfile_list_iterate_end LIST_ITERATE_END |
Definition at line 436 of file tilespec.c.
#define SPECHASH_ASTR_KEY_TYPE |
Definition at line 469 of file tilespec.c.
#define SPECHASH_ASTR_KEY_TYPE |
Definition at line 469 of file tilespec.c.
#define SPECHASH_ASTR_KEY_TYPE |
Definition at line 469 of file tilespec.c.
#define SPECHASH_CSTR_KEY_TYPE |
Definition at line 491 of file tilespec.c.
#define SPECHASH_ENUM_DATA_TYPE extrastyle_id |
Definition at line 498 of file tilespec.c.
#define SPECHASH_IDATA_FREE drawing_data_destroy |
Definition at line 493 of file tilespec.c.
#define SPECHASH_IDATA_TYPE struct small_sprite * |
Definition at line 470 of file tilespec.c.
Definition at line 470 of file tilespec.c.
#define SPECHASH_IDATA_TYPE struct drawing_data * |
Definition at line 470 of file tilespec.c.
Definition at line 468 of file tilespec.c.
Definition at line 468 of file tilespec.c.
#define SPECHASH_TAG drawing |
Definition at line 468 of file tilespec.c.
Definition at line 468 of file tilespec.c.
Definition at line 430 of file tilespec.c.
#define SPECLIST_TAG small_sprite |
Definition at line 430 of file tilespec.c.
Definition at line 431 of file tilespec.c.
#define SPECLIST_TYPE struct small_sprite |
Definition at line 431 of file tilespec.c.
Definition at line 472 of file tilespec.c.
#define sprite_hash_iterate_end HASH_ITERATE_END |
Definition at line 475 of file tilespec.c.
#define TILE_SECTION_PREFIX "tile_" |
Definition at line 107 of file tilespec.c.
#define TILES_PER_CORNER 4 |
Definition at line 556 of file tilespec.c.
#define TILESPEC_CAPSTR "+Freeciv-tilespec-3.3-Devel-2024-Nov-16 duplicates_ok" |
Definition at line 82 of file tilespec.c.
#define TILESPEC_SUFFIX ".tilespec" |
Definition at line 106 of file tilespec.c.
#define UNKNOWN | ( | dir | ) |
Enumerator | |
---|---|
DIR4_NORTH | |
DIR4_SOUTH | |
DIR4_EAST | |
DIR4_WEST |
Definition at line 139 of file tilespec.c.
Enumerator | |
---|---|
MATCH_NONE | |
MATCH_SAME | |
MATCH_PAIR | |
MATCH_FULL |
Definition at line 149 of file tilespec.c.
Enumerator | |
---|---|
SFILE_COMMON | |
SFILE_SVG | |
SFILE_PIXEL | |
SFILE_LAST |
Definition at line 161 of file tilespec.c.
Enumerator | |
---|---|
CELL_WHOLE | |
CELL_CORNER |
Definition at line 156 of file tilespec.c.
Advance animations.
Definition at line 6755 of file tilespec.c.
Referenced by real_timer_callback().
Proceed with the animation.
a | Animation to advance |
Definition at line 3036 of file tilespec.c.
Referenced by toggle_focus_unit_state().
Free resources associated with the anim
a | Animation to free |
Definition at line 2775 of file tilespec.c.
Referenced by free_all_anims().
Get current frame (sprite) of the animation
a | Animation |
Definition at line 3047 of file tilespec.c.
Load an animation
t | Tileset to load animation from |
tag | Base tag of the animation sprites |
time_per_frame | How many refreshes there's between advancing to the next frame. 0 for default. |
Definition at line 2995 of file tilespec.c.
Referenced by tileset_lookup_sprite_tags(), and tileset_setup_base().
Create a new anim structure
frames | Number of frames in the animation |
Definition at line 2757 of file tilespec.c.
Referenced by anim_load().
|
static |
Assemble some data that is used in building the tile sprite arrays. (map_x, map_y) : the (normalized) map position The values we fill in: tterrain_near : terrain types of all adjacent terrain textra_near : extras of all adjacent terrain
Definition at line 4696 of file tilespec.c.
Referenced by fill_sprite_array().
Calculate the height of a unit upkeep icons.
Definition at line 839 of file tilespec.c.
Referenced by tileset_lookup_sprite_tags().
Return a directional string for the cardinal directions. Normally the binary value 1000 will be converted into "n1e0s0w0". This is in a clockwise ordering.
Definition at line 2715 of file tilespec.c.
Referenced by load_river_sprites(), tileset_lookup_sprite_tags(), tileset_setup_extra(), and tileset_setup_tile_type().
Determine the sprite_type string.
Definition at line 1910 of file tilespec.c.
Referenced by tileset_read_toplevel().
|
static |
Checks options in filename match what we require and support. Die if not. 'which' should be "tilespec" or "spec".
Definition at line 1205 of file tilespec.c.
Referenced by ensure_big_sprite(), scan_specfile(), and tileset_read_toplevel().
|
static |
Returns a text name for the citizen, as used in the tileset.
Definition at line 2690 of file tilespec.c.
Referenced by tileset_setup_citizen_types().
Create a sprite with the given color and tag.
Definition at line 2860 of file tilespec.c.
Referenced by tileset_background_init(), and tileset_player_init().
|
static |
Parse a direction name as a direction8.
Definition at line 1038 of file tilespec.c.
Referenced by tileset_read_toplevel().
|
static |
Return the tileset name of the direction. This is similar to dir_get_name() but you shouldn't change this or all tilesets will break.
Definition at line 1011 of file tilespec.c.
Referenced by cardinal_index_str(), dir_by_tileset_name(), load_river_sprites(), tileset_lookup_sprite_tags(), tileset_setup_road(), tileset_setup_unit_direction(), and valid_index_str().
|
static |
Free a drawing data.
Definition at line 686 of file tilespec.c.
Referenced by tileset_read_toplevel().
|
static |
Create a new drawing data.
Definition at line 674 of file tilespec.c.
Referenced by tileset_read_toplevel().
Ensure that the big sprite of the given spec file is loaded.
Definition at line 1639 of file tilespec.c.
Referenced by load_sprite().
|
static |
Fills the sprite array with sprites that together make a representative image of the given base type. The image is suitable for use as an icon for the base type, for example.
Definition at line 7511 of file tilespec.c.
Referenced by fill_basic_extra_sprite_array().
int fill_basic_extra_sprite_array | ( | const struct tileset * | t, |
struct drawn_sprite * | sprs, | ||
const struct extra_type * | pextra | ||
) |
Return a representative sprite for the given extra type.
Definition at line 7428 of file tilespec.c.
Referenced by create_extra_pixbuf(), help_dialog::make_tree(), set_help_tile_from_extra(), help_widget::set_topic_extra(), and terrain_canvas().
|
static |
Fills the sprite array with sprites that together make a representative image of the given road type. The image is suitable for use as an icon for the road type, for example.
Definition at line 7463 of file tilespec.c.
Referenced by fill_basic_extra_sprite_array().
int fill_basic_terrain_layer_sprite_array | ( | struct tileset * | t, |
struct drawn_sprite * | sprs, | ||
int | layer, | ||
struct terrain * | pterrain | ||
) |
Fill the sprite array with sprites that together make a representative image of the given terrain type. Suitable for use as an icon and in list views.
NB: The 'layer' argument is NOT a LAYER_* value, but rather one of 0, 1, 2. Using other values for 'layer' here will result in undefined behaviour. ;)
Definition at line 7395 of file tilespec.c.
Referenced by create_terrain_pixbuf(), set_help_tile_from_terrain(), and terrain_canvas().
|
static |
Fill in the city overlays for the tile. This includes the citymap overlays on the mapview as well as the tile output sprites.
Definition at line 5262 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Add sprites for fog (and some forms of darkness).
Definition at line 5382 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Fill in the given sprite array with any needed goto sprites.
Definition at line 5865 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Fill in the grid sprites for the given tile, city, and unit.
Definition at line 5715 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Fill in the farmland/irrigation sprite for the tile.
Definition at line 5220 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Add any corner road sprites to the sprite array.
Definition at line 4937 of file tilespec.c.
Referenced by fill_road_sprite_array().
|
static |
Fill all road and rail sprites into the sprite array.
Definition at line 4988 of file tilespec.c.
Referenced by fill_sprite_array().
int fill_sprite_array | ( | struct tileset * | t, |
struct drawn_sprite * | sprs, | ||
enum mapview_layer | layer, | ||
const struct tile * | ptile, | ||
const struct tile_edge * | pedge, | ||
const struct tile_corner * | pcorner, | ||
const struct unit * | punit, | ||
const struct city * | pcity, | ||
const struct city * | citymode, | ||
const struct unit_type * | putype | ||
) |
Fill in the sprite array for the given tile, city, and unit.
ptile, if specified, gives the tile. If specified the terrain and specials will be drawn for this tile. In this case (map_x, map_y) should give the location of the tile.
punit, if specified, gives the unit. For tile drawing this should generally be get_drawable_unit(); otherwise it can be any unit.
pcity, if specified, gives the city. For tile drawing this should generally be tile_city(ptile); otherwise it can be any city.
citymode specifies whether this is part of a citydlg. If so some drawing is done differently.
Definition at line 6000 of file tilespec.c.
Referenced by put_one_element().
|
static |
Helper function for fill_terrain_sprite_layer().
Definition at line 5436 of file tilespec.c.
Referenced by fill_basic_terrain_layer_sprite_array(), and fill_terrain_sprite_layer().
|
static |
Helper function for fill_terrain_sprite_layer. Fill in the sprite array for blended terrain.
Definition at line 5342 of file tilespec.c.
Referenced by fill_terrain_sprite_layer().
|
static |
Helper function for fill_terrain_sprite_layer. Fill in the sprite array of darkness.
Definition at line 5589 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Add sprites for the base tile to the sprite list. This doesn't include specials or rivers.
Definition at line 5653 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Fill in the sprite array for the unit.
Definition at line 4747 of file tilespec.c.
Referenced by fill_sprite_array().
|
static |
Fill in the sprite array for the unit type.
Definition at line 4728 of file tilespec.c.
Referenced by fill_sprite_array(), and fill_unit_sprite_array().
Frees any internal buffers which are created by load_sprite(). Should be called after the last (for a given period of time) load_sprite() call. This saves a fair amount of memory, but it will take extra time the next time we start loading sprites again.
Definition at line 3788 of file tilespec.c.
Referenced by handle_rulesets_ready(), and tileset_load_tiles().
Setup tileset for showing combat where focus unit participates.
Definition at line 6734 of file tilespec.c.
Referenced by set_units_in_combat().
Free resources allocated for all animations.
Definition at line 6806 of file tilespec.c.
Referenced by tileset_free_tiles().
|
static |
Frees a city sprite.
See also get_city_sprite, load_city_sprite.
Definition at line 3316 of file tilespec.c.
Referenced by tileset_free_tiles(), and tileset_setup_city_tiles().
Return a sprite with an "arrow" theme graphic.
Definition at line 7092 of file tilespec.c.
Referenced by populate_unit_image_table(), and populate_unit_pic_table().
Returns a sprite with the "user-attention" crosshair graphic.
FIXME: This function shouldn't be needed if the attention graphics are drawn natively by the tileset code.
Definition at line 7214 of file tilespec.c.
Referenced by draw_calculated_trade_routes(), and put_cross_overlay_tile().
Return a rectangular sprite containing a fog "color". This can be used for drawing fog onto arbitrary areas (like the overview).
Definition at line 7277 of file tilespec.c.
Referenced by put_overview_tile_area().
Return the sprite for the building/improvement.
Definition at line 7007 of file tilespec.c.
Referenced by cell_render_func(), city_dialog_update_building(), city_dialog_update_improvement_list(), research_diagram::create_tooltip_help(), drag_begin(), draw_reqtree(), economy_report_update(), impr_item::enterEvent(), get_building_surface(), help_update_improvement(), help_update_wonder(), impr_item::impr_item(), impr_item::leaveEvent(), help_dialog::make_tree(), node_rectangle_minimum_size(), city_production_delegate::paint(), progress_bar::set_pixmap(), help_widget::set_topic_building(), city_dialog::update_improvements(), and eco_report::update_report().
|
inlinestatic |
Return the citizen_graphic for the given citizen or specialist type.
Definition at line 6925 of file tilespec.c.
Referenced by get_citizen_sprite().
struct sprite * get_citizen_sprite | ( | const struct tileset * | t, |
enum citizen_category | type, | ||
int | citizen_index, | ||
const struct city * | pcity | ||
) |
Return a sprite for the given citizen. The citizen's type is given, as well as their index (in the range [0..city_size_get(pcity))). The citizen's city can be used to determine which sprite to use (a NULL value indicates there is no city; i.e., the sprite is just being used as a picture).
Definition at line 6946 of file tilespec.c.
Referenced by city_dialog_update_citizens(), client_government_sprite(), get_citizen_surface(), refresh_feeling_surface(), refresh_feeling_surface(), and city_dialog::update_citizens().
Return the flag graphic to be used by the city.
Definition at line 4642 of file tilespec.c.
Referenced by fill_sprite_array(), and show_full_citybar().
|
static |
Return the sprite in the city_sprite listing that corresponds to this city - based on city style and size.
See also load_city_sprite(), free_city_sprite().
Definition at line 3211 of file tilespec.c.
Referenced by fill_sprite_array().
Return all the sprites used for city bar drawing.
Definition at line 7161 of file tilespec.c.
Referenced by show_full_citybar().
struct color_system * get_color_system | ( | const struct tileset * | t | ) |
Return the tileset's color system.
Definition at line 7285 of file tilespec.c.
Referenced by get_color().
struct sprite * get_cursor_sprite | ( | const struct tileset * | t, |
enum cursor_type | cursor, | ||
int * | hot_x, | ||
int * | hot_y, | ||
int | frame | ||
) |
Returns a sprite for the given cursor. The "hot" coordinates (the active coordinates of the mouse relative to the sprite) are placed int (*hot_x, *hot_y). A cursor can consist of several frames to be used for animation.
Definition at line 7184 of file tilespec.c.
Referenced by animate_mouse_cursor(), fc_client::create_cursors(), and load_cursors().
struct unit * get_drawable_unit | ( | const struct tileset * | t, |
struct tile * | ptile, | ||
const struct city * | citymode | ||
) |
Find unit that we can display from given tile.
Definition at line 6766 of file tilespec.c.
Referenced by city_dialog_redraw_map(), and put_one_tile().
Return all the sprites used for editor icons, images, etc.
Definition at line 7173 of file tilespec.c.
Referenced by editbar_create(), editor_get_mode_sprite(), editor_tool_get_sprite(), and get_tool_value_pixbuf().
Return event icon sprite
Definition at line 7124 of file tilespec.c.
Referenced by meswin_dialog_refresh(), and messagewdg::msg().
Return the amount of time between calls to toggle_focus_unit_state(). The main loop needs to call toggle_focus_unit_state() about this often to do the active-unit animation.
Definition at line 6709 of file tilespec.c.
Referenced by blink_active_unit().
Return the sprite for the government.
Definition at line 7017 of file tilespec.c.
Referenced by client_government_sprite(), research_diagram::create_tooltip_help(), draw_reqtree(), extviewer_refresh_widgets(), extviewer_view_cell_toggled(), get_government_surface(), help_dialog::make_tree(), node_rectangle_minimum_size(), property_page_set_store_value(), and gov_menu::update().
Return a sprite for the given icon. Icons are used by the operating system/window manager. Usually freeciv has to tell the OS what icon to use.
Note that this function will return NULL before the sprites are loaded. The GUI code must be sure to call tileset_load_tiles() before setting the top-level icon.
Definition at line 7203 of file tilespec.c.
Referenced by create_city_dialog(), qtg_ui_main(), city_dialog::setup_ui(), tileset_changed(), and ui_main().
struct sprite * get_indicator_sprite | ( | const struct tileset * | t, |
enum indicator_type | indicator, | ||
int | idx | ||
) |
Returns a sprite for the given indicator with the given index. The index should be in [0, NUM_TILES_PROGRESS).
Definition at line 7223 of file tilespec.c.
Referenced by client_cooling_sprite(), client_research_sprite(), and client_warming_sprite().
|
static |
Return the index of the sprite to be used for irrigation or farmland in this tile.
We assume that the current tile has farmland or irrigation. We then choose a sprite (index) based upon which cardinally adjacent tiles have either farmland or irrigation (the two are considered interchangable for this).
Definition at line 5200 of file tilespec.c.
Referenced by fill_irrigation_sprite_array().
struct sprite * get_nation_flag_sprite | ( | const struct tileset * | t, |
const struct nation_type * | pnation | ||
) |
Return the sprite for the nation.
Definition at line 6980 of file tilespec.c.
Referenced by diplo_dlg::add_widget(), create_diplomacy_dialog(), plr_item::data(), diplo_wdg::diplo_wdg(), fill_sprite_array(), goto_dialog::fill_tab(), get_city_flag_sprite(), get_flag(), get_nation_flag_surface(), help_update_nation(), help_dialog::make_tree(), qtg_init_meeting(), races_dialog::set_index(), city_dialog::update_nation_table(), endgame_report::update_report(), and fc_client::update_start_page().
struct sprite * get_nation_shield_sprite | ( | const struct tileset * | t, |
const struct nation_type * | pnation | ||
) |
Return the shield sprite for the nation.
Definition at line 6989 of file tilespec.c.
Referenced by pregame_options::update_buttons().
Return a sprite contining the single nuke graphic.
TODO: This should be an animation like the unit explode animation.
Definition at line 7153 of file tilespec.c.
Referenced by nuke_animation(), and put_nuke_mushroom_pixmaps().
Return a "sample" sprite for this city style.
Definition at line 7075 of file tilespec.c.
Referenced by create_races_dialog(), get_sample_city_surface(), and races_dialog::races_dialog().
Return the sprite for drawing the given spaceship part.
Definition at line 6915 of file tilespec.c.
Referenced by get_spaceship_dimensions(), and put_spaceship().
Return a tax sprite for the given output type (usually gold/lux/sci).
Definition at line 7103 of file tilespec.c.
Referenced by get_tax_surface(), fc_double_edge::paintEvent(), fc_sidewidget::resize_pixmap(), setup_widgets(), fc_double_edge::sizeHint(), unittype_item::unittype_item(), fc_sidewidget::update_final_pixmap(), and update_info_label().
Return the sprite for the technology/advance.
Definition at line 6998 of file tilespec.c.
Referenced by get_tech_icon(), help_update_tech(), help_dialog::make_tree(), progress_bar::set_pixmap(), help_widget::set_topic_tech(), side_right_click_science(), and science_report::update_report().
Return unscaled tileset if it exists, or default otherwise
Definition at line 718 of file tilespec.c.
Referenced by canvas_to_city_pos(), city_dialog::city_dialog(), generate_citydlg_dimensions(), unittype_item::init_img(), city_production_delegate::paint(), progress_bar::set_pixmap(), unit_item::unit_item(), city_dialog::update_improvements(), and unit_info::update_units().
Returns a static list of tilesets available on the system.
Definition at line 1150 of file tilespec.c.
Referenced by mr_menu::tileset_custom_load().
Return a thumbs-up/thumbs-down sprite to show treaty approval or disapproval.
Definition at line 7133 of file tilespec.c.
Referenced by get_thumb_pixbuf(), and diplo_wdg::update_wdg().
Return a sprite_vector containing the animation sprites for a unit explosion.
Definition at line 7142 of file tilespec.c.
Referenced by decrease_unit_hp_smooth().
|
static |
Return a sprite for the national flag for this unit.
Definition at line 4651 of file tilespec.c.
Referenced by fill_unit_sprite_array().
struct sprite * get_unit_unhappy_sprite | ( | const struct tileset * | t, |
const struct unit * | punit, | ||
int | happy_cost | ||
) |
Return a sprite for the unhappiness of the unit - to be shown as an overlay on the unit in the city support dialog, for instance.
May return NULL if there's no unhappiness.
Definition at line 7240 of file tilespec.c.
Referenced by put_unit_city_overlays().
struct sprite * get_unit_upkeep_sprite | ( | const struct tileset * | t, |
Output_type_id | otype, | ||
const struct unit * | punit, | ||
const int * | upkeep_cost | ||
) |
Return a sprite for the upkeep of the unit - to be shown as an overlay on the unit in the city support dialog, for instance.
May return NULL if there's no upkeep of the kind.
Definition at line 7259 of file tilespec.c.
Referenced by put_unit_city_overlays().
struct sprite * get_unittype_sprite | ( | const struct tileset * | t, |
const struct unit_type * | punittype, | ||
enum unit_activity | activity, | ||
enum direction8 | facing | ||
) |
Return the sprite for the unit type (the base "unit" sprite). If 'facing' is direction8_invalid(), will use an unoriented sprite or a default orientation.
Definition at line 7029 of file tilespec.c.
Referenced by cell_render_func(), city_dialog_update_building(), research_diagram::create_tooltip_help(), drag_begin(), draw_reqtree(), economy_report_update(), editbar_reload_tileset(), fill_unit_type_sprite_array(), get_tool_value_pixbuf(), get_unittype_surface(), help_update_unit_type(), unittype_item::init_img(), help_dialog::make_tree(), node_rectangle_minimum_size(), city_production_delegate::paint(), select_tgt_extra(), select_tgt_unit(), progress_bar::set_pixmap(), hud_unit_loader::show_me(), city_dialog::update_improvements(), update_max_unit_size(), and eco_report::update_report().
Convert properties of an index of tileset topology type to one (but not necessarily the only one) topology.
Definition at line 1111 of file tilespec.c.
Referenced by default_tileset_select().
Return TRUE iff the dir is cardinal in this tileset.
"Cardinal", in this sense, means that a tile will share a border with another tile in the direction rather than sharing just a single vertex.
Definition at line 1074 of file tilespec.c.
Referenced by fill_road_corner_sprites(), fill_road_sprite_array(), tileset_read_toplevel(), and tileset_setup_road().
|
static |
Should the given extra be drawn? FIXME: Some extras can not be switched
Definition at line 5933 of file tilespec.c.
Referenced by fill_irrigation_sprite_array(), and fill_sprite_array().
Return TRUE iff the dir is valid in this tileset.
Definition at line 1056 of file tilespec.c.
Referenced by is_cardinal_tileset_dir(), tileset_read_toplevel(), and tileset_setup_unit_direction().
Allocates and loads a new city sprite from the given sprite tags.
tag may be NULL.
See also get_city_sprite(), free_city_sprite().
Definition at line 3288 of file tilespec.c.
Referenced by tileset_setup_city_tiles().
|
static |
Allocates one threshold set for city sprite
Definition at line 3247 of file tilespec.c.
Referenced by load_city_sprite().
Loads the given graphics file (found in the data path) into a newly allocated sprite.
Definition at line 1603 of file tilespec.c.
Referenced by ensure_big_sprite(), and load_sprite().
Load sprite from popup image tag
Definition at line 7807 of file tilespec.c.
Referenced by popup_image(), and qtg_popup_image().
|
static |
Load sprites of one river type.
Definition at line 3754 of file tilespec.c.
Referenced by tileset_setup_road().
|
static |
Loads the sprite. If the sprite is already loaded a reference counter is increased. Can return NULL if the sprite couldn't be loaded. Scale means if sprite should be scaled, smooth if scaling might use other scaling algorithm than nearest neighbor.
Definition at line 2790 of file tilespec.c.
Referenced by anim_load(), fill_terrain_sprite_layer(), load_city_thresholds_sprites(), load_popup_sprite(), load_river_sprites(), tiles_lookup_sprite_tag_alt(), tileset_lookup_sprite_tags(), tileset_setup_citizen_types(), tileset_setup_extra(), tileset_setup_nation_flag(), tileset_setup_specialist_type(), tileset_setup_tile_type(), tileset_setup_unit_direction(), and tileset_setup_unit_type_from_tag().
Reset the focus unit state. This should be called when changing focus units.
Definition at line 6722 of file tilespec.c.
Referenced by focus_unit_in_combat().
Scan all sprites declared in the given specfile. This means that the positions of the sprites in the big_sprite are saved in the small_sprite structs.
Definition at line 1680 of file tilespec.c.
Referenced by tileset_scan_single_list().
Return TRUE iff the specified sprite exists in the tileset (whether or not it is currently loaded).
Definition at line 2900 of file tilespec.c.
Referenced by anim_load(), and tileset_lookup_sprite_tags().
struct sprite * tiles_lookup_sprite_tag_alt | ( | struct tileset * | t, |
enum log_level | level, | ||
const char * | tag, | ||
const char * | alt, | ||
const char * | alt2, | ||
const char * | what, | ||
const char * | name, | ||
bool | scale | ||
) |
Lookup sprite to match tag, alt, or alt2, in that order. If none can be found, return NULL, and emit log message. alt2 can be NULL.
Definition at line 3815 of file tilespec.c.
Referenced by tileset_setup_government(), tileset_setup_impr_type(), tileset_setup_tech_type(), tileset_setup_tile_type(), and unittype_item::unittype_item().
Free tiles for the background.
Definition at line 7699 of file tilespec.c.
Referenced by tileset_background_init(), and tileset_free_tiles().
Setup tiles for the background.
Definition at line 7680 of file tilespec.c.
Referenced by handle_ruleset_game(), and tilespec_reread().
Return the name of the given tileset.
Definition at line 730 of file tilespec.c.
Referenced by handle_ruleset_control(), handle_set_topology(), popup_tileset_suggestion_dialog(), map_view::shortcut_pressed(), mr_menu::zoom_in(), mr_menu::zoom_out(), and mr_menu::zoom_reset().
Return the offset from the origin of the city tile at which to place the city bar text.
Definition at line 936 of file tilespec.c.
Referenced by show_city_descriptions(), show_full_citybar(), and show_small_citybar().
Return tileset description body
Definition at line 7775 of file tilespec.c.
Referenced by boot_help_texts().
Called when ever there's problem in ruleset/tileset compatibility
Definition at line 650 of file tilespec.c.
Referenced by anim_load(), ensure_big_sprite(), handle_map_info(), load_sprite(), popup_tileset_suggestion_dialog(), scan_specfile(), tiles_lookup_sprite_tag_alt(), tileset_lookup_sprite_tags(), tileset_read_toplevel(), tileset_setup_base(), tileset_setup_citizen_types(), tileset_setup_city_tiles(), tileset_setup_extra(), tileset_setup_nation_flag(), tileset_setup_road(), tileset_setup_specialist_type(), tileset_setup_tile_type(), tileset_setup_unit_type(), tileset_suggestion_callback(), tileset_suggestion_response(), tilespec_gfx_filename(), tilespec_reread(), and tilespec_try_read().
Clean up.
Definition at line 1315 of file tilespec.c.
Referenced by client_exit(), tileset_read_toplevel(), tilespec_reread(), ts_cb(), and ts_list_cb().
Free all sprites from tileset.
Definition at line 6819 of file tilespec.c.
Referenced by fc_client::fc_main(), tileset_free(), and ui_main().
Frees the tilespec toplevel data, in preparation for re-reading it.
Definition at line 1243 of file tilespec.c.
Referenced by tileset_free().
Return the full tile height of the current tileset. This is the maximum height that any mapview sprite will have. This may be greater than the tile width in which case the extra area is above the "normal" tile.
Some callers assume the full height is 50% larger than the height in iso-view, and equal in non-iso view.
Definition at line 815 of file tilespec.c.
Referenced by battle_animation(), city_dialog_update_present_units(), create_pixbuf_from_layers(), create_present_supported_units_widget_list(), get_terrain_surface(), move_unit_map_canvas(), movement_animation(), put_city(), put_terrain(), put_unit_image(), put_unit_picture(), redraw_unit_info_label(), help_widget::set_topic_extra(), help_widget::set_topic_unit(), terrain_canvas(), tile_to_canvas_pos(), usdlg_get_unit_image(), and usdlg_tab_append_utype().
Return the full tile width of the current tileset. This is the maximum width that any mapview sprite will have.
Note: currently this is always equal to the tile width.
Definition at line 802 of file tilespec.c.
Referenced by create_pixbuf_from_layers(), create_present_supported_units_widget_list(), create_unit_surface(), get_terrain_surface(), popit(), put_unit_image(), put_unit_image_city_overlays(), put_unit_picture(), put_unit_picture_city_overlays(), real_activeunits_report_dialog_update(), redraw_unit_info_label(), help_widget::set_topic_extra(), help_widget::set_topic_unit(), terrain_canvas(), hud_units::update_actions(), usdlg_get_unit_image(), and usdlg_tab_append_utype().
Gets the nth layer of the tileset.
Definition at line 7547 of file tilespec.c.
Return the hex_height of the current tileset. For hex tilesets this value will be > 0 and is_isometric will be set.
Definition at line 756 of file tilespec.c.
Referenced by battle_animation(), client_start_server(), units_select::create_pixmap(), gui_to_map_pos(), move_unit_map_canvas(), movement_animation(), qtg_crop_sprite(), tileset_map_topo_compatible(), tileset_read_toplevel(), unit_item::unit_item(), and unit_info::update_units().
Return the hex_width of the current tileset. For iso-hex tilesets this value will be > 0 and is_isometric will be set.
Definition at line 747 of file tilespec.c.
Referenced by client_start_server(), units_select::create_pixmap(), gui_to_map_pos(), qtg_crop_sprite(), mr_menu::save_image(), tileset_map_topo_compatible(), unit_item::unit_item(), and unit_info::update_units().
Initialize tileset structure
Definition at line 7354 of file tilespec.c.
Referenced by activate_gui(), qtg_ui_main(), ui_main(), and ui_main().
Is tileset in sane state?
Definition at line 7743 of file tilespec.c.
Referenced by science_diagram_update(), science_diagram_update(), and update_unqueue().
Return whether the current tileset is isometric.
Definition at line 738 of file tilespec.c.
Referenced by battle_animation(), can_do_cached_drawing(), canvas_to_city_pos(), client_start_server(), units_select::create_pixmap(), get_mapview_scroll_step(), get_mapview_scroll_window(), gui_to_map_dir(), gui_to_map_pos(), gui_to_natural_pos(), gui_to_overview(), map_to_gui_dir(), map_to_gui_vector(), move_unit_map_canvas(), movement_animation(), mr_menu::save_image(), tile_visible_and_not_on_border_mapcanvas(), tileset_lookup_sprite_tags(), tileset_map_topo_compatible(), unit_item::unit_item(), hud_units::update_actions(), update_map_canvas(), update_selection_rectangle(), and unit_info::update_units().
bool tileset_layer_in_category | ( | enum mapview_layer | layer, |
enum layer_category | cat | ||
) |
Gets the nth layer of the tileset.
Definition at line 7557 of file tilespec.c.
Referenced by create_pixbuf_from_layers().
Load the tiles; requires tilespec_read_toplevel() called previously. Leads to tile_sprites being allocated and filled with pointers to sprites. Also sets up and populates sprite_hash, and calls func to initialize 'sprites' structure.
Definition at line 3804 of file tilespec.c.
Referenced by activate_gui(), qtg_ui_main(), tilespec_reread(), ui_main(), and ui_main().
Initialize 'sprites' structure based on hardwired tags which freeciv always requires.
Definition at line 3336 of file tilespec.c.
Referenced by tileset_load_tiles().
Return the path within the data directories where the main intro graphics file can be found. (It is left up to the GUI code to load and unload this file.)
Definition at line 973 of file tilespec.c.
Referenced by fc_client::create_main_page(), and create_main_page().
Return tileset name
Definition at line 7751 of file tilespec.c.
Referenced by anim_load(), boot_help_texts(), handle_map_info(), load_sprite(), scan_specfile(), tiles_lookup_sprite_tag_alt(), tileset_lookup_sprite_tags(), tileset_read_toplevel(), tileset_setup_base(), tileset_setup_citizen_types(), tileset_setup_city_tiles(), tileset_setup_extra(), tileset_setup_nation_flag(), tileset_setup_road(), tileset_setup_specialist_type(), tileset_setup_tile_type(), and tileset_setup_unit_type().
Return the number of possible colors for city overlays.
Definition at line 981 of file tilespec.c.
Referenced by fill_sprite_array().
Free tiles for one player using the player color.
Definition at line 7651 of file tilespec.c.
Referenced by tileset_free(), and tileset_player_init().
Setup tiles for one player using the player color.
Definition at line 7600 of file tilespec.c.
Referenced by handle_player_info(), and tilespec_reread().
|
static |
Finds and reads the toplevel tilespec file based on given name. Sets global variables, including tile sizes and full names for intro files. topology_id of -1 means any topology is acceptable.
Definition at line 1931 of file tilespec.c.
Referenced by tilespec_reread(), tilespec_try_read(), ts_cb(), and ts_list_cb().
Reset tileset data specific to ruleset.
Definition at line 7715 of file tilespec.c.
Referenced by handle_ruleset_control().
Returns tileset scale
Definition at line 953 of file tilespec.c.
|
static |
Scan single list of specfiles
Definition at line 1876 of file tilespec.c.
Referenced by tileset_read_toplevel().
|
static |
Set base sprite values; should only happen after tilespec_load_tiles().
Definition at line 4291 of file tilespec.c.
Referenced by tileset_setup_extra().
|
static |
Setup the graphics for (non-specialist) citizen types.
Definition at line 3170 of file tilespec.c.
Referenced by tileset_setup_citizen_types_default_set(), and tileset_setup_city_tiles().
Setup the graphics for (non-specialist) citizen types in default set.
Definition at line 3161 of file tilespec.c.
Referenced by tileset_lookup_sprite_tags().
Set city tiles sprite values; should only happen after tilespec_load_tiles().
Definition at line 6644 of file tilespec.c.
Referenced by handle_ruleset_city(), and tilespec_reread().
void tileset_setup_extra | ( | struct tileset * | t, |
struct extra_type * | pextra | ||
) |
Set extra sprite values; should only happen after tilespec_load_tiles().
Definition at line 4051 of file tilespec.c.
Referenced by handle_ruleset_extra(), and tilespec_reread().
void tileset_setup_government | ( | struct tileset * | t, |
struct government * | gov | ||
) |
Set government sprite value; should only happen after tilespec_load_tiles().
Definition at line 4592 of file tilespec.c.
Referenced by handle_ruleset_government(), and tilespec_reread().
Set improvement_type sprite value; should only happen after tilespec_load_tiles().
Definition at line 4016 of file tilespec.c.
Referenced by handle_ruleset_building(), and tilespec_reread().
void tileset_setup_nation_flag | ( | struct tileset * | t, |
struct nation_type * | nation | ||
) |
Set nation flag sprite value; should only happen after tilespec_load_tiles().
Definition at line 4607 of file tilespec.c.
Referenced by handle_ruleset_nation(), and tilespec_reread().
|
static |
Set road sprite values; should only happen after tilespec_load_tiles().
Definition at line 4183 of file tilespec.c.
Referenced by tileset_setup_extra().
|
static |
Setup the graphics for specialist types.
Definition at line 3077 of file tilespec.c.
Referenced by tileset_setup_city_tiles(), and tileset_setup_specialist_type_default_set().
void tileset_setup_specialist_type_default_set | ( | struct tileset * | t, |
Specialist_type_id | id | ||
) |
Setup the graphics for specialist types in the default sprite set.
Definition at line 3067 of file tilespec.c.
Referenced by handle_ruleset_specialist(), and tilespec_reread().
Set tech_type sprite value; should only happen after tilespec_load_tiles().
Definition at line 4032 of file tilespec.c.
Referenced by handle_ruleset_tech(), and tilespec_reread().
Set tile_type sprite values; should only happen after tilespec_load_tiles().
Definition at line 4326 of file tilespec.c.
Referenced by handle_ruleset_terrain(), and tilespec_reread().
|
static |
Helper function to load sprite for one unit orientation. Returns FALSE if a needed sprite was not found.
Definition at line 3861 of file tilespec.c.
Set unit_type sprite value; should only happen after tilespec_load_tiles().
Definition at line 3982 of file tilespec.c.
Referenced by handle_ruleset_unit(), and tilespec_reread().
|
static |
Try to setup all unit type sprites from single tag
Definition at line 3925 of file tilespec.c.
Referenced by tileset_setup_unit_type().
Return the small sprite height of the current tileset. The small sprites are used for various theme graphics (e.g., citymap citizens/specialists as well as panel indicator icons).
Definition at line 963 of file tilespec.c.
Referenced by city_dialog_update_citizens(), create_city_dialog(), extviewer_new(), and city_dialog::update_citizens().
Return the small sprite width of the current tileset. The small sprites are used for various theme graphics (e.g., citymap citizens/specialists as well as panel indicator icons).
Definition at line 927 of file tilespec.c.
Referenced by citizens_callback(), citizens_callback(), city_dialog_update_citizens(), create_city_dialog(), extviewer_new(), city_label::mousePressEvent(), refresh_feeling_surface(), refresh_feeling_surface(), and city_dialog::update_citizens().
Return tileset description summary
Definition at line 7767 of file tilespec.c.
Referenced by boot_help_texts().
Return tileset svg flag height
Definition at line 7799 of file tilespec.c.
Referenced by show_full_citybar().
Return the tile height of the current tileset. This is the tesselation height of the tiled plane. This means it's the height of the bounding box of the basic map tile.
See also tileset_tile_width().
Definition at line 791 of file tilespec.c.
Referenced by anchor_selection_rectangle(), battle_animation(), info_tile::calc_size(), can_do_cached_drawing(), canvas_to_city_pos(), center_tile_mapcanvas(), city_to_canvas_pos(), create_extra_pixbuf(), create_pixbuf_from_layers(), create_terrain_pixbuf(), create_tool_value_selector(), decrease_unit_hp_smooth(), define_tiles_within_rectangle(), draw_calculated_trade_routes(), draw_segment(), draw_trade_route_line(), editor_end_selection_rectangle(), explosion_animation(), generate_citydlg_dimensions(), get_mapview_scroll_step(), get_mapview_scroll_window(), gui_to_map_pos(), gui_to_natural_pos(), gui_to_overview(), link_mark_draw(), map_canvas_resized(), map_to_gui_vector(), move_unit_map_canvas(), movement_animation(), nuke_animation(), objprop_setup_widget(), popit(), popup_terrain_info_dialog(), popupinfo_positioning_callback(), put_city(), put_nuke_mushroom_pixmaps(), put_terrain(), put_unit(), put_unittype(), put_window_near_map_tile(), mr_menu::save_image(), select_tgt_extra(), set_help_tile_from_extra(), set_help_tile_from_terrain(), help_widget::set_topic_extra(), terrain_canvas(), tile_to_canvas_pos(), tile_visible_and_not_on_border_mapcanvas(), tileset_read_toplevel(), unqueue_mapview_updates(), hud_units::update_actions(), update_map_canvas(), and update_selection_rectangle().
Return the tile width of the current tileset. This is the tesselation width of the tiled plane. This means it's the width of the bounding box of the basic map tile.
For best results:
Definition at line 779 of file tilespec.c.
Referenced by anchor_selection_rectangle(), battle_animation(), can_do_cached_drawing(), canvas_to_city_pos(), center_tile_mapcanvas(), city_to_canvas_pos(), create_extra_pixbuf(), create_terrain_pixbuf(), decrease_unit_hp_smooth(), define_tiles_within_rectangle(), draw_calculated_trade_routes(), draw_segment(), draw_trade_route_line(), editor_end_selection_rectangle(), explosion_animation(), generate_citydlg_dimensions(), get_mapview_scroll_step(), get_mapview_scroll_window(), gui_to_map_pos(), gui_to_natural_pos(), gui_to_overview(), link_mark_draw(), map_canvas_resized(), map_to_gui_vector(), nuke_animation(), objprop_setup_widget(), populate_unit_image_table(), populate_unit_pic_table(), popup_hurry_production_dialog(), popupinfo_positioning_callback(), put_nuke_mushroom_pixmaps(), put_window_near_map_tile(), mr_menu::save_image(), select_tgt_extra(), set_help_tile_from_extra(), set_help_tile_from_terrain(), set_unit_icon(), show_city_descriptions(), show_full_citybar(), show_small_citybar(), show_tile_label(), show_tile_labels(), tile_to_canvas_pos(), tile_visible_and_not_on_border_mapcanvas(), unqueue_mapview_updates(), and update_selection_rectangle().
Return the offset from the origin of the tile at which to place the label text.
Definition at line 945 of file tilespec.c.
Referenced by show_tile_label().
Return tileset topology index
Definition at line 7791 of file tilespec.c.
Referenced by tilespec_reread_callback(), tilespec_try_read(), and ts_cb().
Return the unit tile height of the current tileset.
Definition at line 831 of file tilespec.c.
Referenced by hud_battle_log::add_combat_info(), battle_animation(), city_dialog::city_dialog(), units_select::create_pixmap(), hud_unit_combat::init_images(), move_unit_map_canvas(), movement_animation(), choice_dialog::next_unit(), hud_unit_combat::paintEvent(), choice_dialog::prev_unit(), put_unit(), put_unittype(), select_tgt_extra(), select_tgt_unit(), choice_dialog::set_layout(), tileset_unit_with_small_upkeep_height(), tileset_unit_with_upkeep_height(), unit_item::unit_item(), unqueue_mapview_updates(), hud_units::update_actions(), and hud_battle_log::update_size().
Offset to layout extra unit sprites, such as upkeep.
Definition at line 908 of file tilespec.c.
Referenced by put_unit_image_city_overlays(), put_unit_picture_city_overlays(), tileset_unit_with_upkeep_height(), and unit_item::unit_item().
Offset to layout extra unit sprites, such as upkeep, requesting small space layout.
Definition at line 917 of file tilespec.c.
Referenced by create_unit_surface(), and tileset_unit_with_small_upkeep_height().
Return the unit tile width of the current tileset.
Definition at line 823 of file tilespec.c.
Referenced by units_select::create_pixmap(), hud_unit_combat::init_images(), move_unit_map_canvas(), choice_dialog::next_unit(), choice_dialog::prev_unit(), select_tgt_extra(), select_tgt_unit(), choice_dialog::set_layout(), unit_item::unit_item(), unqueue_mapview_updates(), hud_units::update_actions(), and unit_info::update_units().
Suitable canvas height for a unit icon that includes upkeep sprites, using small space layout.
Definition at line 897 of file tilespec.c.
Referenced by create_unit_surface().
Suitable canvas height for a unit icon that includes upkeep sprites.
Definition at line 885 of file tilespec.c.
Referenced by city_dialog::city_dialog(), city_dialog_update_supported_units(), create_and_append_overview_page(), and unit_item::unit_item().
Get the height of a unit upkeep icons.
Definition at line 876 of file tilespec.c.
Referenced by tileset_unit_with_small_upkeep_height(), and tileset_unit_with_upkeep_height().
Return TRUE if the client will use the code to generate the fog.
Definition at line 989 of file tilespec.c.
Loads preferred theme if there's any.
Definition at line 7293 of file tilespec.c.
Referenced by activate_gui(), tilespec_reread(), ui_main(), and ui_main().
Return what ruleset this tileset is primarily meant for
Definition at line 7783 of file tilespec.c.
Referenced by client_start_server().
Gets full filename for tilespec file, based on input name. Returned data is allocated, and freed by user as required. Input name may be null, in which case uses default. Falls back to default if can't find specified name; dies if can't find default.
Definition at line 1181 of file tilespec.c.
Referenced by tileset_read_toplevel().
Returns the correct name of the gfx file (with path and extension) Must be free'd when no longer used
Definition at line 1845 of file tilespec.c.
Referenced by tileset_read_toplevel().
Read a new tilespec in from scratch.
Unlike the initial reading code, which reads pieces one at a time, this gets rid of the old data and reads in the new all at once. If the new tileset fails to load the old tileset may be reloaded; otherwise the client will exit. If a NULL name is given the current tileset will be reread.
It will also call the necessary functions to redraw the graphics.
Returns TRUE iff new tileset has been successfully loaded.
Definition at line 1401 of file tilespec.c.
Referenced by handle_ruleset_control(), mr_menu::load_new_tileset(), popup_tileset_suggestion_dialog(), reload_tileset_callback(), map_view::shortcut_pressed(), tileset_suggestion_callback(), tileset_suggestion_response(), tilespec_reread_callback(), tilespec_reread_frozen_refresh(), mr_menu::zoom_in(), mr_menu::zoom_out(), and mr_menu::zoom_reset().
This is merely a wrapper for tilespec_reread() (above) for use in options.c and the client local options dialog.
Definition at line 1555 of file tilespec.c.
Read a new tilespec in from scratch. Keep UI frozen while tileset is partially loaded; in inconsistent state.
See tilespec_reread() for details.
Definition at line 1591 of file tilespec.c.
Referenced by handle_set_topology().
bool tilespec_try_read | ( | const char * | tileset_name, |
bool | verbose, | ||
int | topo_id, | ||
bool | global_default | ||
) |
Read a new tilespec in when first starting the game.
Call this function with the (guessed) name of the tileset, when starting the client.
Returns TRUE iff tileset with suggested tileset_name was loaded.
Definition at line 1360 of file tilespec.c.
Referenced by default_tileset_select().
Toggle/increment the focus unit state. This should be called once every get_focus_unit_toggle_timeout() seconds.
Definition at line 6743 of file tilespec.c.
Referenced by blink_active_unit().
Callback called from modpack tileset cache iteration.
Definition at line 1332 of file tilespec.c.
Referenced by tilespec_try_read().
Callback called from modpack tileset cache iteration.
Definition at line 1133 of file tilespec.c.
Referenced by get_tileset_list().
Convert properties of the actual topology to an index of different tileset topology types.
Definition at line 1089 of file tilespec.c.
Referenced by get_tileset_list(), and tileset_read_toplevel().
Indicate whether a unit is to be drawn with a surrounding city outline under current conditions. (This includes being in focus, but if the caller has already checked that, they can bypass this slightly expensive check with check_focus FALSE.)
Definition at line 5698 of file tilespec.c.
Referenced by fill_grid_sprite_array(), handle_unit_packet_common(), and refresh_unit_mapcanvas().
This patch unloads all sprites from the sprite hash (the hash itself is left intact).
Definition at line 6792 of file tilespec.c.
Referenced by tileset_free_tiles().
Unload sprite from popup image tag
Definition at line 7815 of file tilespec.c.
Referenced by popup_image(), and qtg_popup_image().
Unloads the sprite. Decrease the reference counter. If the last reference is removed the sprite is freed.
Definition at line 2876 of file tilespec.c.
Referenced by unload_all_sprites(), and unload_popup_sprite().
Do the same thing as cardinal_str, except including all valid directions. The returned string is a pointer to static memory.
Definition at line 2735 of file tilespec.c.
Referenced by tileset_setup_road().
Definition at line 146 of file tilespec.c.
Referenced by fill_terrain_sprite_array(), fill_terrain_sprite_blending(), and fill_terrain_sprite_darkness().
Definition at line 142 of file tilespec.c.
Referenced by tileset_setup_tile_type().
|
static |
Definition at line 144 of file tilespec.c.
Referenced by tileset_lookup_sprite_tags().
Definition at line 594 of file tilespec.c.
Referenced by get_drawable_unit(), reset_focus_unit_state(), and toggle_focus_unit_state().
|
static |
Definition at line 598 of file tilespec.c.
Referenced by advance_global_anim_state(), and anim_get_current_frame().
Definition at line 596 of file tilespec.c.
Referenced by tileset_is_fully_loaded(), tilespec_reread_callback(), and tilespec_reread_frozen_refresh().
Definition at line 592 of file tilespec.c.
Referenced by city_dialog_redraw_map(), client_exit(), get_tileset(), tilespec_reread(), unit_item::unit_item(), and hud_units::update_actions().