Freeciv21
Develop your civilization from humble roots to a global empire
tilespec.h File Reference
#include "layer.h"
#include "options.h"
#include <QColor>
#include <QEvent>
#include <map>
#include "specenum_gen.h"
+ Include dependency graph for tilespec.h:

Go to the source code of this file.

Classes

struct  tileset_log_entry
 
struct  tileset_option
 Tileset options allow altering the behavior of a tileset. More...
 
struct  citybar_sprites
 
struct  editor_sprites
 

Namespaces

 freeciv
 

Macros

#define SPECENUM_NAME   ts_type
 
#define SPECENUM_VALUE0   TS_OVERHEAD
 
#define SPECENUM_VALUE0NAME   N_("Overhead")
 
#define SPECENUM_VALUE1   TS_ISOMETRIC
 
#define SPECENUM_VALUE1NAME   N_("Isometric")
 
#define NUM_TILES_PROGRESS   8
 
#define NUM_CORNER_DIRS   4
 
#define MAX_NUM_CITIZEN_SPRITES   6
 
#define NUM_CURSOR_FRAMES   6
 
#define TS_TOPO_SQUARE   0
 
#define TS_TOPO_HEX   1
 
#define TS_TOPO_ISOHEX   2
 

Enumerations

enum  arrow_type { ARROW_RIGHT , ARROW_PLUS , ARROW_MINUS , ARROW_LAST }
 
enum  direction4 { DIR4_NORTH = 0 , DIR4_SOUTH , DIR4_EAST , DIR4_WEST }
 
enum  cursor_type {
  CURSOR_GOTO , CURSOR_PATROL , CURSOR_PARADROP , CURSOR_NUKE ,
  CURSOR_SELECT , CURSOR_INVALID , CURSOR_ATTACK , CURSOR_EDIT_PAINT ,
  CURSOR_EDIT_ADD , CURSOR_WAIT , CURSOR_LAST , CURSOR_DEFAULT
}
 
enum  indicator_type { INDICATOR_BULB , INDICATOR_WARMING , INDICATOR_COOLING , INDICATOR_COUNT }
 
enum  spaceship_part {
  SPACESHIP_SOLAR_PANEL , SPACESHIP_LIFE_SUPPORT , SPACESHIP_HABITATION , SPACESHIP_STRUCTURAL ,
  SPACESHIP_FUEL , SPACESHIP_PROPULSION , SPACESHIP_EXHAUST , SPACESHIP_COUNT
}
 

Functions

void tilespec_init ()
 Initializes the tilespec system. More...
 
const QVector< QString > * get_tileset_list (const struct option *poption)
 Returns a static list of tilesets available on the system by searching all data directories for files matching TILESPEC_SUFFIX. More...
 
void tileset_error (struct tileset *t, QtMsgType level, const char *format,...)
 Called when ever there's problem in ruleset/tileset compatibility. More...
 
void tileset_init (struct tileset *t)
 Initialize tileset structure. More...
 
void tileset_free (struct tileset *tileset)
 Clean up. More...
 
void tileset_load_tiles (struct tileset *t)
 Load the tiles; requires tilespec_read_toplevel() called previously. More...
 
void tileset_free_tiles (struct tileset *t)
 Free all sprites from tileset. More...
 
void tileset_ruleset_reset (struct tileset *t)
 Reset tileset data specific to ruleset. More...
 
bool tileset_is_fully_loaded ()
 Is tileset in sane state? More...
 
std::vector< tileset_log_entrytileset_log (const struct tileset *t)
 Get tileset log (warnings, errors, etc.) More...
 
bool tileset_has_error (const struct tileset *t)
 Checks if the tileset had any error message (LOG_ERROR). More...
 
bool tileset_has_options (const struct tileset *t)
 Checks if the tileset has any user-settable options. More...
 
bool tileset_has_option (const struct tileset *t, const QString &name)
 Checks if the tileset has supports the given user-settable option. More...
 
std::map< QString, tileset_optiontileset_get_options (const struct tileset *t)
 Gets the user-settable options of the tileset. More...
 
bool tileset_option_is_enabled (const struct tileset *t, const QString &name)
 Checks if an user-settable tileset option is enabled. More...
 
bool tileset_set_option (struct tileset *t, const QString &name, bool enabled)
 Enable or disable a user-settable tileset option. More...
 
void finish_loading_sprites (struct tileset *t)
 Frees any internal buffers which are created by load_sprite. More...
 
bool tilespec_try_read (const QString &name, bool verbose, int topo_id)
 Read a new tilespec in when first starting the game. More...
 
bool tilespec_reread (const QString &tileset_name, bool game_fully_initialized)
 Read a new tilespec in from scratch. More...
 
void tilespec_reread_callback (struct option *poption)
 This is merely a wrapper for tilespec_reread (above) for use in options.c and the client local options dialog. More...
 
void tilespec_reread_frozen_refresh (const QString &name)
 Read a new tilespec in from scratch. More...
 
void assign_digit_sprites (struct tileset *t, QPixmap *units[NUM_TILES_DIGITS], QPixmap *tens[NUM_TILES_DIGITS], QPixmap *hundreds[NUM_TILES_DIGITS], const QStringList &patterns)
 Assigns the digits for city or go-to orders, for units, tens, and hundreds (i.e. More...
 
void tileset_setup_specialist_type (struct tileset *t, Specialist_type_id id)
 Setup the graphics for specialist types. More...
 
void tileset_setup_unit_type (struct tileset *t, struct unit_type *punittype)
 Set unit_type sprite value; should only happen after tilespec_load_tiles(). More...
 
void tileset_setup_impr_type (struct tileset *t, struct impr_type *pimprove)
 Set improvement_type sprite value; should only happen after tilespec_load_tiles(). More...
 
void tileset_setup_tech_type (struct tileset *t, struct advance *padvance)
 Set tech_type sprite value; should only happen after tilespec_load_tiles(). More...
 
void tileset_setup_tile_type (struct tileset *t, const struct terrain *pterrain)
 Set tile_type sprite values; should only happen after tilespec_load_tiles(). More...
 
QStringList make_tag_terrain_list (const QString &prefix, const QString &suffix, const struct terrain *pterrain)
 Make the list of possible tag names for the extras which may vary depending on the terrain they're on. More...
 
void tileset_setup_extra (struct tileset *t, struct extra_type *pextra)
 Set extra sprite values; should only happen after tilespec_load_tiles(). More...
 
void tileset_setup_government (struct tileset *t, struct government *gov)
 Set government sprite value; should only happen after tilespec_load_tiles(). More...
 
void tileset_setup_nation_flag (struct tileset *t, struct nation_type *nation)
 Set nation flag sprite value; should only happen after tilespec_load_tiles(). More...
 
void tileset_setup_city_tiles (struct tileset *t, int style)
 Set city tiles sprite values; should only happen after tilespec_load_tiles(). More...
 
void tileset_player_init (struct tileset *t, struct player *pplayer)
 Setup tiles for one player using the player color. More...
 
const std::vector< std::unique_ptr< freeciv::layer > > & tileset_get_layers (const struct tileset *t)
 
QPixmap * load_sprite (struct tileset *t, const QStringList &possible_names, bool required, bool verbose=true)
 Finds the first sprite matching a list of possible names and returns it. More...
 
std::vector< drawn_spritefill_basic_terrain_layer_sprite_array (struct tileset *t, int layer, struct terrain *pterrain)
 Fill the sprite array with sprites that together make a representative image of the given terrain type. More...
 
const freeciv::layer_citytileset_layer_city (const struct tileset *t)
 Returns the layer_city of the tileset. More...
 
int get_focus_unit_toggle_timeout (const struct tileset *t)
 Return the amount of time between calls to toggle_focus_unit_state. More...
 
void reset_focus_unit_state (struct tileset *t)
 Reset the focus unit state. More...
 
void focus_unit_in_combat (struct tileset *t)
 Setup tileset for showing combat where focus unit participates. More...
 
void toggle_focus_unit_state (struct tileset *t)
 Toggle/increment the focus unit state. More...
 
struct unitget_drawable_unit (const struct tileset *t, const ::tile *ptile)
 Find unit that we can display from given tile. More...
 
bool unit_drawn_with_city_outline (const struct unit *punit, bool check_focus)
 Indicate whether a unit is to be drawn with a surrounding city outline under current conditions. More...
 
const QPixmap * get_spaceship_sprite (const struct tileset *t, enum spaceship_part part)
 Return the sprite for drawing the given spaceship part. More...
 
const QPixmap * 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. More...
 
const QPixmap * get_city_flag_sprite (const struct tileset *t, const struct city *pcity)
 Return the flag graphic to be used by the city. More...
 
void build_tile_data (const struct tile *ptile, struct terrain *pterrain, struct terrain **tterrain_near, bv_extras *textras_near)
 Assemble some data that is used in building the tile sprite arrays. More...
 
QPixmap * get_unit_nation_flag_sprite (const struct tileset *t, const struct unit *punit)
 Return a sprite for the national flag for this unit. More...
 
const QPixmap * get_activity_sprite (const struct tileset *t, enum unit_activity activity, extra_type *target)
 
const QPixmap * get_nation_flag_sprite (const struct tileset *t, const struct nation_type *nation)
 Return the sprite for the nation. More...
 
const QPixmap * get_nation_shield_sprite (const struct tileset *t, const struct nation_type *nation)
 Return the shield sprite for the nation. More...
 
const QPixmap * get_tech_sprite (const struct tileset *t, Tech_type_id tech)
 Return the sprite for the technology/advance. More...
 
const QPixmap * get_building_sprite (const struct tileset *t, const struct impr_type *pimprove)
 Return the sprite for the building/improvement. More...
 
const QPixmap * get_government_sprite (const struct tileset *t, const struct government *gov)
 Return the sprite for the government. More...
 
const QPixmap * get_unittype_sprite (const struct tileset *t, const struct unit_type *punittype, enum direction8 facing, const QColor &replace=QColor())
 Return the sprite for the unit type (the base "unit" sprite). More...
 
const QPixmap * get_sample_city_sprite (const struct tileset *t, int style_idx)
 
const QPixmap * get_tax_sprite (const struct tileset *t, Output_type_id otype)
 Return a tax sprite for the given output type (usually gold/lux/sci). More...
 
const QPixmap * get_treaty_thumb_sprite (const struct tileset *t, bool on_off)
 Return a thumbs-up/thumbs-down sprite to show treaty approval or disapproval. More...
 
const std::vector< QPixmap * > & get_unit_explode_animation (const struct tileset *t)
 Return a sprite_vector containing the animation sprites for a unit explosion. More...
 
const QPixmap * get_nuke_explode_sprite (const struct tileset *t)
 Return a sprite contining the single nuke graphic. More...
 
const QPixmap * 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. More...
 
const struct citybar_spritesget_citybar_sprites (const struct tileset *t)
 Return all the sprites used for city bar drawing. More...
 
const struct editor_spritesget_editor_sprites (const struct tileset *t)
 Return all the sprites used for editor icons, images, etc. More...
 
const QPixmap * get_attention_crosshair_sprite (const struct tileset *t)
 Returns a sprite with the "user-attention" crosshair graphic. More...
 
const QPixmap * get_indicator_sprite (const struct tileset *t, enum indicator_type indicator, int index)
 Returns a sprite for the given indicator with the given index. More...
 
const QPixmap * 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. More...
 
const QPixmap * 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. More...
 
std::vector< drawn_spritefill_basic_extra_sprite_array (const struct tileset *t, const struct extra_type *pextra)
 Return a representative sprite for the given extra type. More...
 
bool is_extra_drawing_enabled (const extra_type *pextra)
 Should the given extra be drawn FIXME: Some extras can not be switched. More...
 
const QPixmap * get_event_sprite (const struct tileset *t, enum event_type event)
 Return event icon sprite. More...
 
const QPixmap * get_dither_sprite (const struct tileset *t)
 Return dither sprite. More...
 
const QPixmap * get_mask_sprite (const struct tileset *t)
 Return tile mask sprite. More...
 
QPixmap * tiles_lookup_sprite_tag_alt (struct tileset *t, QtMsgType level, const char *tag, const char *alt, const char *what, const char *name, bool scale)
 Lookup sprite to match tag, or else to match alt if don't find, or else return nullptr, and emit log message. More...
 
struct color_systemget_color_system (const struct tileset *t)
 Return the tileset's color system. More...
 
struct tilesetget_tileset ()
 Returns the tileset. More...
 
const char * tileset_basename (const struct tileset *t)
 Return the name of the given tileset. More...
 
bool tileset_is_isometric (const struct tileset *t)
 Return whether the current tileset is isometric. More...
 
int tileset_hex_width (const struct tileset *t)
 Return the hex_width of the current tileset. More...
 
int tileset_hex_height (const struct tileset *t)
 Return the hex_height of the current tileset. More...
 
int tileset_tile_width (const struct tileset *t)
 Return the tile width of the current tileset. More...
 
int tileset_tile_height (const struct tileset *t)
 Return the tile height of the current tileset. More...
 
int tileset_full_tile_width (const struct tileset *t)
 Return the full tile width of the current tileset. More...
 
int tileset_full_tile_height (const struct tileset *t)
 Return the full tile height of the current tileset. More...
 
QPoint tileset_full_tile_offset (const struct tileset *t)
 Return the x and y offsets of full tiles in the tileset. More...
 
int tileset_unit_width (const struct tileset *t)
 Return the unit tile width of the current tileset. More...
 
int tileset_unit_height (const struct tileset *t)
 Return the unit tile height of the current tileset. More...
 
int tileset_unit_with_upkeep_height (const struct tileset *t)
 Suitable canvas height for a unit icon that includes upkeep sprites. More...
 
int tileset_unit_layout_offset_y (const struct tileset *t)
 Offset to layout extra unit sprites, such as upkeep. More...
 
int tileset_small_sprite_width (const struct tileset *t)
 Return the small sprite width of the current tileset. More...
 
int tileset_small_sprite_height (const struct tileset *t)
 Return the small sprite height of the current tileset. More...
 
int tileset_citybar_offset_y (const struct tileset *t)
 Return the offset from the origin of the city tile at which to place the city bar text. More...
 
int tileset_tilelabel_offset_y (const struct tileset *t)
 Return the offset from the origin of the tile at which to place the label text. More...
 
bool tileset_use_hard_coded_fog (const struct tileset *t)
 Return TRUE if the client will use the code to generate the fog. More...
 
double tileset_preferred_scale (const struct tileset *t)
 Returns the preferred scale (zoom level) of the tileset. More...
 
int tileset_replaced_hue (const struct tileset *t)
 Returns the hue (color) that should be replaced with the player color in player-dependent sprites. More...
 
int tileset_num_cardinal_dirs (const struct tileset *t)
 Returns the number of cardinal directions used by the tileset. More...
 
int tileset_num_index_cardinals (const struct tileset *t)
 Returns the number of cardinal indices used by the tileset. More...
 
std::array< direction8, 8 > tileset_cardinal_dirs (const struct tileset *t)
 Returns the cardinal directions used by the tileset. More...
 
int tileset_num_valid_dirs (const struct tileset *t)
 Returns the number of valid directions in the tileset. More...
 
std::array< direction8, 8 > tileset_valid_dirs (const struct tileset *t)
 Returns the valid directions for the tileset. More...
 
QString cardinal_index_str (const struct tileset *t, int idx)
 Return a directional string for the cardinal directions. More...
 
QString valid_index_str (const struct tileset *t, int idx)
 Do the same thing as cardinal_str, except including all valid directions. More...
 
QString dir_get_tileset_name (enum direction8 dir)
 Return the tileset name of the direction. More...
 
bool is_cardinal_tileset_dir (const struct tileset *t, enum direction8 dir)
 Return TRUE iff the dir is cardinal in this tileset. More...
 
const char * tileset_name_get (const struct tileset *t)
 Return tileset name. More...
 
const char * tileset_version (const struct tileset *t)
 Return tileset version. More...
 
const char * tileset_summary (const struct tileset *t)
 Return tileset description summary. More...
 
const char * tileset_description (const struct tileset *t)
 Return tileset description body. More...
 
int tileset_topo_index (const struct tileset *t)
 Return tileset topology index. More...
 
help_itemtileset_help (const struct tileset *t)
 Creates the help item for the given tileset. More...
 

Variables

constexpr direction8 DIR4_TO_DIR8 [4]
 
struct tilesettileset
 
QEvent::Type TilesetChanged
 An event type sent to all widgets when the current tileset changes. More...
 

Macro Definition Documentation

◆ MAX_NUM_CITIZEN_SPRITES

#define MAX_NUM_CITIZEN_SPRITES   6

Definition at line 46 of file tilespec.h.

◆ NUM_CORNER_DIRS

#define NUM_CORNER_DIRS   4

Definition at line 44 of file tilespec.h.

◆ NUM_CURSOR_FRAMES

#define NUM_CURSOR_FRAMES   6

Definition at line 169 of file tilespec.h.

◆ NUM_TILES_PROGRESS

#define NUM_TILES_PROGRESS   8

Definition at line 43 of file tilespec.h.

◆ SPECENUM_NAME

#define SPECENUM_NAME   ts_type

Definition at line 36 of file tilespec.h.

◆ SPECENUM_VALUE0

#define SPECENUM_VALUE0   TS_OVERHEAD

Definition at line 37 of file tilespec.h.

◆ SPECENUM_VALUE0NAME

#define SPECENUM_VALUE0NAME   N_("Overhead")

Definition at line 38 of file tilespec.h.

◆ SPECENUM_VALUE1

#define SPECENUM_VALUE1   TS_ISOMETRIC

Definition at line 39 of file tilespec.h.

◆ SPECENUM_VALUE1NAME

#define SPECENUM_VALUE1NAME   N_("Isometric")

Definition at line 40 of file tilespec.h.

◆ TS_TOPO_HEX

#define TS_TOPO_HEX   1

Definition at line 306 of file tilespec.h.

◆ TS_TOPO_ISOHEX

#define TS_TOPO_ISOHEX   2

Definition at line 307 of file tilespec.h.

◆ TS_TOPO_SQUARE

#define TS_TOPO_SQUARE   0

Definition at line 305 of file tilespec.h.

Enumeration Type Documentation

◆ arrow_type

enum arrow_type
Enumerator
ARROW_RIGHT 
ARROW_PLUS 
ARROW_MINUS 
ARROW_LAST 

Definition at line 48 of file tilespec.h.

◆ cursor_type

Enumerator
CURSOR_GOTO 
CURSOR_PATROL 
CURSOR_PARADROP 
CURSOR_NUKE 
CURSOR_SELECT 
CURSOR_INVALID 
CURSOR_ATTACK 
CURSOR_EDIT_PAINT 
CURSOR_EDIT_ADD 
CURSOR_WAIT 
CURSOR_LAST 
CURSOR_DEFAULT 

Definition at line 154 of file tilespec.h.

◆ direction4

enum direction4
Enumerator
DIR4_NORTH 
DIR4_SOUTH 
DIR4_EAST 
DIR4_WEST 

Definition at line 51 of file tilespec.h.

◆ indicator_type

Enumerator
INDICATOR_BULB 
INDICATOR_WARMING 
INDICATOR_COOLING 
INDICATOR_COUNT 

Definition at line 171 of file tilespec.h.

◆ spaceship_part

Enumerator
SPACESHIP_SOLAR_PANEL 
SPACESHIP_LIFE_SUPPORT 
SPACESHIP_HABITATION 
SPACESHIP_STRUCTURAL 
SPACESHIP_FUEL 
SPACESHIP_PROPULSION 
SPACESHIP_EXHAUST 
SPACESHIP_COUNT 

Definition at line 178 of file tilespec.h.

Function Documentation

◆ assign_digit_sprites()

void assign_digit_sprites ( struct tileset t,
QPixmap *  units[NUM_TILES_DIGITS],
QPixmap *  tens[NUM_TILES_DIGITS],
QPixmap *  hundreds[NUM_TILES_DIGITS],
const QStringList &  patterns 
)

Assigns the digits for city or go-to orders, for units, tens, and hundreds (i.e.

up to 999)

Definition at line 2408 of file tilespec.cpp.

Referenced by freeciv::layer_city_size::load_sprites(), and freeciv::layer_goto::load_sprites().

◆ build_tile_data()

void build_tile_data ( const struct tile ptile,
struct terrain pterrain,
struct terrain **  tterrain_near,
bv_extras *  textras_near 
)

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 tspecial_near : specials of all adjacent terrain

Definition at line 3080 of file tilespec.cpp.

Referenced by freeciv::layer_roads::fill_corners(), freeciv::layer_terrain::fill_sprite_array(), and freeciv::layer_water::fill_sprite_array().

◆ cardinal_index_str()

QString cardinal_index_str ( const struct tileset t,
int  idx 
)

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 2233 of file tilespec.cpp.

Referenced by freeciv::layer_terrain::initialize_cell_whole_match_same(), freeciv::layer_water::initialize_extra(), and freeciv::layer_darkness::load_sprites().

◆ dir_get_tileset_name()

QString dir_get_tileset_name ( enum direction8  dir)

◆ fill_basic_extra_sprite_array()

std::vector<drawn_sprite> fill_basic_extra_sprite_array ( const struct tileset t,
const struct extra_type pextra 
)

Return a representative sprite for the given extra type.

Definition at line 3679 of file tilespec.cpp.

Referenced by help_dialog::make_tree(), and terrain_canvas().

◆ fill_basic_terrain_layer_sprite_array()

std::vector<drawn_sprite> fill_basic_terrain_layer_sprite_array ( struct tileset t,
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 3642 of file tilespec.cpp.

Referenced by terrain_canvas().

◆ finish_loading_sprites()

void finish_loading_sprites ( struct tileset t)

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 2698 of file tilespec.cpp.

Referenced by handle_rulesets_ready(), and tileset_load_tiles().

◆ focus_unit_in_combat()

void focus_unit_in_combat ( struct tileset t)

Setup tileset for showing combat where focus unit participates.

Definition at line 3221 of file tilespec.cpp.

Referenced by set_units_in_combat().

◆ get_activity_sprite()

const QPixmap* get_activity_sprite ( const struct tileset t,
enum unit_activity  activity,
extra_type target 
)

◆ get_attention_crosshair_sprite()

const QPixmap* get_attention_crosshair_sprite ( const struct tileset t)

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 3557 of file tilespec.cpp.

Referenced by draw_calculated_trade_routes(), freeciv::layer_overlays::fill_sprite_array(), and put_cross_overlay_tile().

◆ get_building_sprite()

◆ get_citizen_sprite()

const QPixmap* 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 nullptr value indicates there is no city; i.e., the sprite is just being used as a picture).

Definition at line 3337 of file tilespec.cpp.

Referenced by client_government_sprite(), and city_dialog::fill_citizens_pixmap().

◆ get_city_flag_sprite()

const QPixmap* get_city_flag_sprite ( const struct tileset t,
const struct city pcity 
)

Return the flag graphic to be used by the city.

Definition at line 3052 of file tilespec.cpp.

Referenced by freeciv::layer_city::fill_sprite_array(), traditional_citybar_painter::paint(), and polished_citybar_painter::paint().

◆ get_citybar_sprites()

const struct citybar_sprites* get_citybar_sprites ( const struct tileset t)

Return all the sprites used for city bar drawing.

Definition at line 3523 of file tilespec.cpp.

Referenced by help_widget::create_terrain_widget(), traditional_citybar_painter::paint(), and polished_citybar_painter::paint().

◆ get_color_system()

struct color_system* get_color_system ( const struct tileset t)

Return the tileset's color system.

Definition at line 3622 of file tilespec.cpp.

Referenced by get_color().

◆ get_cursor_sprite()

const QPixmap* 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 3542 of file tilespec.cpp.

Referenced by fc_client::create_cursors().

◆ get_dither_sprite()

const QPixmap* get_dither_sprite ( const struct tileset t)

Return dither sprite.

Definition at line 3478 of file tilespec.cpp.

Referenced by freeciv::layer_terrain::initialize_blending().

◆ get_drawable_unit()

struct unit* get_drawable_unit ( const struct tileset t,
const ::tile ptile 
)

Find unit that we can display from given tile.

Definition at line 3246 of file tilespec.cpp.

Referenced by put_one_tile(), and freeciv::tileset_debugger::set_tile().

◆ get_editor_sprites()

const struct editor_sprites* get_editor_sprites ( const struct tileset t)

Return all the sprites used for editor icons, images, etc.

Definition at line 3531 of file tilespec.cpp.

Referenced by editor_get_mode_sprite(), and editor_tool_get_sprite().

◆ get_event_sprite()

const QPixmap* get_event_sprite ( const struct tileset t,
enum event_type  event 
)

Return event icon sprite.

Definition at line 3469 of file tilespec.cpp.

Referenced by message_widget::msg().

◆ get_focus_unit_toggle_timeout()

int get_focus_unit_toggle_timeout ( const struct tileset t)

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 3200 of file tilespec.cpp.

Referenced by blink_active_unit().

◆ get_government_sprite()

const QPixmap* get_government_sprite ( const struct tileset t,
const struct government gov 
)

Return the sprite for the government.

Definition at line 3404 of file tilespec.cpp.

Referenced by client_government_sprite(), plr_item::data(), draw_reqtree(), help_dialog::make_tree(), node_rectangle_minimum_size(), and gov_menu::update().

◆ get_indicator_sprite()

const QPixmap* 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 3566 of file tilespec.cpp.

Referenced by client_cooling_sprite(), client_research_sprite(), and client_warming_sprite().

◆ get_mask_sprite()

◆ get_nation_flag_sprite()

◆ get_nation_shield_sprite()

const QPixmap* get_nation_shield_sprite ( const struct tileset t,
const struct nation_type nation 
)

Return the shield sprite for the nation.

Definition at line 3376 of file tilespec.cpp.

Referenced by pregame_options::update_buttons().

◆ get_nuke_explode_sprite()

const QPixmap* get_nuke_explode_sprite ( const struct tileset t)

Return a sprite contining the single nuke graphic.

TODO: This should be an animation like the unit explode animation.

Definition at line 3515 of file tilespec.cpp.

Referenced by put_nuke_mushroom_pixmaps().

◆ get_sample_city_sprite()

const QPixmap* get_sample_city_sprite ( const struct tileset t,
int  style_idx 
)

◆ get_spaceship_sprite()

const QPixmap* get_spaceship_sprite ( const struct tileset t,
enum spaceship_part  part 
)

Return the sprite for drawing the given spaceship part.

Definition at line 3324 of file tilespec.cpp.

◆ get_tax_sprite()

const QPixmap* get_tax_sprite ( const struct tileset t,
Output_type_id  otype 
)

Return a tax sprite for the given output type (usually gold/lux/sci).

Definition at line 3448 of file tilespec.cpp.

Referenced by national_budget_widget::paintEvent(), national_budget_dialog::refresh(), and national_budget_widget::sizeHint().

◆ get_tech_sprite()

const QPixmap* get_tech_sprite ( const struct tileset t,
Tech_type_id  tech 
)

Return the sprite for the technology/advance.

Definition at line 3385 of file tilespec.cpp.

Referenced by help_dialog::make_tree(), progress_bar::set_pixmap(), help_widget::set_topic_tech(), top_bar_right_click_science(), and science_report::update_report().

◆ get_tileset()

◆ get_tileset_list()

const QVector<QString>* get_tileset_list ( const struct option poption)

Returns a static list of tilesets available on the system by searching all data directories for files matching TILESPEC_SUFFIX.

Definition at line 725 of file tilespec.cpp.

Referenced by init_client_options(), and mr_menu::tileset_custom_load().

◆ get_treaty_thumb_sprite()

const QPixmap* get_treaty_thumb_sprite ( const struct tileset t,
bool  on_off 
)

Return a thumbs-up/thumbs-down sprite to show treaty approval or disapproval.

Definition at line 3495 of file tilespec.cpp.

Referenced by diplo_wdg::update_wdg().

◆ get_unit_explode_animation()

const std::vector<QPixmap *>& get_unit_explode_animation ( const struct tileset t)

Return a sprite_vector containing the animation sprites for a unit explosion.

Definition at line 3505 of file tilespec.cpp.

Referenced by animate_unit_explosion().

◆ get_unit_nation_flag_sprite()

QPixmap* get_unit_nation_flag_sprite ( const struct tileset t,
const struct unit punit 
)

Return a sprite for the national flag for this unit.

Definition at line 3061 of file tilespec.cpp.

Referenced by freeciv::layer_units::fill_sprite_array().

◆ get_unit_unhappy_sprite()

const QPixmap* 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 nullptr if there's no unhappiness.

Definition at line 3582 of file tilespec.cpp.

Referenced by put_unit_city_overlays().

◆ get_unit_upkeep_sprite()

const QPixmap* 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 nullptr if there's no upkeep of the kind.

Definition at line 3603 of file tilespec.cpp.

Referenced by put_unit_city_overlays().

◆ get_unittype_sprite()

const QPixmap* get_unittype_sprite ( const struct tileset t,
const struct unit_type punittype,
enum direction8  facing,
const QColor &  replace 
)

◆ is_cardinal_tileset_dir()

bool is_cardinal_tileset_dir ( const struct tileset t,
enum direction8  dir 
)

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 675 of file tilespec.cpp.

Referenced by freeciv::layer_roads::fill_corners(), freeciv::layer_roads::initialize_corners(), and tileset_read_toplevel().

◆ is_extra_drawing_enabled()

bool is_extra_drawing_enabled ( const extra_type pextra)

Should the given extra be drawn FIXME: Some extras can not be switched.

Definition at line 3133 of file tilespec.cpp.

Referenced by freeciv::layer_water::fill_irrigation_sprite_array(), freeciv::layer_roads::fill_sprite_array(), and freeciv::layer_special::fill_sprite_array().

◆ load_sprite()

QPixmap* load_sprite ( struct tileset t,
const QStringList &  possible_names,
bool  required,
bool  verbose 
)

Finds the first sprite matching a list of possible names and returns it.

Aborts when a required sprite is not found; otherwise, warns and returns nullptr.

Definition at line 2322 of file tilespec.cpp.

◆ make_tag_terrain_list()

QStringList make_tag_terrain_list ( const QString &  prefix,
const QString &  suffix,
const struct terrain pterrain 
)

Make the list of possible tag names for the extras which may vary depending on the terrain they're on.

Definition at line 2914 of file tilespec.cpp.

Referenced by freeciv::layer_roads::initialize_all_combined(), freeciv::layer_roads::initialize_all_separate(), freeciv::layer_roads::initialize_corners(), freeciv::layer_water::initialize_extra(), and freeciv::layer_roads::initialize_parity_combined().

◆ reset_focus_unit_state()

void reset_focus_unit_state ( struct tileset t)

Reset the focus unit state.

This should be called when changing focus units.

Definition at line 3213 of file tilespec.cpp.

Referenced by focus_unit_in_combat().

◆ tiles_lookup_sprite_tag_alt()

QPixmap* tiles_lookup_sprite_tag_alt ( struct tileset t,
QtMsgType  level,
const char *  tag,
const char *  alt,
const char *  what,
const char *  name,
bool  scale 
)

◆ tileset_basename()

const char* tileset_basename ( const struct tileset t)

◆ tileset_cardinal_dirs()

std::array<direction8, 8> tileset_cardinal_dirs ( const struct tileset t)

◆ tileset_citybar_offset_y()

int tileset_citybar_offset_y ( const struct tileset t)

Return the offset from the origin of the city tile at which to place the city bar text.

Definition at line 504 of file tilespec.cpp.

Referenced by show_city_desc(), and show_city_descriptions().

◆ tileset_description()

const char* tileset_description ( const struct tileset t)

Return tileset description body.

Definition at line 3846 of file tilespec.cpp.

Referenced by tileset_help().

◆ tileset_error()

◆ tileset_free()

void tileset_free ( struct tileset tileset)

Clean up.

Definition at line 840 of file tilespec.cpp.

Referenced by client_exit(), get_tileset_list(), tilespec_reread(), and tilespec_try_read().

◆ tileset_free_tiles()

void tileset_free_tiles ( struct tileset t)

Free all sprites from tileset.

Definition at line 3285 of file tilespec.cpp.

Referenced by fc_client::fc_main(), and tileset_free().

◆ tileset_full_tile_height()

int tileset_full_tile_height ( const struct tileset t)

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 407 of file tilespec.cpp.

Referenced by freeciv::layer_background::create_player_sprite(), move_unit_map_canvas(), terrain_canvas(), and tile_to_canvas_pos().

◆ tileset_full_tile_offset()

◆ tileset_full_tile_width()

int tileset_full_tile_width ( const struct tileset t)

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 394 of file tilespec.cpp.

Referenced by freeciv::layer_background::create_player_sprite(), terrain_canvas(), and hud_units::update_actions().

◆ tileset_get_layers()

const std::vector<std::unique_ptr<freeciv::layer> >& tileset_get_layers ( const struct tileset t)

◆ tileset_get_options()

std::map<QString, tileset_option> tileset_get_options ( const struct tileset t)

Gets the user-settable options of the tileset.

Definition at line 3789 of file tilespec.cpp.

Referenced by freeciv::tileset_options_dialog::reset(), and freeciv::tileset_options_dialog::tileset_options_dialog().

◆ tileset_has_error()

bool tileset_has_error ( const struct tileset t)

Checks if the tileset had any error message (LOG_ERROR).

Definition at line 3763 of file tilespec.cpp.

Referenced by tileset_changed().

◆ tileset_has_option()

bool tileset_has_option ( const struct tileset t,
const QString &  name 
)

Checks if the tileset has supports the given user-settable option.

Definition at line 3780 of file tilespec.cpp.

Referenced by scan_specfile(), and tileset_setup_options().

◆ tileset_has_options()

bool tileset_has_options ( const struct tileset t)

Checks if the tileset has any user-settable options.

Definition at line 3772 of file tilespec.cpp.

Referenced by mr_menu::event(), and mr_menu::setup_menus().

◆ tileset_help()

help_item* tileset_help ( const struct tileset t)

Creates the help item for the given tileset.

Definition at line 3859 of file tilespec.cpp.

Referenced by boot_help_texts(), client_main(), client_state(), handle_game_info(), and tilespec_reread().

◆ tileset_hex_height()

int tileset_hex_height ( const struct tileset t)

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 351 of file tilespec.cpp.

Referenced by units_select::create_pixmap(), unit_list_widget::create_unit_image(), freeciv::layer_roads::fill_corners(), gui_to_map_pos(), freeciv::layer_grid::load_sprites(), move_unit_map_canvas(), freeciv::gui_rect_iterator::next(), and tileset_read_toplevel().

◆ tileset_hex_width()

int tileset_hex_width ( const struct tileset t)

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 345 of file tilespec.cpp.

Referenced by units_select::create_pixmap(), unit_list_widget::create_unit_image(), freeciv::layer_roads::fill_corners(), gui_to_map_pos(), freeciv::layer_grid::load_sprites(), and freeciv::gui_rect_iterator::next().

◆ tileset_init()

void tileset_init ( struct tileset t)

Initialize tileset structure.

Definition at line 3630 of file tilespec.cpp.

Referenced by ui_main().

◆ tileset_is_fully_loaded()

bool tileset_is_fully_loaded ( )

Is tileset in sane state?

Definition at line 3750 of file tilespec.cpp.

◆ tileset_is_isometric()

◆ tileset_layer_city()

const freeciv::layer_city* tileset_layer_city ( const struct tileset t)

Returns the layer_city of the tileset.

Definition at line 3665 of file tilespec.cpp.

Referenced by freeciv::city_icon_widget::paintEvent(), races_dialog::races_dialog(), and freeciv::city_icon_widget::sizeHint().

◆ tileset_load_tiles()

void tileset_load_tiles ( struct tileset t)

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 2714 of file tilespec.cpp.

Referenced by tilespec_reread(), and ui_main().

◆ tileset_log()

std::vector<tileset_log_entry> tileset_log ( const struct tileset t)

Get tileset log (warnings, errors, etc.)

Definition at line 3755 of file tilespec.cpp.

Referenced by freeciv::tileset_debugger::refresh_messages().

◆ tileset_name_get()

const char* tileset_name_get ( const struct tileset t)

◆ tileset_num_cardinal_dirs()

int tileset_num_cardinal_dirs ( const struct tileset t)

◆ tileset_num_index_cardinals()

int tileset_num_index_cardinals ( const struct tileset t)

Returns the number of cardinal indices used by the tileset.

This is 2^tileset_num_cardinal_dirs(t).

Definition at line 564 of file tilespec.cpp.

Referenced by freeciv::layer_terrain::fill_terrain_sprite_array(), freeciv::layer_terrain::initialize_cell_whole_match_same(), freeciv::layer_water::initialize_extra(), and freeciv::layer_darkness::load_sprites().

◆ tileset_num_valid_dirs()

◆ tileset_option_is_enabled()

bool tileset_option_is_enabled ( const struct tileset t,
const QString &  name 
)

Checks if an user-settable tileset option is enabled.

The option must exist in the tileset.

Definition at line 3799 of file tilespec.cpp.

Referenced by scan_specfile(), and freeciv::tileset_options_dialog::tileset_options_dialog().

◆ tileset_player_init()

void tileset_player_init ( struct tileset t,
struct player pplayer 
)

Setup tiles for one player using the player color.

Definition at line 3708 of file tilespec.cpp.

Referenced by handle_player_info(), and tilespec_reread().

◆ tileset_preferred_scale()

double tileset_preferred_scale ( const struct tileset t)

Returns the preferred scale (zoom level) of the tileset.

Definition at line 539 of file tilespec.cpp.

Referenced by tileset_changed(), and map_view::zoom_reset().

◆ tileset_replaced_hue()

int tileset_replaced_hue ( const struct tileset t)

Returns the hue (color) that should be replaced with the player color in player-dependent sprites.

Definition at line 548 of file tilespec.cpp.

Referenced by freeciv::layer_city::load_city_size_sprites().

◆ tileset_ruleset_reset()

void tileset_ruleset_reset ( struct tileset t)

Reset tileset data specific to ruleset.

Definition at line 3740 of file tilespec.cpp.

Referenced by handle_ruleset_control().

◆ tileset_set_option()

bool tileset_set_option ( struct tileset t,
const QString &  name,
bool  enabled 
)

Enable or disable a user-settable tileset option.

The tileset may be reloaded as a result, invalidating t.

Returns false if the option does not exist. The game must have been initialized before calling this.

Definition at line 3812 of file tilespec.cpp.

Referenced by freeciv::tileset_options_dialog::tileset_options_dialog().

◆ tileset_setup_city_tiles()

void tileset_setup_city_tiles ( struct tileset t,
int  style 
)

Set city tiles sprite values; should only happen after tilespec_load_tiles().

Definition at line 3188 of file tilespec.cpp.

Referenced by handle_ruleset_city(), and tilespec_reread().

◆ tileset_setup_extra()

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 2937 of file tilespec.cpp.

Referenced by handle_rulesets_ready(), and tilespec_reread().

◆ tileset_setup_government()

void tileset_setup_government ( struct tileset t,
struct government gov 
)

Set government sprite value; should only happen after tilespec_load_tiles().

Definition at line 3007 of file tilespec.cpp.

Referenced by handle_ruleset_government(), and tilespec_reread().

◆ tileset_setup_impr_type()

void tileset_setup_impr_type ( struct tileset t,
struct impr_type pimprove 
)

Set improvement_type sprite value; should only happen after tilespec_load_tiles().

Definition at line 2879 of file tilespec.cpp.

Referenced by handle_ruleset_building(), and tilespec_reread().

◆ tileset_setup_nation_flag()

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 3020 of file tilespec.cpp.

Referenced by handle_ruleset_nation(), and tilespec_reread().

◆ tileset_setup_specialist_type()

void tileset_setup_specialist_type ( struct tileset t,
Specialist_type_id  id 
)

Setup the graphics for specialist types.

Definition at line 2423 of file tilespec.cpp.

Referenced by handle_ruleset_specialist(), and tilespec_reread().

◆ tileset_setup_tech_type()

void tileset_setup_tech_type ( struct tileset t,
struct advance padvance 
)

Set tech_type sprite value; should only happen after tilespec_load_tiles().

Definition at line 2895 of file tilespec.cpp.

Referenced by handle_ruleset_tech(), and tilespec_reread().

◆ tileset_setup_tile_type()

void tileset_setup_tile_type ( struct tileset t,
const struct terrain pterrain 
)

Set tile_type sprite values; should only happen after tilespec_load_tiles().

Definition at line 2995 of file tilespec.cpp.

Referenced by handle_ruleset_terrain(), and tilespec_reread().

◆ tileset_setup_unit_type()

void tileset_setup_unit_type ( struct tileset t,
struct unit_type punittype 
)

Set unit_type sprite value; should only happen after tilespec_load_tiles().

Definition at line 2847 of file tilespec.cpp.

Referenced by handle_ruleset_unit(), and tilespec_reread().

◆ tileset_small_sprite_height()

int tileset_small_sprite_height ( const struct tileset t)

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 523 of file tilespec.cpp.

Referenced by city_dialog::fill_citizens_pixmap(), city_label::mousePressEvent(), and city_dialog::update_citizens().

◆ tileset_small_sprite_width()

int tileset_small_sprite_width ( const struct tileset t)

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 495 of file tilespec.cpp.

Referenced by city_dialog::fill_citizens_pixmap(), city_label::mousePressEvent(), and city_dialog::update_citizens().

◆ tileset_summary()

const char* tileset_summary ( const struct tileset t)

Return tileset description summary.

Definition at line 3841 of file tilespec.cpp.

Referenced by tileset_help().

◆ tileset_tile_height()

int tileset_tile_height ( const struct tileset t)

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 383 of file tilespec.cpp.

Referenced by animate_unit_explosion(), info_tile::calc_size(), can_do_cached_drawing(), map_view::center_on_tile(), draw_calculated_trade_routes(), draw_segment(), draw_trade_route_line(), editor_end_selection_rectangle(), freeciv::layer_terrain::fill_blending_sprite_array(), freeciv::layer_darkness::fill_sprite_array(), freeciv::layer_overlays::fill_sprite_array(), freeciv::layer_terrain::fill_terrain_sprite_array(), generate_citydlg_dimensions(), get_mapview_scroll_window(), freeciv::gui_rect_iterator::gui_rect_iterator(), gui_to_map_pos(), gui_to_natural_pos(), freeciv::layer_terrain::initialize_blending(), freeciv::layer_terrain::initialize_cell_hex_corner(), freeciv::layer_background::initialize_player(), freeciv::layer_grid::initialize_player(), link_mark_draw(), freeciv::layer_darkness::load_sprites(), freeciv::layer_editor::load_sprites(), freeciv::layer_overlays::load_sprites(), map_canvas_resized(), map_to_gui_vector(), move_unit_map_canvas(), put_nuke_mushroom_pixmaps(), put_terrain(), put_unit(), mr_menu::save_image(), freeciv::city_icon_widget::sizeHint(), terrain_canvas(), tile_to_canvas_pos(), tile_visible_and_not_on_border_mapcanvas(), tileset_set_offsets(), hud_units::update_actions(), update_map_canvas(), and update_rects().

◆ tileset_tile_width()

int tileset_tile_width ( const struct tileset t)

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:

  • The value should be even (or a multiple of 4 in iso-view).
  • In iso-view, the width should be twice the height (to give a perspective of 30 degrees above the horizon).
  • In non-iso-view, width and height should be equal (overhead perspective).
  • In hex or iso-hex view, remember this is the tesselation vector. hex_width and hex_height then give the size of the side of the hexagon. Calculating the dimensions of a "regular" hexagon or iso-hexagon may be tricky. However these requirements are not absolute and callers should not depend on them (although some do).

Definition at line 371 of file tilespec.cpp.

Referenced by animate_unit_explosion(), can_do_cached_drawing(), map_view::center_on_tile(), draw_calculated_trade_routes(), draw_segment(), draw_trade_route_line(), editor_end_selection_rectangle(), freeciv::layer_terrain::fill_blending_sprite_array(), freeciv::layer_darkness::fill_sprite_array(), freeciv::layer_overlays::fill_sprite_array(), freeciv::layer_terrain::fill_terrain_sprite_array(), generate_citydlg_dimensions(), get_mapview_scroll_window(), freeciv::gui_rect_iterator::gui_rect_iterator(), gui_to_map_pos(), gui_to_natural_pos(), freeciv::layer_terrain::initialize_blending(), freeciv::layer_terrain::initialize_cell_hex_corner(), freeciv::layer_background::initialize_player(), freeciv::layer_grid::initialize_player(), link_mark_draw(), freeciv::layer_darkness::load_sprites(), freeciv::layer_editor::load_sprites(), freeciv::layer_overlays::load_sprites(), map_canvas_resized(), map_to_gui_vector(), put_nuke_mushroom_pixmaps(), mr_menu::save_image(), show_city_desc(), show_city_descriptions(), show_tile_label(), show_tile_labels(), freeciv::city_icon_widget::sizeHint(), tile_to_canvas_pos(), tile_visible_and_not_on_border_mapcanvas(), and update_rects().

◆ tileset_tilelabel_offset_y()

int tileset_tilelabel_offset_y ( const struct tileset t)

Return the offset from the origin of the tile at which to place the label text.

Definition at line 513 of file tilespec.cpp.

Referenced by show_tile_label().

◆ tileset_topo_index()

int tileset_topo_index ( const struct tileset t)

Return tileset topology index.

Definition at line 3854 of file tilespec.cpp.

Referenced by freeciv::layer_terrain::initialize_terrain(), and tilespec_try_read().

◆ tileset_unit_height()

◆ tileset_unit_layout_offset_y()

int tileset_unit_layout_offset_y ( const struct tileset t)

Offset to layout extra unit sprites, such as upkeep.

Definition at line 485 of file tilespec.cpp.

Referenced by unit_list_widget::create_unit_image(), freeciv::upkeep_widget::refresh(), and tileset_unit_with_upkeep_height().

◆ tileset_unit_width()

◆ tileset_unit_with_upkeep_height()

int tileset_unit_with_upkeep_height ( const struct tileset t)

Suitable canvas height for a unit icon that includes upkeep sprites.

Definition at line 473 of file tilespec.cpp.

Referenced by unit_list_widget::create_unit_image(), and freeciv::upkeep_widget::refresh().

◆ tileset_use_hard_coded_fog()

bool tileset_use_hard_coded_fog ( const struct tileset t)

Return TRUE if the client will use the code to generate the fog.

Definition at line 531 of file tilespec.cpp.

◆ tileset_valid_dirs()

std::array<direction8, 8> tileset_valid_dirs ( const struct tileset t)

◆ tileset_version()

const char* tileset_version ( const struct tileset t)

Return tileset version.

Definition at line 3836 of file tilespec.cpp.

Referenced by tileset_help().

◆ tilespec_init()

void tilespec_init ( )

Initializes the tilespec system.

Definition at line 709 of file tilespec.cpp.

◆ tilespec_reread()

bool tilespec_reread ( const QString &  name,
bool  game_fully_initialized 
)

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.

It will also call the necessary functions to redraw the graphics.

Returns TRUE iff new tileset has been succesfully loaded.

Definition at line 916 of file tilespec.cpp.

Referenced by handle_ruleset_control(), mr_menu::load_new_tileset(), popup_tileset_suggestion_dialog(), map_view::shortcut_pressed(), tilespec_reread_callback(), and tilespec_reread_frozen_refresh().

◆ tilespec_reread_callback()

void tilespec_reread_callback ( struct option poption)

This is merely a wrapper for tilespec_reread (above) for use in options.c and the client local options dialog.

Definition at line 1063 of file tilespec.cpp.

Referenced by init_client_options().

◆ tilespec_reread_frozen_refresh()

void tilespec_reread_frozen_refresh ( const QString &  name)

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 1091 of file tilespec.cpp.

Referenced by handle_set_topology(), and tileset_set_option().

◆ tilespec_try_read()

bool tilespec_try_read ( const QString &  tileset_name,
bool  verbose,
int  topo_id 
)

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 860 of file tilespec.cpp.

Referenced by client_main().

◆ toggle_focus_unit_state()

void toggle_focus_unit_state ( struct tileset t)

Toggle/increment the focus unit state.

This should be called once every get_focus_unit_toggle_timeout() seconds.

Definition at line 3232 of file tilespec.cpp.

Referenced by blink_active_unit().

◆ unit_drawn_with_city_outline()

bool unit_drawn_with_city_outline ( const struct unit punit,
bool  check_focus 
)

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 3116 of file tilespec.cpp.

Referenced by freeciv::layer_grid::fill_sprite_array(), handle_unit_packet_common(), and freeciv::map_updates_handler::update().

◆ valid_index_str()

QString valid_index_str ( const struct tileset t,
int  idx 
)

Do the same thing as cardinal_str, except including all valid directions.

The returned string is a pointer to static memory.

Definition at line 2251 of file tilespec.cpp.

Referenced by freeciv::layer_roads::initialize_all_combined().

Variable Documentation

◆ DIR4_TO_DIR8

constexpr direction8 DIR4_TO_DIR8[4]
constexpr
Initial value:
= {DIR8_NORTH, DIR8_SOUTH, DIR8_EAST,
DIR8_WEST}

Definition at line 53 of file tilespec.h.

Referenced by freeciv::layer_terrain::fill_blending_sprite_array(), freeciv::layer_darkness::fill_sprite_array(), and freeciv::layer_terrain::fill_terrain_sprite_array().

◆ tileset

struct tileset* tileset
extern

Definition at line 276 of file tilespec.cpp.

Referenced by get_tileset().

◆ TilesetChanged

QEvent::Type TilesetChanged
extern

An event type sent to all widgets when the current tileset changes.

Definition at line 719 of file tilespec.cpp.

Referenced by mr_menu::event(), freeciv::city_icon_widget::event(), freeciv::upkeep_widget::event(), tilespec_init(), and tilespec_reread().