Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
tilespec.h File Reference
#include "log.h"
#include "city.h"
#include "fc_types.h"
#include "options.h"
#include "specvec.h"
#include "specenum_gen.h"

Go to the source code of this file.

Data Structures

struct  tile_edge
 
struct  tile_corner
 
struct  drawn_sprite
 
struct  citybar_sprites
 
struct  editor_sprites
 

Macros

#define SPECVEC_TAG   sprite
 
#define SPECVEC_TYPE   struct sprite *
 
#define sprite_vector_iterate(sprite_vec, psprite)    TYPED_VECTOR_ITERATE(struct sprite *, sprite_vec, psprite)
 
#define sprite_vector_iterate_end   VECTOR_ITERATE_END
 
#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 SPECENUM_NAME   fog_style
 
#define SPECENUM_VALUE0   FOG_AUTO
 
#define SPECENUM_VALUE0NAME   "Auto"
 
#define SPECENUM_VALUE1   FOG_SPRITE
 
#define SPECENUM_VALUE1NAME   "Sprite"
 
#define SPECENUM_VALUE2   FOG_DARKNESS
 
#define SPECENUM_VALUE2NAME   "Darkness"
 
#define SPECENUM_NAME   darkness_style
 
#define SPECENUM_VALUE0   DARKNESS_NONE
 
#define SPECENUM_VALUE0NAME   "None"
 
#define SPECENUM_VALUE1   DARKNESS_ISORECT
 
#define SPECENUM_VALUE1NAME   "IsoRect"
 
#define SPECENUM_VALUE2   DARKNESS_CARD_SINGLE
 
#define SPECENUM_VALUE2NAME   "CardinalSingle"
 
#define SPECENUM_VALUE3   DARKNESS_CARD_FULL
 
#define SPECENUM_VALUE3NAME   "CardinalFull"
 
#define SPECENUM_VALUE4   DARKNESS_CORNER
 
#define SPECENUM_VALUE4NAME   "Corner"
 
#define NUM_EDGE_TILES   2
 
#define NUM_CORNER_TILES   4
 
#define SPECENUM_NAME   mapview_layer
 
#define SPECENUM_VALUE0   LAYER_BACKGROUND
 
#define SPECENUM_VALUE0NAME   "Background"
 
#define SPECENUM_VALUE1   LAYER_TERRAIN1
 
#define SPECENUM_VALUE1NAME   "Terrain1"
 
#define SPECENUM_VALUE2   LAYER_DARKNESS
 
#define SPECENUM_VALUE2NAME   "Darkness"
 
#define SPECENUM_VALUE3   LAYER_TERRAIN2
 
#define SPECENUM_VALUE3NAME   "Terrain2"
 
#define SPECENUM_VALUE4   LAYER_TERRAIN3
 
#define SPECENUM_VALUE4NAME   "Terrain3"
 
#define SPECENUM_VALUE5   LAYER_WATER
 
#define SPECENUM_VALUE5NAME   "Water"
 
#define SPECENUM_VALUE6   LAYER_ROADS
 
#define SPECENUM_VALUE6NAME   "Roads"
 
#define SPECENUM_VALUE7   LAYER_SPECIAL1
 
#define SPECENUM_VALUE7NAME   "Special1"
 
#define SPECENUM_VALUE8   LAYER_GRID1
 
#define SPECENUM_VALUE8NAME   "Grid1"
 
#define SPECENUM_VALUE9   LAYER_CITY1
 
#define SPECENUM_VALUE9NAME   "City1"
 
#define SPECENUM_VALUE10   LAYER_SPECIAL2
 
#define SPECENUM_VALUE10NAME   "Special2"
 
#define SPECENUM_VALUE11   LAYER_FOG
 
#define SPECENUM_VALUE11NAME   "Fog"
 
#define SPECENUM_VALUE12   LAYER_UNIT
 
#define SPECENUM_VALUE12NAME   "Unit"
 
#define SPECENUM_VALUE13   LAYER_SPECIAL3
 
#define SPECENUM_VALUE13NAME   "Special3"
 
#define SPECENUM_VALUE14   LAYER_CITY2
 
#define SPECENUM_VALUE14NAME   "City2"
 
#define SPECENUM_VALUE15   LAYER_GRID2
 
#define SPECENUM_VALUE15NAME   "Grid2"
 
#define SPECENUM_VALUE16   LAYER_OVERLAYS
 
#define SPECENUM_VALUE16NAME   "Overlays"
 
#define SPECENUM_VALUE17   LAYER_TILELABEL
 
#define SPECENUM_VALUE17NAME   "TileLabel"
 
#define SPECENUM_VALUE18   LAYER_CITYBAR
 
#define SPECENUM_VALUE18NAME   "CityBar"
 
#define SPECENUM_VALUE19   LAYER_FOCUS_UNIT
 
#define SPECENUM_VALUE19NAME   "FocusUnit"
 
#define SPECENUM_VALUE20   LAYER_GOTO
 
#define SPECENUM_VALUE20NAME   "Goto"
 
#define SPECENUM_VALUE21   LAYER_WORKERTASK
 
#define SPECENUM_VALUE21NAME   "WorkerTask"
 
#define SPECENUM_VALUE22   LAYER_EDITOR
 
#define SPECENUM_VALUE22NAME   "Editor"
 
#define SPECENUM_VALUE23   LAYER_INFRAWORK
 
#define SPECENUM_VALUE23NAME   "InfraWork"
 
#define SPECENUM_COUNT   LAYER_COUNT
 
#define TERRAIN_LAYER_COUNT   3
 
#define mapview_layer_iterate(layer)
 
#define mapview_layer_iterate_end
 
#define NUM_TILES_PROGRESS   8
 
#define MAX_NUM_CITIZEN_SPRITES   6
 
#define NUM_CURSOR_FRAMES   6
 
#define NUM_WALL_TYPES   7
 
#define TS_TOPO_SQUARE   0
 
#define TS_TOPO_HEX   1
 
#define TS_TOPO_ISOHEX   2
 

Enumerations

enum  edge_type {
  EDGE_NS , EDGE_WE , EDGE_UD , EDGE_LR ,
  EDGE_COUNT
}
 
enum  layer_category { LAYER_CATEGORY_CITY , LAYER_CATEGORY_TILE , LAYER_CATEGORY_UNIT }
 
enum  arrow_type { ARROW_RIGHT , ARROW_PLUS , ARROW_MINUS , ARROW_LAST }
 
enum  cursor_type {
  CURSOR_GOTO , CURSOR_PATROL , CURSOR_PARADROP , CURSOR_TELEPORT ,
  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  icon_type { ICON_FREECIV , ICON_CITYDLG , ICON_COUNT }
 
enum  spaceship_part {
  SPACESHIP_SOLAR_PANEL , SPACESHIP_LIFE_SUPPORT , SPACESHIP_HABITATION , SPACESHIP_STRUCTURAL ,
  SPACESHIP_FUEL , SPACESHIP_PROPULSION , SPACESHIP_EXHAUST , SPACESHIP_COUNT
}
 

Functions

const struct strvecget_tileset_list (const struct option *poption)
 
void tileset_error (enum log_level level, const char *tset_name, const char *format,...)
 
void tileset_init (struct tileset *t)
 
void tileset_free (struct tileset *tileset)
 
void tileset_load_tiles (struct tileset *t)
 
void tileset_free_tiles (struct tileset *t)
 
void tileset_ruleset_reset (struct tileset *t)
 
bool tileset_is_fully_loaded (void)
 
void finish_loading_sprites (struct tileset *t)
 
bool tilespec_try_read (const char *tileset_name, bool verbose, int topo_id, bool global_default)
 
bool tilespec_reread (const char *tileset_name, bool game_fully_initialized, float scale)
 
void tilespec_reread_callback (struct option *poption)
 
void tilespec_reread_frozen_refresh (const char *tname)
 
void tileset_setup_specialist_type_default_set (struct tileset *t, Specialist_type_id id)
 
void tileset_setup_unit_type (struct tileset *t, struct unit_type *punittype)
 
void tileset_setup_impr_type (struct tileset *t, struct impr_type *pimprove)
 
void tileset_setup_tech_type (struct tileset *t, struct advance *padvance)
 
void tileset_setup_tile_type (struct tileset *t, const struct terrain *pterrain)
 
void tileset_setup_resource (struct tileset *t, const struct resource_type *presource)
 
void tileset_setup_extra (struct tileset *t, struct extra_type *pextra)
 
void tileset_setup_government (struct tileset *t, struct government *gov)
 
void tileset_setup_nation_flag (struct tileset *t, struct nation_type *nation)
 
void tileset_setup_city_tiles (struct tileset *t, int style)
 
void tileset_player_init (struct tileset *t, struct player *pplayer)
 
void tileset_background_init (struct tileset *t)
 
void tileset_background_free (struct tileset *t)
 
enum mapview_layer tileset_get_layer (const struct tileset *t, int n)
 
bool tileset_layer_in_category (enum mapview_layer layer, enum layer_category cat)
 
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)
 
int fill_basic_terrain_layer_sprite_array (struct tileset *t, struct drawn_sprite *sprs, int layer, struct terrain *pterrain)
 
double get_focus_unit_toggle_timeout (const struct tileset *t)
 
void reset_focus_unit_state (struct tileset *t)
 
void focus_unit_in_combat (struct tileset *t)
 
void toggle_focus_unit_state (struct tileset *t)
 
struct unitget_drawable_unit (const struct tileset *t, struct tile *ptile, const struct city *citymode)
 
bool unit_drawn_with_city_outline (const struct unit *punit, bool check_focus)
 
struct spriteget_spaceship_sprite (const struct tileset *t, enum spaceship_part part)
 
struct spriteget_citizen_sprite (const struct tileset *t, enum citizen_category type, int citizen_index, const struct city *pcity)
 
struct spriteget_city_flag_sprite (const struct tileset *t, const struct city *pcity)
 
struct spriteget_nation_flag_sprite (const struct tileset *t, const struct nation_type *nation)
 
struct spriteget_nation_shield_sprite (const struct tileset *t, const struct nation_type *nation)
 
struct spriteget_tech_sprite (const struct tileset *t, Tech_type_id tech)
 
struct spriteget_building_sprite (const struct tileset *t, const struct impr_type *pimprove)
 
struct spriteget_government_sprite (const struct tileset *t, const struct government *gov)
 
struct spriteget_unittype_sprite (const struct tileset *t, const struct unit_type *punittype, enum unit_activity activity, enum direction8 facing)
 
struct spriteget_sample_city_sprite (const struct tileset *t, int style_idx)
 
struct spriteget_arrow_sprite (const struct tileset *t, enum arrow_type arrow)
 
struct spriteget_tax_sprite (const struct tileset *t, Output_type_id otype)
 
struct spriteget_treaty_thumb_sprite (const struct tileset *t, bool on_off)
 
const struct sprite_vectorget_unit_explode_animation (const struct tileset *t)
 
struct spriteget_nuke_explode_sprite (const struct tileset *t)
 
struct spriteget_cursor_sprite (const struct tileset *t, enum cursor_type cursor, int *hot_x, int *hot_y, int frame)
 
const struct citybar_spritesget_citybar_sprites (const struct tileset *t)
 
const struct editor_spritesget_editor_sprites (const struct tileset *t)
 
struct spriteget_icon_sprite (const struct tileset *t, enum icon_type icon)
 
struct spriteget_attention_crosshair_sprite (const struct tileset *t)
 
struct spriteget_indicator_sprite (const struct tileset *t, enum indicator_type indicator, int index)
 
struct spriteget_unit_unhappy_sprite (const struct tileset *t, const struct unit *punit, int happy_cost)
 
struct spriteget_unit_upkeep_sprite (const struct tileset *t, Output_type_id otype, const struct unit *punit, const int *upkeep_cost)
 
struct spriteget_basic_fog_sprite (const struct tileset *t)
 
int fill_basic_extra_sprite_array (const struct tileset *t, struct drawn_sprite *sprs, const struct extra_type *pextra)
 
struct spriteget_event_sprite (const struct tileset *t, enum event_type event)
 
struct spritetiles_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)
 
struct color_systemget_color_system (const struct tileset *t)
 
struct tilesetget_tileset (void)
 
const chartileset_basename (const struct tileset *t)
 
bool tileset_is_isometric (const struct tileset *t)
 
int tileset_hex_width (const struct tileset *t)
 
int tileset_hex_height (const struct tileset *t)
 
int tileset_tile_width (const struct tileset *t)
 
int tileset_tile_height (const struct tileset *t)
 
int tileset_full_tile_width (const struct tileset *t)
 
int tileset_full_tile_height (const struct tileset *t)
 
int tileset_unit_width (const struct tileset *t)
 
int tileset_unit_height (const struct tileset *t)
 
int tileset_unit_with_upkeep_height (const struct tileset *t)
 
int tileset_unit_with_small_upkeep_height (const struct tileset *t)
 
int tileset_unit_layout_offset_y (const struct tileset *t)
 
int tileset_unit_layout_small_offset_y (const struct tileset *t)
 
int tileset_small_sprite_width (const struct tileset *t)
 
int tileset_small_sprite_height (const struct tileset *t)
 
int tileset_citybar_offset_y (const struct tileset *t)
 
int tileset_tilelabel_offset_y (const struct tileset *t)
 
float tileset_scale (const struct tileset *t)
 
const chartileset_main_intro_filename (const struct tileset *t)
 
int tileset_num_city_colors (const struct tileset *t)
 
void tileset_use_preferred_theme (const struct tileset *t)
 
bool tileset_use_hard_coded_fog (const struct tileset *t)
 
const chartileset_name_get (struct tileset *t)
 
const chartileset_version (struct tileset *t)
 
const chartileset_summary (struct tileset *t)
 
const chartileset_description (struct tileset *t)
 
chartileset_what_ruleset (struct tileset *t)
 
int tileset_topo_index (struct tileset *t)
 
int tileset_svg_flag_height (struct tileset *t)
 
int index_ts_topology (int idx)
 
struct spriteload_popup_sprite (const char *tag)
 
void unload_popup_sprite (const char *tag)
 

Variables

struct tilesettileset
 
struct tilesetunscaled_tileset
 

Macro Definition Documentation

◆ mapview_layer_iterate

#define mapview_layer_iterate (   layer)
Value:
{ \
enum mapview_layer layer; \
char * incite_cost
Definition comments.c:75
enum mapview_layer tileset_get_layer(const struct tileset *t, int n)
Definition tilespec.c:7319

Definition at line 175 of file tilespec.h.

◆ mapview_layer_iterate_end

#define mapview_layer_iterate_end
Value:
} \
}

Definition at line 183 of file tilespec.h.

◆ MAX_NUM_CITIZEN_SPRITES

#define MAX_NUM_CITIZEN_SPRITES   6

Definition at line 197 of file tilespec.h.

◆ NUM_CORNER_TILES

#define NUM_CORNER_TILES   4

Definition at line 106 of file tilespec.h.

◆ NUM_CURSOR_FRAMES

#define NUM_CURSOR_FRAMES   6

Definition at line 303 of file tilespec.h.

◆ NUM_EDGE_TILES

#define NUM_EDGE_TILES   2

Definition at line 99 of file tilespec.h.

◆ NUM_TILES_PROGRESS

#define NUM_TILES_PROGRESS   8

Definition at line 195 of file tilespec.h.

◆ NUM_WALL_TYPES

#define NUM_WALL_TYPES   7

Definition at line 359 of file tilespec.h.

◆ SPECENUM_COUNT

#define SPECENUM_COUNT   LAYER_COUNT

Definition at line 170 of file tilespec.h.

◆ SPECENUM_NAME [1/4]

Definition at line 48 of file tilespec.h.

◆ SPECENUM_NAME [2/4]

Definition at line 48 of file tilespec.h.

◆ SPECENUM_NAME [3/4]

#define SPECENUM_NAME   darkness_style

Definition at line 48 of file tilespec.h.

◆ SPECENUM_NAME [4/4]

Definition at line 48 of file tilespec.h.

◆ SPECENUM_VALUE0 [1/4]

#define SPECENUM_VALUE0   TS_OVERHEAD

Definition at line 49 of file tilespec.h.

◆ SPECENUM_VALUE0 [2/4]

#define SPECENUM_VALUE0   FOG_AUTO

Definition at line 49 of file tilespec.h.

◆ SPECENUM_VALUE0 [3/4]

#define SPECENUM_VALUE0   DARKNESS_NONE

Definition at line 49 of file tilespec.h.

◆ SPECENUM_VALUE0 [4/4]

#define SPECENUM_VALUE0   LAYER_BACKGROUND

Definition at line 49 of file tilespec.h.

◆ SPECENUM_VALUE0NAME [1/4]

#define SPECENUM_VALUE0NAME   N_("Overhead")

Definition at line 50 of file tilespec.h.

◆ SPECENUM_VALUE0NAME [2/4]

#define SPECENUM_VALUE0NAME   "Auto"

Definition at line 50 of file tilespec.h.

◆ SPECENUM_VALUE0NAME [3/4]

#define SPECENUM_VALUE0NAME   "None"

Definition at line 50 of file tilespec.h.

◆ SPECENUM_VALUE0NAME [4/4]

#define SPECENUM_VALUE0NAME   "Background"

Definition at line 50 of file tilespec.h.

◆ SPECENUM_VALUE1 [1/4]

#define SPECENUM_VALUE1   TS_ISOMETRIC

Definition at line 51 of file tilespec.h.

◆ SPECENUM_VALUE1 [2/4]

#define SPECENUM_VALUE1   FOG_SPRITE

Definition at line 51 of file tilespec.h.

◆ SPECENUM_VALUE1 [3/4]

#define SPECENUM_VALUE1   DARKNESS_ISORECT

Definition at line 51 of file tilespec.h.

◆ SPECENUM_VALUE1 [4/4]

#define SPECENUM_VALUE1   LAYER_TERRAIN1

Definition at line 51 of file tilespec.h.

◆ SPECENUM_VALUE10

#define SPECENUM_VALUE10   LAYER_SPECIAL2

Definition at line 142 of file tilespec.h.

◆ SPECENUM_VALUE10NAME

#define SPECENUM_VALUE10NAME   "Special2"

Definition at line 143 of file tilespec.h.

◆ SPECENUM_VALUE11

#define SPECENUM_VALUE11   LAYER_FOG

Definition at line 144 of file tilespec.h.

◆ SPECENUM_VALUE11NAME

#define SPECENUM_VALUE11NAME   "Fog"

Definition at line 145 of file tilespec.h.

◆ SPECENUM_VALUE12

#define SPECENUM_VALUE12   LAYER_UNIT

Definition at line 146 of file tilespec.h.

◆ SPECENUM_VALUE12NAME

#define SPECENUM_VALUE12NAME   "Unit"

Definition at line 147 of file tilespec.h.

◆ SPECENUM_VALUE13

#define SPECENUM_VALUE13   LAYER_SPECIAL3

Definition at line 148 of file tilespec.h.

◆ SPECENUM_VALUE13NAME

#define SPECENUM_VALUE13NAME   "Special3"

Definition at line 149 of file tilespec.h.

◆ SPECENUM_VALUE14

#define SPECENUM_VALUE14   LAYER_CITY2

Definition at line 150 of file tilespec.h.

◆ SPECENUM_VALUE14NAME

#define SPECENUM_VALUE14NAME   "City2"

Definition at line 151 of file tilespec.h.

◆ SPECENUM_VALUE15

#define SPECENUM_VALUE15   LAYER_GRID2

Definition at line 152 of file tilespec.h.

◆ SPECENUM_VALUE15NAME

#define SPECENUM_VALUE15NAME   "Grid2"

Definition at line 153 of file tilespec.h.

◆ SPECENUM_VALUE16

#define SPECENUM_VALUE16   LAYER_OVERLAYS

Definition at line 154 of file tilespec.h.

◆ SPECENUM_VALUE16NAME

#define SPECENUM_VALUE16NAME   "Overlays"

Definition at line 155 of file tilespec.h.

◆ SPECENUM_VALUE17

#define SPECENUM_VALUE17   LAYER_TILELABEL

Definition at line 156 of file tilespec.h.

◆ SPECENUM_VALUE17NAME

#define SPECENUM_VALUE17NAME   "TileLabel"

Definition at line 157 of file tilespec.h.

◆ SPECENUM_VALUE18

#define SPECENUM_VALUE18   LAYER_CITYBAR

Definition at line 158 of file tilespec.h.

◆ SPECENUM_VALUE18NAME

#define SPECENUM_VALUE18NAME   "CityBar"

Definition at line 159 of file tilespec.h.

◆ SPECENUM_VALUE19

#define SPECENUM_VALUE19   LAYER_FOCUS_UNIT

Definition at line 160 of file tilespec.h.

◆ SPECENUM_VALUE19NAME

#define SPECENUM_VALUE19NAME   "FocusUnit"

Definition at line 161 of file tilespec.h.

◆ SPECENUM_VALUE1NAME [1/4]

#define SPECENUM_VALUE1NAME   N_("Isometric")

Definition at line 52 of file tilespec.h.

◆ SPECENUM_VALUE1NAME [2/4]

#define SPECENUM_VALUE1NAME   "Sprite"

Definition at line 52 of file tilespec.h.

◆ SPECENUM_VALUE1NAME [3/4]

#define SPECENUM_VALUE1NAME   "IsoRect"

Definition at line 52 of file tilespec.h.

◆ SPECENUM_VALUE1NAME [4/4]

#define SPECENUM_VALUE1NAME   "Terrain1"

Definition at line 52 of file tilespec.h.

◆ SPECENUM_VALUE2 [1/3]

#define SPECENUM_VALUE2   FOG_DARKNESS

Definition at line 63 of file tilespec.h.

◆ SPECENUM_VALUE2 [2/3]

#define SPECENUM_VALUE2   DARKNESS_CARD_SINGLE

Definition at line 63 of file tilespec.h.

◆ SPECENUM_VALUE2 [3/3]

#define SPECENUM_VALUE2   LAYER_DARKNESS

Definition at line 63 of file tilespec.h.

◆ SPECENUM_VALUE20

#define SPECENUM_VALUE20   LAYER_GOTO

Definition at line 162 of file tilespec.h.

◆ SPECENUM_VALUE20NAME

#define SPECENUM_VALUE20NAME   "Goto"

Definition at line 163 of file tilespec.h.

◆ SPECENUM_VALUE21

#define SPECENUM_VALUE21   LAYER_WORKERTASK

Definition at line 164 of file tilespec.h.

◆ SPECENUM_VALUE21NAME

#define SPECENUM_VALUE21NAME   "WorkerTask"

Definition at line 165 of file tilespec.h.

◆ SPECENUM_VALUE22

#define SPECENUM_VALUE22   LAYER_EDITOR

Definition at line 166 of file tilespec.h.

◆ SPECENUM_VALUE22NAME

#define SPECENUM_VALUE22NAME   "Editor"

Definition at line 167 of file tilespec.h.

◆ SPECENUM_VALUE23

#define SPECENUM_VALUE23   LAYER_INFRAWORK

Definition at line 168 of file tilespec.h.

◆ SPECENUM_VALUE23NAME

#define SPECENUM_VALUE23NAME   "InfraWork"

Definition at line 169 of file tilespec.h.

◆ SPECENUM_VALUE2NAME [1/3]

#define SPECENUM_VALUE2NAME   "Darkness"

Definition at line 64 of file tilespec.h.

◆ SPECENUM_VALUE2NAME [2/3]

#define SPECENUM_VALUE2NAME   "CardinalSingle"

Definition at line 64 of file tilespec.h.

◆ SPECENUM_VALUE2NAME [3/3]

#define SPECENUM_VALUE2NAME   "Darkness"

Definition at line 64 of file tilespec.h.

◆ SPECENUM_VALUE3 [1/2]

#define SPECENUM_VALUE3   DARKNESS_CARD_FULL

Definition at line 81 of file tilespec.h.

◆ SPECENUM_VALUE3 [2/2]

#define SPECENUM_VALUE3   LAYER_TERRAIN2

Definition at line 81 of file tilespec.h.

◆ SPECENUM_VALUE3NAME [1/2]

#define SPECENUM_VALUE3NAME   "CardinalFull"

Definition at line 82 of file tilespec.h.

◆ SPECENUM_VALUE3NAME [2/2]

#define SPECENUM_VALUE3NAME   "Terrain2"

Definition at line 82 of file tilespec.h.

◆ SPECENUM_VALUE4 [1/2]

#define SPECENUM_VALUE4   DARKNESS_CORNER

Definition at line 84 of file tilespec.h.

◆ SPECENUM_VALUE4 [2/2]

#define SPECENUM_VALUE4   LAYER_TERRAIN3

Definition at line 84 of file tilespec.h.

◆ SPECENUM_VALUE4NAME [1/2]

#define SPECENUM_VALUE4NAME   "Corner"

Definition at line 85 of file tilespec.h.

◆ SPECENUM_VALUE4NAME [2/2]

#define SPECENUM_VALUE4NAME   "Terrain3"

Definition at line 85 of file tilespec.h.

◆ SPECENUM_VALUE5

#define SPECENUM_VALUE5   LAYER_WATER

Definition at line 132 of file tilespec.h.

◆ SPECENUM_VALUE5NAME

#define SPECENUM_VALUE5NAME   "Water"

Definition at line 133 of file tilespec.h.

◆ SPECENUM_VALUE6

#define SPECENUM_VALUE6   LAYER_ROADS

Definition at line 134 of file tilespec.h.

◆ SPECENUM_VALUE6NAME

#define SPECENUM_VALUE6NAME   "Roads"

Definition at line 135 of file tilespec.h.

◆ SPECENUM_VALUE7

#define SPECENUM_VALUE7   LAYER_SPECIAL1

Definition at line 136 of file tilespec.h.

◆ SPECENUM_VALUE7NAME

#define SPECENUM_VALUE7NAME   "Special1"

Definition at line 137 of file tilespec.h.

◆ SPECENUM_VALUE8

#define SPECENUM_VALUE8   LAYER_GRID1

Definition at line 138 of file tilespec.h.

◆ SPECENUM_VALUE8NAME

#define SPECENUM_VALUE8NAME   "Grid1"

Definition at line 139 of file tilespec.h.

◆ SPECENUM_VALUE9

#define SPECENUM_VALUE9   LAYER_CITY1

Definition at line 140 of file tilespec.h.

◆ SPECENUM_VALUE9NAME

#define SPECENUM_VALUE9NAME   "City1"

Definition at line 141 of file tilespec.h.

◆ SPECVEC_TAG

#define SPECVEC_TAG   sprite

Definition at line 41 of file tilespec.h.

◆ SPECVEC_TYPE

#define SPECVEC_TYPE   struct sprite *

Definition at line 42 of file tilespec.h.

◆ sprite_vector_iterate

#define sprite_vector_iterate (   sprite_vec,
  psprite 
)     TYPED_VECTOR_ITERATE(struct sprite *, sprite_vec, psprite)

Definition at line 44 of file tilespec.h.

◆ sprite_vector_iterate_end

#define sprite_vector_iterate_end   VECTOR_ITERATE_END

Definition at line 46 of file tilespec.h.

◆ TERRAIN_LAYER_COUNT

#define TERRAIN_LAYER_COUNT   3

Definition at line 173 of file tilespec.h.

◆ TS_TOPO_HEX

#define TS_TOPO_HEX   1

Definition at line 454 of file tilespec.h.

◆ TS_TOPO_ISOHEX

#define TS_TOPO_ISOHEX   2

Definition at line 455 of file tilespec.h.

◆ TS_TOPO_SQUARE

#define TS_TOPO_SQUARE   0

Definition at line 453 of file tilespec.h.

Enumeration Type Documentation

◆ arrow_type

Enumerator
ARROW_RIGHT 
ARROW_PLUS 
ARROW_MINUS 
ARROW_LAST 

Definition at line 199 of file tilespec.h.

◆ cursor_type

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

Definition at line 287 of file tilespec.h.

◆ edge_type

Enumerator
EDGE_NS 
EDGE_WE 
EDGE_UD 
EDGE_LR 
EDGE_COUNT 

Definition at line 90 of file tilespec.h.

◆ icon_type

Enumerator
ICON_FREECIV 
ICON_CITYDLG 
ICON_COUNT 

Definition at line 312 of file tilespec.h.

◆ indicator_type

Enumerator
INDICATOR_BULB 
INDICATOR_WARMING 
INDICATOR_COOLING 
INDICATOR_COUNT 

Definition at line 305 of file tilespec.h.

◆ layer_category

Enumerator
LAYER_CATEGORY_CITY 
LAYER_CATEGORY_TILE 
LAYER_CATEGORY_UNIT 

Definition at line 188 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 318 of file tilespec.h.

Function Documentation

◆ 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 7200 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().

◆ fill_basic_terrain_layer_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 7167 of file tilespec.c.

Referenced by create_terrain_pixbuf(), set_help_tile_from_terrain(), and terrain_canvas().

◆ 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 5813 of file tilespec.c.

Referenced by put_one_element().

◆ 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 3612 of file tilespec.c.

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 6540 of file tilespec.c.

Referenced by set_units_in_combat().

◆ get_arrow_sprite()

struct sprite * get_arrow_sprite ( const struct tileset t,
enum arrow_type  arrow 
)

Return a sprite with an "arrow" theme graphic.

Definition at line 6868 of file tilespec.c.

Referenced by populate_unit_image_table(), and populate_unit_pic_table().

◆ get_attention_crosshair_sprite()

struct sprite * 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 6990 of file tilespec.c.

Referenced by draw_calculated_trade_routes(), and put_cross_overlay_tile().

◆ get_basic_fog_sprite()

struct sprite * get_basic_fog_sprite ( const struct tileset t)

Return a rectangular sprite containing a fog "color". This can be used for drawing fog onto arbitrary areas (like the overview).

Definition at line 7053 of file tilespec.c.

Referenced by put_overview_tile_area().

◆ get_building_sprite()

struct sprite * get_building_sprite ( const struct tileset t,
const struct impr_type pimprove 
)

◆ 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 6722 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().

◆ get_city_flag_sprite()

struct sprite * 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 4469 of file tilespec.c.

Referenced by fill_sprite_array(), and show_full_citybar().

◆ 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 6937 of file tilespec.c.

Referenced by show_full_citybar().

◆ get_color_system()

struct color_system * get_color_system ( const struct tileset t)

Return the tileset's color system.

Definition at line 7061 of file tilespec.c.

Referenced by get_color().

◆ get_cursor_sprite()

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 6960 of file tilespec.c.

Referenced by animate_mouse_cursor(), fc_client::create_cursors(), and load_cursors().

◆ get_drawable_unit()

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 6564 of file tilespec.c.

Referenced by city_dialog_redraw_map(), and put_one_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 6949 of file tilespec.c.

Referenced by editbar_create(), editor_get_mode_sprite(), editor_tool_get_sprite(), and get_tool_value_pixbuf().

◆ get_event_sprite()

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

Return event icon sprite

Definition at line 6900 of file tilespec.c.

Referenced by meswin_dialog_refresh(), and messagewdg::msg().

◆ get_focus_unit_toggle_timeout()

double 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 6519 of file tilespec.c.

Referenced by blink_active_unit().

◆ get_government_sprite()

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

◆ get_icon_sprite()

struct sprite * get_icon_sprite ( const struct tileset t,
enum icon_type  icon 
)

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 6979 of file tilespec.c.

Referenced by create_city_dialog(), qtg_ui_main(), city_dialog::setup_ui(), tileset_changed(), and ui_main().

◆ get_indicator_sprite()

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 6999 of file tilespec.c.

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

◆ get_nation_flag_sprite()

struct sprite * get_nation_flag_sprite ( const struct tileset t,
const struct nation_type pnation 
)

◆ get_nation_shield_sprite()

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 6765 of file tilespec.c.

Referenced by pregame_options::update_buttons().

◆ get_nuke_explode_sprite()

struct sprite * 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 6929 of file tilespec.c.

Referenced by nuke_animation(), and put_nuke_mushroom_pixmaps().

◆ get_sample_city_sprite()

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

Return a "sample" sprite for this city style.

Definition at line 6851 of file tilespec.c.

Referenced by create_races_dialog(), get_sample_city_surface(), and races_dialog::races_dialog().

◆ get_spaceship_sprite()

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

Return the sprite for drawing the given spaceship part.

Definition at line 6691 of file tilespec.c.

Referenced by get_spaceship_dimensions(), and put_spaceship().

◆ get_tax_sprite()

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

◆ get_tech_sprite()

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

◆ get_tileset()

struct tileset * get_tileset ( void  )

◆ get_tileset_list()

const struct strvec * 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 1103 of file tilespec.c.

Referenced by mr_menu::tileset_custom_load().

◆ get_treaty_thumb_sprite()

struct sprite * 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 6909 of file tilespec.c.

Referenced by get_thumb_pixbuf(), and diplo_wdg::update_wdg().

◆ get_unit_explode_animation()

const struct sprite_vector * get_unit_explode_animation ( const struct tileset t)

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

Definition at line 6918 of file tilespec.c.

Referenced by decrease_unit_hp_smooth().

◆ get_unit_unhappy_sprite()

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 7016 of file tilespec.c.

Referenced by put_unit_city_overlays().

◆ get_unit_upkeep_sprite()

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 7035 of file tilespec.c.

Referenced by put_unit_city_overlays().

◆ get_unittype_sprite()

struct sprite * get_unittype_sprite ( const struct tileset t,
const struct unit_type punittype,
enum unit_activity  activity,
enum direction8  facing 
)

◆ index_ts_topology()

int index_ts_topology ( int  idx)

Convert properties of an index of tileset topology type to one (but not necessarily the only one) topology.

Definition at line 1085 of file tilespec.c.

Referenced by default_tileset_select().

◆ load_popup_sprite()

struct sprite * load_popup_sprite ( const char tag)

Load sprite from popup image tag

Definition at line 7578 of file tilespec.c.

Referenced by popup_image(), and qtg_popup_image().

◆ 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 6532 of file tilespec.c.

Referenced by focus_unit_in_combat().

◆ tiles_lookup_sprite_tag_alt()

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 3639 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().

◆ tileset_background_free()

void tileset_background_free ( struct tileset t)

Free tiles for the background.

Definition at line 7470 of file tilespec.c.

Referenced by tileset_background_init(), and tileset_free_tiles().

◆ tileset_background_init()

void tileset_background_init ( struct tileset t)

Setup tiles for the background.

Definition at line 7451 of file tilespec.c.

Referenced by handle_ruleset_game(), and tilespec_reread().

◆ tileset_basename()

const char * tileset_basename ( 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 910 of file tilespec.c.

Referenced by show_city_descriptions(), show_full_citybar(), and show_small_citybar().

◆ tileset_description()

const char * tileset_description ( struct tileset t)

Return tileset description body

Client stub

Definition at line 7546 of file tilespec.c.

Referenced by boot_help_texts().

◆ tileset_error()

void tileset_error ( enum log_level  level,
const char tset_name,
const char format,
  ... 
)

◆ tileset_free()

void tileset_free ( struct tileset t)

◆ tileset_free_tiles()

void tileset_free_tiles ( struct tileset t)

Free all sprites from tileset.

Definition at line 6604 of file tilespec.c.

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

◆ 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 789 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().

◆ tileset_full_tile_width()

int tileset_full_tile_width ( const struct tileset t)

◆ tileset_get_layer()

enum mapview_layer tileset_get_layer ( const struct tileset t,
int  n 
)

Gets the nth layer of the tileset.

Definition at line 7319 of file tilespec.c.

◆ 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 730 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().

◆ 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 721 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().

◆ tileset_init()

void tileset_init ( struct tileset t)

Initialize tileset structure

Definition at line 7126 of file tilespec.c.

Referenced by activate_gui(), qtg_ui_main(), ui_main(), and ui_main().

◆ tileset_is_fully_loaded()

bool tileset_is_fully_loaded ( void  )

Is tileset in sane state?

Definition at line 7514 of file tilespec.c.

Referenced by science_diagram_update(), science_diagram_update(), and update_unqueue().

◆ tileset_is_isometric()

bool tileset_is_isometric ( const struct tileset t)

◆ tileset_layer_in_category()

bool tileset_layer_in_category ( enum mapview_layer  layer,
enum layer_category  cat 
)

Gets the nth layer of the tileset.

Definition at line 7328 of file tilespec.c.

Referenced by create_pixbuf_from_layers().

◆ 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 3628 of file tilespec.c.

Referenced by activate_gui(), qtg_ui_main(), tilespec_reread(), ui_main(), and ui_main().

◆ tileset_main_intro_filename()

const char * tileset_main_intro_filename ( const struct tileset t)

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 947 of file tilespec.c.

Referenced by fc_client::create_main_page(), and create_main_page().

◆ tileset_name_get()

const char * tileset_name_get ( struct tileset t)

◆ tileset_num_city_colors()

int tileset_num_city_colors ( const struct tileset t)

Return the number of possible colors for city overlays.

Definition at line 955 of file tilespec.c.

Referenced by fill_sprite_array().

◆ 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 7371 of file tilespec.c.

Referenced by handle_player_info(), and tilespec_reread().

◆ tileset_ruleset_reset()

void tileset_ruleset_reset ( struct tileset t)

Reset tileset data specific to ruleset.

Definition at line 7486 of file tilespec.c.

Referenced by handle_ruleset_control().

◆ tileset_scale()

float tileset_scale ( const struct tileset t)

Returns tileset scale

Definition at line 927 of file tilespec.c.

◆ 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 6454 of file tilespec.c.

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 3875 of file tilespec.c.

Referenced by handle_ruleset_extra(), 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 4419 of file tilespec.c.

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 3840 of file tilespec.c.

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 4434 of file tilespec.c.

Referenced by handle_ruleset_nation(), and tilespec_reread().

◆ tileset_setup_resource()

void tileset_setup_resource ( struct tileset t,
const struct resource_type presource 
)

◆ 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 2891 of file tilespec.c.

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 3856 of file tilespec.c.

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 4153 of file tilespec.c.

Referenced by handle_ruleset_terrain(), and tilespec_reread().

◆ tileset_setup_unit_type()

void tileset_setup_unit_type ( struct tileset t,
struct unit_type ut 
)

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

Definition at line 3806 of file tilespec.c.

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 937 of file tilespec.c.

Referenced by city_dialog_update_citizens(), create_city_dialog(), extviewer_new(), 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 901 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().

◆ tileset_summary()

const char * tileset_summary ( struct tileset t)

Return tileset description summary

Client stub

Definition at line 7538 of file tilespec.c.

Referenced by boot_help_texts().

◆ tileset_svg_flag_height()

int tileset_svg_flag_height ( struct tileset t)

Return tileset svg flag height

Definition at line 7570 of file tilespec.c.

Referenced by show_full_citybar().

◆ 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 765 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().

◆ 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 753 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().

◆ 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 919 of file tilespec.c.

Referenced by show_tile_label().

◆ tileset_topo_index()

int tileset_topo_index ( struct tileset t)

Return tileset topology index

Definition at line 7562 of file tilespec.c.

Referenced by tilespec_reread_callback(), and tilespec_try_read().

◆ tileset_unit_height()

int tileset_unit_height ( const struct tileset t)

◆ 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 882 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().

◆ tileset_unit_layout_small_offset_y()

int tileset_unit_layout_small_offset_y ( const struct tileset t)

Offset to layout extra unit sprites, such as upkeep, requesting small space layout.

Definition at line 891 of file tilespec.c.

Referenced by create_unit_surface(), and tileset_unit_with_small_upkeep_height().

◆ tileset_unit_width()

int tileset_unit_width ( const struct tileset t)

◆ tileset_unit_with_small_upkeep_height()

int tileset_unit_with_small_upkeep_height ( const struct tileset t)

Suitable canvas height for a unit icon that includes upkeep sprites, using small space layout.

Definition at line 871 of file tilespec.c.

Referenced by create_unit_surface().

◆ 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 859 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().

◆ 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 963 of file tilespec.c.

◆ tileset_use_preferred_theme()

void tileset_use_preferred_theme ( const struct tileset t)

Loads preferred theme if there's any.

Definition at line 7069 of file tilespec.c.

Referenced by activate_gui(), tilespec_reread(), ui_main(), and ui_main().

◆ tileset_version()

const char * tileset_version ( struct tileset t)

Return tileset version

Client stub

Definition at line 7530 of file tilespec.c.

Referenced by boot_help_texts().

◆ tileset_what_ruleset()

char * tileset_what_ruleset ( struct tileset t)

Return what ruleset this tileset is primarily meant for

Definition at line 7554 of file tilespec.c.

Referenced by client_start_server().

◆ tilespec_reread()

bool tilespec_reread ( const char new_tileset_name,
bool  game_fully_initialized,
float  scale 
)

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 1355 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().

◆ 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 1509 of file tilespec.c.

◆ tilespec_reread_frozen_refresh()

void tilespec_reread_frozen_refresh ( const char tname)

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 1545 of file tilespec.c.

Referenced by handle_set_topology().

◆ tilespec_try_read()

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 1296 of file tilespec.c.

Referenced by default_tileset_select().

◆ 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 6551 of file tilespec.c.

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 5511 of file tilespec.c.

Referenced by fill_grid_sprite_array(), handle_unit_packet_common(), and refresh_unit_mapcanvas().

◆ unload_popup_sprite()

void unload_popup_sprite ( const char tag)

Unload sprite from popup image tag

Definition at line 7586 of file tilespec.c.

Referenced by popup_image(), and qtg_popup_image().

Variable Documentation

◆ tileset

Definition at line 567 of file tilespec.c.

◆ unscaled_tileset

struct tileset* unscaled_tileset
extern