79#define TILESPEC_CAPSTR "+Freeciv-3.1-tilespec duplicates_ok"
95#define SPEC_CAPSTR "+Freeciv-3.1-spec"
103#define TILESPEC_SUFFIX ".tilespec"
104#define TILE_SECTION_PREFIX "tile_"
107#define MAX_INDEX_CARDINAL 64
108#define MAX_INDEX_HALF 16
109#define MAX_INDEX_VALID 256
111#define NUM_TILES_HP_BAR 11
112#define NUM_TILES_DIGITS 10
113#define NUM_TILES_SELECT 4
114#define MAX_NUM_UPKEEP_SPRITES 10
116#define SPECENUM_NAME extrastyle_id
117#define SPECENUM_VALUE0 ESTYLE_ROAD_ALL_SEPARATE
118#define SPECENUM_VALUE0NAME "RoadAllSeparate"
119#define SPECENUM_VALUE1 ESTYLE_ROAD_PARITY_COMBINED
120#define SPECENUM_VALUE1NAME "RoadParityCombined"
121#define SPECENUM_VALUE2 ESTYLE_ROAD_ALL_COMBINED
122#define SPECENUM_VALUE2NAME "RoadAllCombined"
123#define SPECENUM_VALUE3 ESTYLE_RIVER
124#define SPECENUM_VALUE3NAME "River"
125#define SPECENUM_VALUE4 ESTYLE_SINGLE1
126#define SPECENUM_VALUE4NAME "Single1"
127#define SPECENUM_VALUE5 ESTYLE_SINGLE2
128#define SPECENUM_VALUE5NAME "Single2"
129#define SPECENUM_VALUE6 ESTYLE_3LAYER
130#define SPECENUM_VALUE6NAME "3Layer"
131#define SPECENUM_VALUE7 ESTYLE_CARDINALS
132#define SPECENUM_VALUE7NAME "Cardinals"
133#define SPECENUM_COUNT ESTYLE_COUNT
145 { DIR8_NORTH, DIR8_SOUTH, DIR8_EAST, DIR8_WEST };
165#define MAX_NUM_LAYERS 3
171#define MAX_NUM_MATCH_WITH 8
307 struct sprite_vector worked_tile_overlay;
308 struct sprite_vector unworked_tile_overlay;
378 struct sprite_vector overlays;
387 struct sprite *background;
398#define SPECLIST_TAG specfile
399#define SPECLIST_TYPE struct specfile
402#define specfile_list_iterate(list, pitem) \
403 TYPED_LIST_ITERATE(struct specfile, list, pitem)
404#define specfile_list_iterate_end LIST_ITERATE_END
428#define SPECLIST_TAG small_sprite
429#define SPECLIST_TYPE struct small_sprite
431#define small_sprite_list_iterate(list, pitem) \
432 TYPED_LIST_ITERATE(struct small_sprite, list, pitem)
433#define small_sprite_list_iterate_end LIST_ITERATE_END
436#define SPECHASH_TAG sprite
437#define SPECHASH_ASTR_KEY_TYPE
438#define SPECHASH_IDATA_TYPE struct small_sprite *
440#define sprite_hash_iterate(hash, tag_name, sprite) \
441 TYPED_HASH_ITERATE(const char *, struct small_sprite *, \
442 hash, tag_name, sprite)
443#define sprite_hash_iterate_end HASH_ITERATE_END
448#define SPECHASH_TAG drawing
449#define SPECHASH_CSTR_KEY_TYPE
450#define SPECHASH_IDATA_TYPE struct drawing_data *
451#define SPECHASH_IDATA_FREE drawing_data_destroy
454#define SPECHASH_TAG estyle
455#define SPECHASH_ASTR_KEY_TYPE
456#define SPECHASH_ENUM_DATA_TYPE extrastyle_id
510#define NUM_CORNER_DIRS 4
511#define TILES_PER_CORNER 4
552 bool verbose,
int topology_id,
558 enum direction8 facing);
562 int stack,
bool backdrop);
588 const char *format, ...)
593 va_start(args, format);
629 if (draw->
name != NULL) {
632 for (i = 0; i < 4; i++) {
633 if (draw->
blend[i]) {
641 for (j = 0; j < vec_size; j++) {
645 sprite_vector_free(&draw->
layer[i].
base);
677 return t->
type == TS_ISOMETRIC;
827 return MAX(uk_bottom, u_bottom);
839 return MAX(uk_bottom, u_bottom);
967 log_error(
"Wrong direction8 variant: %d.", dir);
978 for (dir = direction8_begin();
979 dir != direction8_end();
980 dir = direction8_next(dir)) {
986 return direction8_invalid();
996 return dir != DIR8_NORTHEAST && dir != DIR8_SOUTHWEST;
998 return dir != DIR8_NORTHWEST && dir != DIR8_SOUTHEAST;
1011 enum direction8 dir)
1016 return (dir == DIR8_NORTH || dir == DIR8_EAST
1017 || dir == DIR8_SOUTH || dir == DIR8_WEST);
1029 if ((actual_topology & TF_HEX)
1030 && (actual_topology & TF_ISO)) {
1032 }
else if (actual_topology & TF_ISO) {
1034 }
else if (actual_topology & TF_HEX) {
1049 static struct strvec *tilesets[3] = { NULL, NULL, NULL };
1057 if (tilesets[idx] == NULL) {
1074 return tilesets[idx];
1110 const char *us_capstr,
1111 const char *filename,
1118 if (NULL == file_capstr) {
1119 log_base(
level,
"\"%s\": %s file doesn't have a capability string",
1132 "that client doesn't support:", filename, which);
1172 for (i = 0; i < ESTYLE_COUNT; i++) {
1185 struct tileset_layer *tslp = &t->
layers[i];
1187 if (tslp->match_types) {
1188 for (j = 0; j < tslp->match_count; j++) {
1189 free(tslp->match_types[j]);
1191 free(tslp->match_types);
1192 tslp->match_types = NULL;
1241 bool global_default)
1245 if (tileset_name == NULL
1279 if (global_default) {
1300 bool game_fully_initialized,
float scale)
1305 const char *
name = new_tileset_name ? new_tileset_name :
tileset->
name;
1306 char tileset_name[strlen(
name) + 1], old_name[strlen(
tileset->
name) + 1];
1307 bool new_tileset_in_use;
1314 log_normal(
_(
"Loading tileset \"%s\"."), tileset_name);
1328 if (strcmp(tileset_name, old_name) == 0 &&
tileset->
scale == 1.0f
1344 new_tileset_in_use =
TRUE;
1346 new_tileset_in_use =
FALSE;
1349 log_fatal(
"Failed to re-read the currently loaded tileset.");
1354 if (game_fully_initialized) {
1358 if (game_fully_initialized) {
1385 return new_tileset_in_use;
1391 _(
"Map topology (%s) and tileset (%s) incompatible."),
1426 return new_tileset_in_use;
1442 return new_tileset_in_use;
1451 const char *tileset_name;
1471 fc_assert_ret(NULL != tileset_name && tileset_name[0] !=
'\0');
1502 while ((gfx_fileext = *gfx_fileexts++)) {
1503 const char *real_full_name;
1504 char full_name[strlen(gfx_filename) + strlen(
".")
1505 + strlen(gfx_fileext) + 1];
1507 sprintf(full_name,
"%s.%s", gfx_filename, gfx_fileext);
1509 log_debug(
"trying to load gfx file \"%s\".", real_full_name);
1517 log_error(
"Could not load gfx file \"%s\".", gfx_filename);
1527 const char *gfx_filename;
1539 _(
"Could not open '%s':\n%s"), sf->
file_name,
1546 _(
"Specfile %s has incompatible capabilities"),
1556 _(
"Could not load gfx file for the spec file \"%s\"."),
1571 struct section_list *sections;
1576 _(
"Could not open '%s':\n%s"),
1582 _(
"Specfile %s has incompatible capabilities"), sf->
file_name);
1594 int x_top_left, y_top_left, dx, dy;
1607 "%s.y_top_left", sec_name)
1631 log_error(
"%s small sprite \"%s.tiles%d\" invalid: %s",
1643 xr = x_top_left + (dx + pixel_border_x) * column;
1644 yb = y_top_left + (dy + pixel_border_y) * row;
1660 if (!duplicates_ok) {
1661 for (k = 0; k < num_tags; k++) {
1662 if (!sprite_hash_insert(t->
sprite_hash, tags[k], ss)) {
1663 log_error(
"warning: %s already has a sprite for \"%s\".",
1668 for (k = 0; k < num_tags; k++) {
1669 (void) sprite_hash_replace(t->
sprite_hash, tags[k], ss);
1677 section_list_destroy(sections);
1685 const char *filename;
1690 "extra.sprites%d.tag", i))
1692 "extra.sprites%d.file", i))) {
1693 log_error(
"%s extra sprite \"extra.sprites%d\" invalid: %s",
1710 if (!duplicates_ok) {
1711 for (k = 0; k < num_tags; k++) {
1712 if (!sprite_hash_insert(t->
sprite_hash, tags[k], ss)) {
1713 log_error(
"warning: %s already have a sprite for \"%s\".",
1718 for (k = 0; k < num_tags; k++) {
1719 (void) sprite_hash_replace(t->
sprite_hash, tags[k], ss);
1736 const char *gfx_current_fileext;
1739 while ((gfx_current_fileext = *gfx_fileexts++)) {
1740 const char *real_full_name;
1742 fc_malloc(strlen(gfx_filename) + strlen(
".")
1743 + strlen(gfx_current_fileext) + 1);
1745 sprintf(full_name,
"%s.%s", gfx_filename, gfx_current_fileext);
1749 if (real_full_name) {
1755 _(
"Couldn't find a supported gfx file extension for \"%s\"."),
1786 bool verbose,
int topology_id,
1793 size_t num_spec_files;
1794 const char **spec_filenames;
1796 const char **layer_order;
1797 size_t num_preferred_themes;
1798 struct section_list *sections = NULL;
1799 const char *file_capstr;
1800 bool duplicates_ok, is_hex;
1801 enum direction8 dir;
1803 const char *extraname;
1810 log_error(
"Can't find tileset \"%s\".", tileset_name);
1832 duplicates_ok = (NULL != file_capstr
1839 if (tstr[0] !=
'\0') {
1848 if (tstr[0] !=
'\0') {
1864 if (tstr[0] !=
'\0') {
1900 if (!ts_type_is_valid(t->
type)) {
1901 log_error(
"Tileset \"%s\": unknown tileset type \"%s\"", t->
name, tstr);
1905 if (t->
type == TS_ISOMETRIC) {
1920 hex_side = hex_side * t->
scale;
1921 if (t->
type == TS_ISOMETRIC) {
1932 t->
type = TS_ISOMETRIC;
1935 if (topology_id >= 0) {
1936 if (((topology_id & TF_HEX) && topology_id != (topo & (TF_ISO | TF_HEX)))
1937 || (!(topology_id & TF_HEX) && (topo & TF_HEX))) {
1947 log_normal(
_(
"Client does not support %s tilesets."),
1948 _(ts_type_name(t->
type)));
1972 }
while (dir != DIR8_NORTH);
1978 "tilespec.normal_tile_width")
1980 "tilespec.normal_tile_height")) {
1986 if (
scale != 1.0f) {
1988 while (i % 8 != 0) {
1995 if (t->
type == TS_ISOMETRIC) {
2011 "tilespec.small_tile_width")
2013 "tilespec.small_tile_height")) {
2025 log_verbose(
"tile sizes %dx%d, %d%d unit, %d%d small",
2037 if (!fog_style_is_valid(t->
fogstyle)) {
2038 log_error(
"Tileset \"%s\": unknown fog_style \"%s\"", t->
name, tstr);
2050 log_error(
"Tileset \"%s\": unknown darkness_style \"%s\"", t->
name, tstr);
2056 log_error(
"Invalid darkness style set in tileset \"%s\".", t->
name);
2061 "tilespec.unit_flag_offset_x")
2063 "tilespec.unit_flag_offset_y")
2065 "tilespec.city_flag_offset_x")
2067 "tilespec.city_flag_offset_y")
2069 "tilespec.unit_offset_x")
2071 "tilespec.unit_offset_y")
2073 "tilespec.activity_offset_x")
2075 "tilespec.activity_offset_y")
2077 "tilespec.select_offset_x")
2079 "tilespec.select_offset_y")
2081 "tilespec.stack_size_offset_x")
2083 "tilespec.stack_size_offset_y")
2085 "tilespec.city_offset_x")
2087 "tilespec.city_offset_y")
2089 "tilespec.city_size_offset_x")
2091 "tilespec.city_size_offset_y")
2093 "tilespec.citybar_offset_y")
2095 "tilespec.tilelabel_offset_y")
2097 "tilespec.occupied_offset_x")
2099 "tilespec.occupied_offset_y")) {
2105 "tilespec.unit_upkeep_offset_y");
2107 "tilespec.unit_upkeep_small_offset_y");
2128 if (t->
scale != 1.0f
2132 if (t->
scale != 1.0f
2138 "tilespec.unit_default_orientation");
2145 if (!direction8_is_valid(dir)) {
2147 _(
"Unknown unit_default_orientation \"%s\""), c);
2163 "tilespec.layer_order");
2165 for (i = 0; i < num_layers; i++) {
2167 enum mapview_layer layer = mapview_layer_by_name(
layer_order[i],
2171 if (!mapview_layer_is_valid(layer)) {
2172 log_error(
"layer_order: Invalid layer \"%s\" in %s",
2177 for (j = 0; j < i; j++) {
2179 log_error(
"layer_order: Duplicate layer \"%s\" in %s",
2189 for (i = 0; i < LAYER_COUNT; i++) {
2193 for (j = 0; j < num_layers; j++) {
2200 log_error(
"layer_order: Missing layer \"%s\" in %s",
2209 for (i = 0; i < LAYER_COUNT; i++) {
2216 struct tileset_layer *tslp = &t->
layers[i];
2221 "layer%d.match_types", i);
2222 for (j = 0; j < tslp->match_count; j++) {
2223 tslp->match_types[j] =
fc_strdup(tslp->match_types[j]);
2225 for (k = 0; k < j; k++) {
2226 if (tslp->match_types[k][0] == tslp->match_types[j][0]) {
2228 _(
"[layer%d] match_types: \"%s\" initial "
2229 "('%c') is not unique."),
2230 i, tslp->match_types[j], tslp->match_types[j][0]);
2239 if (NULL == sections || 0 == section_list_size(sections)) {
2241 _(
"No [%s] sections present."),
2254 const char *terrain_name;
2258 if (terrain_name != NULL) {
2279 struct drawing_layer *dlp = &draw->
layer[l];
2280 struct tileset_layer *tslp = &t->
layers[l];
2281 const char *match_type;
2282 const char **match_with;
2294 dlp->offset_x = ceil(t->
scale * dlp->offset_x);
2295 dlp->offset_y = ceil(t->
scale * dlp->offset_y);
2298 "%s.layer%d_match_type",
2304 for (j = 0; j < tslp->match_count; j++) {
2309 if (j >= tslp->match_count) {
2310 log_error(
"[%s] invalid match_type \"%s\" in %s.",
2313 dlp->match_index[dlp->match_indices++] = j;
2318 "%s.layer%d_match_with",
2324 log_error(
"[%s] match_with has too many types (%d, max %d) in %s",
2330 if (1 < dlp->match_indices) {
2331 log_error(
"[%s] previous match_with ignored in %s.",
2333 dlp->match_indices = 1;
2334 }
else if (1 > dlp->match_indices) {
2335 log_error(
"[%s] missing match_type, using \"%s\" in %s.",
2337 dlp->match_index[0] = 0;
2338 dlp->match_indices = 1;
2341 for (k = 0; k < count; k++) {
2342 for (j = 0; j < tslp->match_count; j++) {
2343 if (
fc_strcasecmp(tslp->match_types[j], match_with[k]) == 0) {
2347 if (j >= tslp->match_count) {
2348 log_error(
"[%s] layer%d_match_with: invalid \"%s\".",
2349 sec_name, l, match_with[k]);
2350 }
else if (1 < count) {
2353 for (m = 0; m < dlp->match_indices; m++) {
2354 if (dlp->match_index[m] == j) {
2355 log_error(
"[%s] layer%d_match_with: duplicate \"%s\" in %s.",
2360 if (m >= dlp->match_indices) {
2361 dlp->match_index[dlp->match_indices++] = j;
2364 dlp->match_index[dlp->match_indices++] = j;
2372 switch (dlp->match_indices) {
2378 if (dlp->match_index[0] == dlp->match_index[1] ) {
2394 switch (dlp->sprite_type) {
2400 || dlp->offset_x > 0
2401 || dlp->offset_y > 0) {
2402 log_error(
"[%s] layer %d: you cannot have tall terrain or\n"
2403 "a sprite offset with a cell-based drawing method in %s.",
2405 dlp->is_tall =
FALSE;
2406 dlp->offset_x = dlp->offset_y = 0;
2413 log_error(
"warning: multiple tile sections containing terrain tag \"%s\" in %s.",
2418 section_list_destroy(sections);
2423 for (i = 0; i < ESTYLE_COUNT; i++) {
2429 "extras.styles%d.name",
2431 const char *style_name;
2432 enum extrastyle_id style;
2435 "extras.styles%d.style", i);
2437 if (!extrastyle_id_is_valid(style)) {
2438 log_error(
"Unknown extra style \"%s\" for extra \"%s\" in %s.",
2443 if (!estyle_hash_insert(t->
estyle_hash, extraname, style)) {
2444 log_error(
"warning: duplicate extrastyle entry [%s] in %s.",
2452 if (NULL == spec_filenames || 0 == num_spec_files) {
2453 log_error(
"No tile graphics files specified in \"%s\"", fname);
2459 for (i = 0; i < num_spec_files; i++) {
2463 log_debug(
"spec file %s", spec_filenames[i]);
2469 log_error(
"Can't find spec file \"%s\".", spec_filenames[i]);
2476 specfile_list_prepend(t->
specfiles, sf);
2478 free(spec_filenames);
2485 "tilespec.preferred_themes");
2486 if (num_preferred_themes <= 0) {
2489 "tilespec.prefered_themes");
2490 if (num_preferred_themes > 0) {
2492 " Use correct spelling tilespec.preferred_themes instead");
2511 if (NULL != sections) {
2512 section_list_destroy(sections);
2536 log_error(
"Unknown citizen type: %d.", (
int) citizen);
2552 int value = (idx >> i) & 1;
2572 int value = (idx >> i) & 1;
2589 bool scale,
bool smooth)
2616 h, NULL, -1, -1, t->
scale, smooth);
2625 _(
"Couldn't load gfx file \"%s\" for sprite '%s'."),
2633 if (ss->
x < 0 || ss->
x + ss->
width > sf_w
2634 || ss->
y < 0 || ss->
y + ss->
height > sf_h) {
2636 _(
"Sprite '%s' in file \"%s\" isn't within the image!"),
2705#define SET_SPRITE(field, tag) \
2707 t->sprites.field = load_sprite(t, tag, TRUE, TRUE); \
2708 if (t->sprites.field == NULL) { \
2709 tileset_error(LOG_FATAL, tileset_name_get(t), \
2710 _("Sprite for tag '%s' missing."), tag); \
2715#define SET_SPRITE_NOTSMOOTH(field, tag) \
2717 t->sprites.field = load_sprite(t, tag, TRUE, FALSE); \
2718 if (t->sprites.field == NULL) { \
2719 tileset_error(LOG_FATAL, tileset_name_get(t), \
2720 _("Sprite for tag '%s' missing."), tag); \
2724#define SET_SPRITE_UNSCALED(field, tag) \
2726 t->sprites.field = load_sprite(t, tag, FALSE, FALSE); \
2727 if (t->sprites.field == NULL) { \
2728 tileset_error(LOG_FATAL, tileset_name_get(t), \
2729 _("Sprite for tag '%s' missing."), tag); \
2734#define SET_SPRITE_ALT(field, tag, alt) \
2736 t->sprites.field = load_sprite(t, tag, TRUE, TRUE); \
2737 if (!t->sprites.field) { \
2738 t->sprites.field = load_sprite(t, alt, TRUE, TRUE); \
2740 if (t->sprites.field == NULL) { \
2741 tileset_error(LOG_FATAL, tileset_name_get(t), \
2742 _("Sprite for tags '%s' and alternate '%s' are " \
2743 "both missing."), tag, alt); \
2748#define SET_SPRITE_OPT(field, tag) \
2749 t->sprites.field = load_sprite(t, tag, TRUE, TRUE)
2751#define SET_SPRITE_ALT_OPT(field, tag, alt) \
2753 t->sprites.field = tiles_lookup_sprite_tag_alt(t, LOG_VERBOSE, tag, alt,\
2754 "sprite", #field, TRUE); \
2771 fc_snprintf(buffer,
sizeof(buffer),
"%s_%d", tag, j);
2821 _(
"No graphics for specialist \"%s\"."), tag);
2847 _(
"No graphics for citizen \"%s\"."),
name);
2859 const struct city *pcity)
2872 if (num_thresholds == 0) {
2895 char *graphic,
char *graphic_alt,
2899 char *gfx_in_use = graphic;
2900 int num_thresholds = 0;
2908 gfx_in_use, tag,
size);
2911 *thresholds =
fc_realloc(*thresholds, num_thresholds *
sizeof(**thresholds));
2912 (*thresholds)[num_thresholds - 1].sprite =
sprite;
2913 }
else if (
size == 0) {
2914 if (gfx_in_use == graphic) {
2917 gfx_in_use = graphic_alt;
2925 return num_thresholds;
2985 char buffer[512], buffer2[512];
2995 const char *names[] = {
"science_bulb",
"warming_sun",
"cooling_flake"};
2998 fc_snprintf(buffer,
sizeof(buffer),
"s.%s_%d", names[j], i);
3006 if (t->
type == TS_ISOMETRIC) {
3015 SET_SPRITE(mask.worked_tile,
"mask.worked_tile");
3016 SET_SPRITE(mask.unworked_tile,
"mask.unworked_tile");
3026 = {
"solar_panels",
"life_support",
"habitation",
3027 "structural",
"fuel",
"propulsion",
"exhaust"};
3029 fc_snprintf(buffer,
sizeof(buffer),
"spaceship.%s", names[i]);
3036 {
"goto",
"patrol",
"paradrop",
"nuke",
"select",
3037 "invalid",
"attack",
"edit_paint",
"edit_add",
"wait"};
3041 fc_snprintf(buffer,
sizeof(buffer),
"cursor.%s%d", names[i], f);
3043 if (sprite_hash_lookup(t->
sprite_hash, buffer, &ss)) {
3051 const char *names[
ICON_COUNT] = {
"freeciv",
"citydlg"};
3053 fc_snprintf(buffer,
sizeof(buffer),
"icon.%s", names[i]);
3057 for (i = 0; i < E_COUNT; i++) {
3066 for (i = 0; ; i++) {
3069 fc_snprintf(buffer,
sizeof(buffer),
"explode.unit_%d", i);
3097 fc_snprintf(buffer,
sizeof(buffer),
"unit.battlegroup_%d", i);
3098 fc_snprintf(buffer2,
sizeof(buffer2),
"city.size_%d", i + 1);
3108 fc_snprintf(buffer,
sizeof(buffer),
"unit.hp_%d", i*10);
3115 fc_snprintf(buffer,
sizeof(buffer),
"unit.vet_%d", i);
3122 fc_snprintf(buffer,
sizeof(buffer),
"unit.select%d", i);
3127 SET_SPRITE(citybar.shields,
"citybar.shields");
3130 SET_SPRITE(citybar.occupied,
"citybar.occupied");
3131 SET_SPRITE(citybar.background,
"citybar.background");
3133 for (i = 0; ; i++) {
3136 fc_snprintf(buffer,
sizeof(buffer),
"citybar.occupancy_%d", i);
3145 _(
"Missing necessary citybar.occupancy_N sprites."));
3148#define SET_EDITOR_SPRITE(x) SET_SPRITE(editor.x, "editor." #x)
3165#undef SET_EDITOR_SPRITE
3173#define SET_GOTO_TURN_SPRITE(state, state_name, factor, factor_name) \
3174 fc_snprintf(buffer, sizeof(buffer), "path." state_name "_%d" #factor, i); \
3175 SET_SPRITE_OPT(path.s[state].turns ## factor_name [i], buffer); \
3176 if (t->sprites.path.s[state].turns ## factor_name [i] == NULL) { \
3177 t->sprites.path.s[state].turns ## factor_name [i] = \
3178 t->sprites.path.s[GTS_MP_LEFT].turns ## factor_name [i]; \
3182 fc_snprintf(buffer,
sizeof(buffer),
"city.size_%d", i);
3184 fc_snprintf(buffer2,
sizeof(buffer2),
"path.turns_%d", i);
3189 fc_snprintf(buffer,
sizeof(buffer),
"city.size_%d0", i);
3191 fc_snprintf(buffer2,
sizeof(buffer2),
"path.turns_%d0", i);
3196 fc_snprintf(buffer,
sizeof(buffer),
"city.size_%d00", i);
3198 fc_snprintf(buffer2,
sizeof(buffer2),
"path.turns_%d00", i);
3204 fc_snprintf(buffer,
sizeof(buffer),
"city.t_food_%d", i);
3206 fc_snprintf(buffer,
sizeof(buffer),
"city.t_shields_%d", i);
3208 fc_snprintf(buffer,
sizeof(buffer),
"city.t_trade_%d", i);
3211#undef SET_GOTO_TURN_SPRITE
3215 fc_strlcpy(buffer,
"upkeep.unhappy",
sizeof(buffer));
3218 fc_snprintf(buffer2,
sizeof(buffer2),
"upkeep.unhappy%d", i+1);
3245 SET_SPRITE(user.attention,
"user.attention");
3246 SET_SPRITE(user.infratile,
"user.infratile");
3256 for (i = 0; ; i++) {
3259 fc_snprintf(buffer,
sizeof(buffer),
"colors.overlay_%d", i);
3268 _(
"Missing overlay-color sprite colors.overlay_0."));
3278 struct sprite *worked, *unworked;
3294 SET_SPRITE(grid.unavailable,
"grid.unavailable");
3321 for (be = 0; be < 2; be++) {
3322 fc_snprintf(buffer,
sizeof(buffer),
"grid.borders.%c",
3333 case DARKNESS_ISORECT:
3338 int offsets[4][2] = {{ntw / 2, 0}, {0, nth / 2}, {ntw / 2, nth / 2}, {0, 0}};
3342 _(
"Sprite tx.darkness missing."));
3344 for (i = 0; i < 4; i++) {
3346 offsets[i][1], ntw / 2,
3347 nth / 2, NULL, 0, 0, 1.0f,
3352 case DARKNESS_CARD_SINGLE:
3356 fc_snprintf(buffer,
sizeof(buffer),
"tx.darkness_%s",
3361 case DARKNESS_CARD_FULL:
3363 fc_snprintf(buffer,
sizeof(buffer),
"tx.darkness_%s",
3368 case DARKNESS_CORNER:
3371 for (i = 0; i < 81; i++) {
3373 char ids[] = {
'u',
'f',
'k'};
3374 char buf[512] =
"t.fog";
3375 int values[4], vi, k = i;
3377 for (vi = 0; vi < 4; vi++) {
3381 cat_snprintf(buf,
sizeof(buf),
"_%c", ids[values[vi]]);
3408 if (store->
spec[i] == NULL) {
3414 fc_snprintf(buffer,
sizeof(buffer),
"%s_outlet_%s",
3417 if (store->
outlet[i] == NULL) {
3418 log_error(
"Missing \"%s\" for \"%s\".", buffer, tag_pfx);
3435 if (sf->big_sprite) {
3437 sf->big_sprite = NULL;
3460 const char *tag,
const char *alt,
3469 "attempt to lookup for %s \"%s\" before "
3470 "sprite_hash setup", what,
name);
3478 "(instead of \"%s\") for %s \"%s\".",
3479 alt, tag, what,
name);
3484 _(
"Don't have graphics tags \"%s\" or \"%s\" for %s \"%s\"."),
3485 tag, alt, what,
name);
3496 const char *base_str,
3497 enum direction8 dir,
3501 enum direction8 loaddir = dir;
3516 loaddir =
dir_cw(loaddir);
3541 int uidx,
const char *tag)
3543 bool has_icon, facing_sprites =
TRUE;
3548#define LOAD_FACING_SPRITE(dir) \
3549 if (!tileset_setup_unit_direction(t, uidx, tag, dir, has_icon)) { \
3550 facing_sprites = FALSE; \
3562 if (!has_icon && !facing_sprites) {
3569#undef LOAD_FACING_SPRITE
3589 _(
"Unit type %s has no unoriented sprite and "
3590 "tileset has no unit_default_orientation."),
3644 enum extrastyle_id extrastyle;
3653 if (!estyle_hash_lookup(t->
estyle_hash, tag, &extrastyle)) {
3655 if (!estyle_hash_lookup(t->
estyle_hash, tag, &extrastyle)) {
3657 _(
"No extra style for \"%s\" or \"%s\"."),
3662 "(instead of \"%s\") for extra \"%s\".",
3670 extra_type_list_append(t->
style_lists[extrastyle], pextra);
3676 switch (extrastyle) {
3681 case ESTYLE_ROAD_ALL_SEPARATE:
3682 case ESTYLE_ROAD_PARITY_COMBINED:
3683 case ESTYLE_ROAD_ALL_COMBINED:
3688 case ESTYLE_SINGLE1:
3689 case ESTYLE_SINGLE2:
3693 case ESTYLE_CARDINALS:
3713 _(
"No cardinal-style graphics \"%s*\" for "
3740 _(
"Missing %s building activity sprite for tags \"%s\" and alternatives \"%s\" and \"%s\"."),
3756 _(
"Missing %s removal activity sprite for tags \"%s\" and alternative \"%s\"."),
3771 char full_tag_name[
MAX_LEN_NAME +
sizeof(
"_isolated")];
3778 if (extrastyle == ESTYLE_ROAD_ALL_SEPARATE
3779 || extrastyle == ESTYLE_ROAD_PARITY_COMBINED) {
3781 "%s_isolated", tag);
3786 if (extrastyle == ESTYLE_ROAD_ALL_SEPARATE) {
3794 "%s_%s", tag, dir_name);
3798 }
else if (extrastyle == ESTYLE_ROAD_PARITY_COMBINED) {
3807 for (i = 1; i < num_index; i++) {
3808 char c[64] =
"", d[64] =
"";
3811 int value = (i >> j) & 1;
3831 }
else if (extrastyle == ESTYLE_ROAD_ALL_COMBINED) {
3838 "%s_%s", tag, idx_str);
3842 }
else if (extrastyle == ESTYLE_RIVER) {
3845 _(
"No river-style graphics \"%s*\" for extra \"%s\""),
3854 if (extrastyle == ESTYLE_ROAD_ALL_SEPARATE
3855 || extrastyle == ESTYLE_ROAD_PARITY_COMBINED) {
3885 strcat(full_tag_name,
"_bg");
3890 strcat(full_tag_name,
"_mg");
3895 strcat(full_tag_name,
"_fg");
3904 _(
"No graphics with tag \"%s_bg/mg/fg\" for extra \"%s\""),
3914 const struct terrain *pterrain)
3924 _(
"Terrain \"%s\": no graphic tile \"%s\" or \"%s\"."),
3936 struct drawing_layer *dlp = &draw->
layer[l];
3937 struct tileset_layer *tslp = &t->
layers[l];
3938 sprite_vector_init(&dlp->base);
3939 sprite_vector_init(&dlp->allocated);
3941 switch (dlp->sprite_type) {
3943 switch (dlp->match_style) {
3946 for (i = 0; ; i++) {
3948 l, draw->
name, i + 1);
3953 sprite_vector_reserve(&dlp->base, i + 1);
3957 if (0 == i && 0 == l) {
3960 _(
"Missing base sprite for tag \"%s\"."), buffer);
3966 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_%s",
3982 const int count = dlp->match_indices;
3985 switch (dlp->match_style) {
4004 =
fc_calloc(number,
sizeof(*dlp->cells));
4006 for (i = 0; i < number; i++) {
4010 switch (dlp->match_style) {
4012 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_cell_%c",
4020 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_cell_%c%d%d%d",
4022 (value) & 1, (value >> 1) & 1, (value >> 2) & 1);
4025 "same cell terrain",
4029 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_cell_%c_%c_%c_%c",
4031 tslp->match_types[dlp->match_index[(value) & 1]][0],
4032 tslp->match_types[dlp->match_index[(value >> 1) & 1]][0],
4033 tslp->match_types[dlp->match_index[(value >> 2) & 1]][0]);
4036 "cell pair terrain",
4041 int this = dlp->match_index[0];
4045 v1 = dlp->match_index[value % count];
4047 v2 = dlp->match_index[value % count];
4049 v3 = dlp->match_index[value % count];
4051 fc_assert(v1 < count && v2 < count && v3 < count);
4085 "t.l%d.cellgroup_%c_%c_%c_%c", l,
4086 tslp->match_types[
n][0], tslp->match_types[e][0],
4087 tslp->match_types[s][0], tslp->match_types[w][0]);
4092 int vec_size = sprite_vector_size(&dlp->allocated);
4096 int x[4] = {W / 4, W / 4, 0, W / 2};
4097 int y[4] = {
H / 2, 0,
H / 4,
H / 4};
4098 int xo[4] = {0, 0, -W / 2, W / 2};
4099 int yo[4] = {
H / 2, -
H / 2, 0, 0};
4106 sprite_vector_reserve(&dlp->allocated, vec_size + 1);
4107 dlp->allocated.p[vec_size] =
sprite;
4109 log_error(
"Terrain graphics sprite for tag \"%s\" missing.", buffer);
4137 && li < draw->blending
4148 "base (blend) terrain",
4157 const int offsets[4][2] = {
4158 {W / 2, 0}, {0,
H / 2}, {W / 2,
H / 2}, {0, 0}
4162 for (; dir < 4; dir++) {
4164 offsets[dir][1], W / 2,
H / 2,
4200 struct sprite *flag = NULL, *shield = NULL;
4203 for (i = 0; tags[i] && !flag; i++) {
4207 for (i = 0; tags[i] && !shield; i++) {
4208 fc_snprintf(buf,
sizeof(buf),
"f.shield.%s", tags[i]);
4211 if (!flag || !shield) {
4228 const struct city *pcity)
4248#define FULL_TILE_X_OFFSET ((t->normal_tile_width - t->full_tile_width) / 2)
4249#define FULL_TILE_Y_OFFSET (t->normal_tile_height - t->full_tile_height)
4251#define ADD_SPRITE(s, draw_fog, x_offset, y_offset) \
4252 (fc_assert(s != NULL), \
4254 sprs->foggable = (draw_fog && t->fogstyle == FOG_AUTO), \
4255 sprs->offset_x = x_offset, \
4256 sprs->offset_y = y_offset, \
4258#define ADD_SPRITE_SIMPLE(s) ADD_SPRITE(s, TRUE, 0, 0)
4259#define ADD_SPRITE_FULL(s) \
4260 ADD_SPRITE(s, TRUE, FULL_TILE_X_OFFSET, FULL_TILE_Y_OFFSET)
4271 struct terrain **tterrain_near,
4272 bv_extras *textras_near)
4274 enum direction8 dir;
4277 for (dir = 0; dir < 8; dir++) {
4283 if (NULL != terrain1) {
4284 tterrain_near[dir] = terrain1;
4288 log_error(
"build_tile_data() tile (%d,%d) has no terrain!",
4293 tterrain_near[dir] = pterrain;
4304 enum direction8 facing)
4313 return sprs - save_sprs;
4322 int stack,
bool backdrop)
4357 case ACTIVITY_PLANT:
4360 case ACTIVITY_IRRIGATE:
4367 case ACTIVITY_CULTIVATE:
4370 case ACTIVITY_POLLUTION:
4371 case ACTIVITY_FALLOUT:
4374 case ACTIVITY_PILLAGE:
4377 case ACTIVITY_EXPLORE:
4380 case ACTIVITY_FORTIFIED:
4383 case ACTIVITY_FORTIFYING:
4386 case ACTIVITY_SENTRY:
4392 case ACTIVITY_TRANSFORM:
4396 case ACTIVITY_GEN_ROAD:
4399 case ACTIVITY_CONVERT:
4420 case SSA_AUTOSETTLER:
4423 case SSA_AUTOEXPLORE:
4481 }
else if (stack > 1) {
4499 return sprs - save_sprs;
4508 bool road,
bool *road_near,
4509 bool hider,
bool *hider_near)
4542 && (road_near[cwdir] && road_near[ccwdir]
4543 && !(hider_near[cwdir] && hider_near[ccwdir]))
4544 && !(
road && road_near[dir] && !(hider && hider_near[dir]))) {
4550 return sprs - saved_sprs;
4560 bv_extras *textras_near,
4561 struct terrain *tterrain_near[8],
4562 const struct city *pcity)
4565 bool road, road_near[8], hider, hider_near[8];
4566 bool land_near[8], hland_near[8];
4567 bool draw_road[8], draw_single_road;
4568 enum direction8 dir;
4571 enum extrastyle_id extrastyle;
4583 for (i = 0; i < 8; i++) {
4584 land_near[i] =
FALSE;
4604 draw_single_road =
TRUE;
4606 draw_single_road =
FALSE;
4609 for (dir = 0; dir < 8; dir++) {
4615 road_near[dir] =
FALSE;
4618 road_near[dir] =
TRUE;
4623 land_near[dir] = (tterrain_near[dir] !=
T_UNKNOWN
4627 road_near[dir] =
FALSE;
4628 land_near[dir] =
FALSE;
4634 roads_exist =
road && (road_near[dir] || land_near[dir]);
4635 draw_road[dir] = roads_exist;
4636 hider_near[dir] =
FALSE;
4637 hland_near[dir] = tterrain_near[dir] !=
T_UNKNOWN
4640 bool hider_dir =
FALSE;
4641 bool land_dir =
FALSE;
4646 hider_near[dir] =
TRUE;
4654 if (hider_dir || land_dir) {
4656 draw_road[dir] =
FALSE;
4668 if (draw_single_road && road_near[dir]) {
4669 draw_single_road =
FALSE;
4677 if (extrastyle == ESTYLE_ROAD_ALL_SEPARATE) {
4691 }
else if (extrastyle == ESTYLE_ROAD_PARITY_COMBINED) {
4700 int road_even_tileno = 0, road_odd_tileno = 0, i;
4706 if (draw_road[even]) {
4707 road_even_tileno |= 1 << i;
4709 if (draw_road[odd]) {
4710 road_odd_tileno |= 1 << i;
4715 if (road_even_tileno != 0) {
4718 if (road_odd_tileno != 0) {
4722 }
else if (extrastyle == ESTYLE_ROAD_ALL_COMBINED) {
4729 int road_tileno = 0, i;
4734 if (draw_road[vdir]) {
4735 road_tileno |= 1 << i;
4739 if (road_tileno != 0 || draw_single_road) {
4749 if (extrastyle == ESTYLE_ROAD_ALL_SEPARATE
4750 || extrastyle == ESTYLE_ROAD_PARITY_COMBINED) {
4751 if (draw_single_road) {
4756 return sprs - saved_sprs;
4770 bv_extras *textras_near)
4791 bv_extras *textras_near,
4792 const struct city *pcity)
4804 bool hidden =
FALSE;
4823 return sprs - saved_sprs;
4832 const struct tile *ptile,
4833 const struct city *citymode)
4835 const struct city *pcity;
4836 const struct city *pwork;
4837 struct unit *psettler;
4856 if (pcity && !pcity->
tile) {
4867 if (NULL != pwork && pwork == pcity) {
4872 }
else if (NULL != pwork && pwork == pcity
4903 return sprs - saved_sprs;
4912 const struct tile *ptile,
4913 const struct terrain *pterrain,
4914 struct terrain **tterrain_near)
4918 const int offsets[4][2] = {
4919 {W/2, 0}, {0,
H / 2}, {W / 2,
H / 2}, {0, 0}
4928 for (; dir < 4; dir++) {
4934 || pterrain == (other = tterrain_near[
DIR4_TO_DIR8[dir]])
4941 offsets[dir][0], offsets[dir][1]);
4944 return sprs - saved_sprs;
4952 const struct tile *ptile,
4969 for (i = 3; i >= 0; i--) {
4970 const int unknown = 0, fogged = 1, known = 2;
4973 if (!pcorner->
tile[i]) {
4990 tileno = tileno * 3 + value;
4998 return sprs - saved_sprs;
5007 const struct tile *ptile,
5008 const struct terrain *pterrain,
5009 struct terrain **tterrain_near,
5013 struct drawing_layer *dlp = &draw->
layer[l];
5015 int that = dlp->match_index[1];
5016 int ox = dlp->offset_x;
5017 int oy = dlp->offset_y;
5021 (t->sprites.drawing[terrain_index(tterrain_near[(dir)])]->num_layers > l \
5022 ? t->sprites.drawing[terrain_index(tterrain_near[(dir)])]->layer[l].match_index[0] \
5025 switch (dlp->sprite_type) {
5028 switch (dlp->match_style) {
5031 int count = sprite_vector_size(&dlp->base);
5053 if (
MATCH(dir) ==
this) {
5083 const int iso_offsets[4][2] = {
5084 {W / 4, 0}, {W / 4,
H / 2}, {W / 2,
H / 4}, {0,
H / 4}
5086 const int noniso_offsets[4][2] = {
5087 {0, 0}, {W / 2,
H / 2}, {W / 2, 0}, {0,
H / 2}
5092 const int count = dlp->match_indices;
5093 int array_index = 0;
5095 int x = (t->
type == TS_ISOMETRIC ? iso_offsets[i][0] : noniso_offsets[i][0]);
5096 int y = (t->
type == TS_ISOMETRIC ? iso_offsets[i][1] : noniso_offsets[i][1]);
5101 switch (dlp->match_style) {
5106 array_index = array_index * 2 + (m[2] !=
this);
5107 array_index = array_index * 2 + (m[1] !=
this);
5108 array_index = array_index * 2 + (m[0] !=
this);
5111 array_index = array_index * 2 + (m[2] == that);
5112 array_index = array_index * 2 + (m[1] == that);
5113 array_index = array_index * 2 + (m[0] == that);
5121 for (j = 0; j < 3; j++) {
5124 for (k = 0; k < count; k++) {
5126 if (m[j] == dlp->match_index[k]) {
5131 array_index = array_index * count +
n[2];
5132 array_index = array_index * count +
n[1];
5133 array_index = array_index * count +
n[0];
5140 s = dlp->cells[array_index];
5150 return sprs - saved_sprs;
5159 const struct tile *ptile,
5160 struct terrain **tterrain_near)
5164 struct tile *adjc_tile;
5166#define UNKNOWN(dir) \
5167 ((adjc_tile = mapstep(&(wld.map), ptile, (dir))) \
5168 && client_tile_get_known(adjc_tile) == TILE_UNKNOWN)
5173 case DARKNESS_ISORECT:
5174 for (i = 0; i < 4; i++) {
5176 int offsets[4][2] = {{W / 2, 0}, {0,
H / 2}, {W / 2,
H / 2}, {0, 0}};
5180 offsets[i][0], offsets[i][1]);
5184 case DARKNESS_CARD_SINGLE:
5191 case DARKNESS_CARD_FULL:
5208 case DARKNESS_CORNER:
5214 return sprs - saved_sprs;
5224 const struct tile *ptile,
5225 const struct terrain *pterrain,
5226 struct terrain **tterrain_near)
5232 ? (draw->
num_layers - layer_num - 1) : layer_num);
5257 return sprs - saved_sprs;
5285 const struct tile *ptile,
5289 const struct city *pcity,
5290 const struct city *citymode)
5301 int dummy_x, dummy_y;
5307 if (
tile && !citymode) {
5351 && pedge->
tile[0] && pedge->
tile[1]
5352 && known[0] && known[1]
5362 }
else if (known[0] || known[1]) {
5383 if (owner0 != owner1) {
5427 return sprs - saved_sprs;
5435 const struct tile *ptile,
5461 if (length >= 100) {
5467 if (length >= 1000) {
5483 static char last_reported[256] =
"";
5485 if (0 != strcmp(last_reported, t->
name)) {
5486 log_normal(
_(
"Tileset \"%s\" doesn't support long goto paths, "
5487 "such as %d. Path not displayed as expected."),
5494 return sprs - saved_sprs;
5503 bool no_disable =
TRUE;
5570 const struct tile *ptile,
5574 const struct city *citymode,
5578 bv_extras textras_near[8];
5580 struct terrain *tterrain_near[8];
5581 struct terrain *pterrain = NULL;
5595 int count = 0, i, cx, cy;
5596 const struct tile *
const *tiles = NULL;
5602 }
else if (pcorner) {
5603 tiles = pcorner->
tile;
5606 tiles = pedge->
tile;
5610 for (i = 0; i < count; i++) {
5625 if (NULL != pterrain) {
5626 if (layer == LAYER_TERRAIN1
5627 || layer == LAYER_TERRAIN2
5628 || layer == LAYER_TERRAIN3
5629 || layer == LAYER_WATER
5630 || layer == LAYER_ROADS) {
5634 log_error(
"fill_sprite_array() tile (%d,%d) has no terrain!",
5642 case LAYER_BACKGROUND:
5658 case LAYER_TERRAIN1:
5664 case LAYER_DARKNESS:
5670 case LAYER_TERRAIN2:
5676 case LAYER_TERRAIN3:
5684 if (NULL != pterrain) {
5694 if (
BV_ISSET(textras_near[didx], idx)) {
5723 if (proad != NULL) {
5742 if (NULL != pterrain) {
5746 textras, textras_near,
5747 tterrain_near, pcity);
5753 textras, textras_near,
5754 tterrain_near, pcity);
5760 textras, textras_near,
5761 tterrain_near, pcity);
5767 case LAYER_SPECIAL1:
5768 if (NULL != pterrain) {
5774 bool hidden =
FALSE;
5793 bool hidden =
FALSE;
5811 if (t->
type == TS_ISOMETRIC) {
5813 punit, pcity, citymode);
5835 struct sprite *spr = NULL;
5860 struct sprite *spr = NULL;
5882 case LAYER_SPECIAL2:
5883 if (NULL != pterrain) {
5889 bool hidden =
FALSE;
5908 bool hidden =
FALSE;
5926 case LAYER_FOCUS_UNIT:
5928 int stack_count = ptile ? unit_list_size(ptile->
units) : 0;
5929 bool backdrop = !pcity;
5942 if (t->
sprites.
unit.num_stack_sprites < stack_count
5945 stack_count *
sizeof(
struct sprite *));
5947 while (t->
sprites.
unit.num_stack_sprites < stack_count
5962 }
else if (putype != NULL && layer == LAYER_UNIT) {
5965 direction8_invalid());
5969 case LAYER_SPECIAL3:
5970 if (NULL != pterrain) {
5972 bool show_flag =
FALSE;
5979 bool hidden =
FALSE;
5998 if (eowner != NULL) {
6001 bool hidden =
FALSE;
6063 static char last_reported[256] =
"";
6065 if (0 != strcmp(last_reported, t->
name)) {
6066 log_normal(
_(
"Tileset \"%s\" doesn't support big cities size, "
6067 "such as %d. Size not displayed as expected."),
6076 if (t->
type == TS_OVERHEAD) {
6078 punit, pcity, citymode);
6082 case LAYER_OVERLAYS:
6090 case LAYER_TILELABEL:
6100 case LAYER_WORKERTASK:
6101 if (citymode != NULL && ptile != NULL) {
6103 if (ptask->ptile == ptile) {
6104 switch (ptask->act) {
6106 if (ptask->tgt == NULL) {
6116 case ACTIVITY_PLANT:
6121 case ACTIVITY_IRRIGATE:
6122 if (ptask->tgt == NULL) {
6132 case ACTIVITY_CULTIVATE:
6137 case ACTIVITY_GEN_ROAD:
6138 if (ptask->tgt != NULL) {
6144 case ACTIVITY_TRANSFORM:
6149 case ACTIVITY_POLLUTION:
6150 case ACTIVITY_FALLOUT:
6151 if (ptask->tgt != NULL) {
6179 case LAYER_INFRAWORK:
6180 if (ptile != NULL) {
6201 return sprs - save_sprs;
6230 fc_snprintf(buffer,
sizeof(buffer),
"bldg_%d", i);
6240 _(
"City style \"%s\": no city graphics."),
6245 _(
"City style \"%s\": no occupied graphics."),
6304 const struct city *citymode)
6308 if (
punit == NULL) {
6332 while (ss->ref_count > 0) {
6379 free(sf->file_name);
6380 if (sf->big_sprite) {
6382 sf->big_sprite = NULL;
6409 for (i = 1; i < t->
sprites.
unit.num_stack_sprites - 1; i++) {
6440 const struct city *pcity)
6442 const struct citizen_graphic *graphic;
6443 int gfx_index = citizen_index;
6445 if (pcity != NULL) {
6457 if (graphic->count == 0) {
6461 return graphic->
sprite[gfx_index % graphic->count];
6518 enum direction8 facing)
6521 bool icon = !direction8_is_valid(facing);
6525 if (!direction8_is_valid(facing) || !
is_valid_dir(facing)) {
6550 int num_thresholds =
6553 if (num_thresholds == 0) {
6557 .land_thresholds[num_thresholds - 1].sprite);
6658 int *hot_x,
int *hot_y,
int frame)
6733 const int *upkeep_cost)
6766 char *default_theme_name = NULL;
6767 size_t default_theme_name_sz = 0;
6798 if (NULL == default_theme_name || 0 == default_theme_name_sz) {
6809 default_theme_name_sz);
6815 log_verbose(
"The tileset doesn't specify preferred themes or none of its "
6816 "preferred themes can be used. Using system default.");
6844 for (j = 0; j < 2; j++) {
6872 struct terrain *tterrain_near[8];
6873 bv_extras textra_near[8];
6875 struct tile dummy_tile;
6880 memset(&dummy_tile, 0,
sizeof(
struct tile));
6882 for (i = 0; i < 8; i++) {
6883 tterrain_near[i] = pterrain;
6889 pterrain, tterrain_near, draw);
6891 return sprs - save_sprs;
6905 case ESTYLE_SINGLE1:
6906 case ESTYLE_SINGLE2:
6909 case ESTYLE_CARDINALS:
6912 case ESTYLE_ROAD_ALL_SEPARATE:
6913 case ESTYLE_ROAD_PARITY_COMBINED:
6914 case ESTYLE_ROAD_ALL_COMBINED:
6924 return sprs - saved_sprs;
6939 enum extrastyle_id extrastyle;
6941 if (!t || !sprs || !pextra) {
6953 if (extrastyle == ESTYLE_RIVER) {
6960 if (extrastyle == ESTYLE_ROAD_ALL_SEPARATE) {
6962 }
else if (extrastyle == ESTYLE_ROAD_PARITY_COMBINED) {
6966 }
else if (extrastyle == ESTYLE_ROAD_ALL_COMBINED) {
6972 return sprs - saved_sprs;
6987 if (!t || !sprs || !pextra) {
6997#define ADD_SPRITE_IF_NOT_NULL(x) do {\
6999 ADD_SPRITE_FULL(x);\
7008#undef ADD_SPRITE_IF_NOT_NULL
7010 return sprs - saved_sprs;
7029 case LAYER_BACKGROUND:
7030 case LAYER_TERRAIN1:
7031 case LAYER_DARKNESS:
7032 case LAYER_TERRAIN2:
7033 case LAYER_TERRAIN3:
7036 case LAYER_SPECIAL1:
7037 case LAYER_SPECIAL2:
7038 case LAYER_SPECIAL3:
7044 case LAYER_FOCUS_UNIT:
7049 case LAYER_OVERLAYS:
7050 case LAYER_TILELABEL:
7053 case LAYER_WORKERTASK:
7055 case LAYER_INFRAWORK:
7101 for (j = 0; j < 2; j++) {
7136 for (j = 0; j < 2; j++) {
7187 for (i = 0; i < ESTYLE_COUNT; i++) {
#define BV_ISSET(bv, bit)
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color * pcolor
struct canvas int int struct sprite int int int width
struct canvas int int struct sprite * psprite
struct canvas int int struct sprite int int offset_y
struct canvas int int struct sprite int offset_x
bool has_capabilities(const char *us, const char *them)
bool base_city_celebrating(const struct city *pcity)
struct citystyle * city_styles
const char * city_style_rule_name(const int style)
const char * get_output_identifier(Output_type_id output)
bool city_can_be_built_here(const struct civ_map *nmap, const struct tile *ptile, const struct unit *punit, bool hut_test)
bool city_base_to_city_map(int *city_map_x, int *city_map_y, const struct city *const pcity, const struct tile *map_tile)
bool city_tile_to_city_map(int *city_map_x, int *city_map_y, const int city_radius_sq, const struct tile *city_center, const struct tile *map_tile)
int city_tile_output(const struct city *pcity, const struct tile *ptile, bool is_celebrating, Output_type_id otype)
bool city_can_work_tile(const struct city *pcity, const struct tile *ptile)
static citizens city_size_get(const struct city *pcity)
#define output_type_iterate(output)
#define city_owner(_pcity_)
#define output_type_iterate_end
void generate_citydlg_dimensions(void)
int main(int argc, char *argv[])
enum client_states client_state(void)
enum known_type client_tile_get_known(const struct tile *ptile)
bool client_city_can_work_tile(const struct city *pcity, const struct tile *ptile)
static struct fc_sockaddr_list * list
void color_system_free(struct color_system *colors)
struct color * get_player_color(const struct tileset *t, const struct player *pplayer)
struct color_system * color_system_read(struct section_file *file)
struct color * ensure_color(struct rgbcolor *rgb)
bool player_has_color(const struct player *pplayer)
bool unit_is_in_focus(const struct unit *punit)
bool should_ask_server_for_actions(const struct unit *punit)
struct unit_list * get_units_in_focus(void)
struct unit * find_visible_unit(struct tile *ptile)
#define log_deprecation(message,...)
static void road(QVariant data1, QVariant data2)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction show_tileset_error
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction bool const char * tset_name
bool editor_is_active(void)
bool editor_tile_is_selected(const struct tile *ptile)
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type)
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
const char * get_event_tag(enum event_type event)
static struct @23 events[]
#define MAX_NUM_PLAYER_SLOTS
enum output_type_id Output_type_id
bool goto_is_active(void)
Government_type_id government_index(const struct government *pgovern)
const char * government_rule_name(const struct government *pgovern)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
bool is_view_supported(enum ts_type type)
void tileset_type_set(enum ts_type type)
enum gui_type get_gui_type(void)
void tileset_changed(void)
void get_sprite_dimensions(struct sprite *sprite, int *width, int *height)
void free_sprite(struct sprite *s)
struct sprite * sprite_scale(struct sprite *src, int new_w, int new_h)
struct sprite * load_gfxnumber(int num)
struct sprite * load_gfxfile(const char *filename)
struct sprite * crop_sprite(struct sprite *source, int x, int y, int width, int height, struct sprite *mask, int mask_offset_x, int mask_offset_y, float scale, bool smooth)
const char ** gfx_fileextensions(void)
bool popup_theme_suggestion_dialog(const char *theme_name)
void gui_clear_theme(void)
void boot_help_texts(void)
const char * improvement_rule_name(const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_fatal(message,...)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_base(level, message,...)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
struct startpos * map_startpos_get(const struct tile *ptile)
enum direction8 dir_ccw(enum direction8 dir)
bool is_valid_dir(enum direction8 dir)
enum direction8 dir_cw(enum direction8 dir)
struct tile * mapstep(const struct civ_map *nmap, const struct tile *ptile, enum direction8 dir)
static int img_index(const int x, const int y, const struct img *pimg)
struct city * find_city_or_settler_near_tile(const struct tile *ptile, struct unit **punit)
void update_map_canvas_visible(void)
enum topo_comp_lvl tileset_map_topo_compatible(int topology_id, struct tileset *tset, int *tset_topo)
struct tile * get_center_tile_mapcanvas(void)
bool mapdeco_is_highlight_set(const struct tile *ptile)
void center_tile_mapcanvas(const struct tile *ptile)
const struct tile * center_tile
struct tile * client_infratile(void)
const char * describe_topology(int topo)
bool mapdeco_is_crosshair_set(const struct tile *ptile)
#define fc_calloc(n, esz)
#define fc_realloc(ptr, sz)
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
const char * nation_rule_name(const struct nation_type *pnation)
Nation_type_id nation_count(void)
struct nation_type * nation_of_unit(const struct unit *punit)
struct nation_type * nation_of_player(const struct player *pplayer)
struct nation_type * nation_of_city(const struct city *pcity)
Nation_type_id nation_index(const struct nation_type *pnation)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
void option_set_default_ts(struct tileset *t)
const char * option_str_get(const struct option *poption)
int option_get_cb_data(const struct option *poption)
struct client_options gui_options
bool player_in_city_map(const struct player *pplayer, const struct tile *ptile)
int player_slot_index(const struct player_slot *pslot)
int player_index(const struct player *pplayer)
#define players_iterate_end
#define players_iterate(_pplayer)
#define player_slots_iterate(_pslot)
#define player_slots_iterate_end
#define fc_randomly(_seed, _size)
struct section_file * secfile_load(const char *filename, bool allow_duplicates)
const char * secfile_error(void)
const char * section_name(const struct section *psection)
void secfile_destroy(struct section_file *secfile)
void secfile_check_unused(const struct section_file *secfile)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
struct section_list * secfile_sections_by_name_prefix(const struct section_file *secfile, const char *prefix)
const char ** secfile_lookup_str_vec(const struct section_file *secfile, size_t *dim, const char *path,...)
struct entry * secfile_entry_lookup(const struct section_file *secfile, const char *path,...)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
bool secfile_lookup_bool(const struct section_file *secfile, bool *bval, const char *path,...)
#define section_list_iterate(seclist, psection)
#define secfile_entry_ignore(_sfile_, _fmt_,...)
#define section_list_iterate_end
bool is_cardinal_only_road(const struct extra_type *pextra)
struct setting_list * level[OLEVELS_NUM]
const char * fileinfoname(const struct strvec *dirs, const char *filename)
struct strvec * fileinfolist(const struct strvec *dirs, const char *suffix)
const struct strvec * get_data_dirs(void)
#define CLIP(lower, current, upper)
struct specialist * specialist_by_number(const Specialist_type_id id)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
static bool wall(char *str, bool check)
void strvec_destroy(struct strvec *psv)
void strvec_append(struct strvec *psv, const char *string)
struct strvec * strvec_new(void)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
char graphic_str[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
struct city_sprite::@245 * styles
struct city_style_threshold * land_thresholds
struct worker_task_list * task_reqs
unsigned char first_citizen_index
struct city::@17::@20 client
struct sprite_vector occupancy
struct rgbcolor * plr_bg_color
struct packet_ruleset_control control
struct packet_game_info info
struct civ_game::@30::@33 client
char gui_gtk2_default_theme_name[512]
bool draw_fortress_airbase
bool draw_unit_stack_size
char gui_gtk3_default_theme_name[512]
char default_tileset_name[512]
char gui_sdl2_default_theme_name[512]
char gui_gtk4_default_theme_name[512]
char gui_gtk3_22_default_theme_name[512]
bool solid_color_behind_units
int match_index[1+MAX_NUM_MATCH_WITH]
enum match_style match_style
enum sprite_type sprite_type
struct sprite_vector allocated
struct sprite * match[MAX_INDEX_CARDINAL]
struct sprite_vector base
struct drawing_data::drawing_layer layer[MAX_NUM_LAYERS]
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
struct sprite * sprite[MAX_NUM_CITIZEN_SPRITES]
struct named_sprites::@260 player[MAX_NUM_PLAYER_SLOTS]
struct sprite * government[G_LAST]
struct sprite_vector nation_shield
struct sprite * even[MAX_INDEX_HALF]
struct sprite * output[O_LAST][MAX_NUM_UPKEEP_SPRITES]
struct sprite * infratile
struct sprite * background
struct sprite * frame[NUM_CURSOR_FRAMES]
struct sprite * facing[U_LAST][DIR8_MAGIC_MAX]
struct sprite * spaceship[SPACESHIP_COUNT]
struct named_sprites::citizen_graphic specialist[SP_MAX]
struct named_sprites::@252 city
struct sprite * selected[EDGE_COUNT]
struct sprite * transform
struct named_sprites::@253 path
struct sprite * tile_shieldnum[NUM_TILES_DIGITS]
struct sprite_vector unworked_tile_overlay
enum extrastyle_id extrastyle
struct sprite * tile_foodnum[NUM_TILES_DIGITS]
struct sprite * turns[NUM_TILES_DIGITS]
struct sprite_vector nation_flag
struct sprite * nonnative
bool no_more_stack_sprites
struct city_sprite * single_wall
struct sprite * indicator[INDICATOR_COUNT][NUM_TILES_PROGRESS]
struct sprite * borders[EDGE_COUNT][2]
struct named_sprites::@256::@262::@263 bmf
struct sprite * size_tens[NUM_TILES_DIGITS]
struct city_sprite * tile
struct sprite * icon[ICON_COUNT]
struct sprite * tile_tradenum[NUM_TILES_DIGITS]
struct sprite * unworked_tile
struct named_sprites::@251 upkeep
struct sprite * auto_settler
struct sprite * fortified
struct sprite * dither_tile
struct sprite * coastline[EDGE_COUNT]
struct named_sprites::@249 explode
struct sprite * treaty_thumb[2]
struct sprite * tax_luxury
struct named_sprites::@256::@262::@264::@265::@266 combo
struct sprite_vector unit
struct sprite * building[B_LAST]
struct sprite * turns_hundreds[NUM_TILES_DIGITS]
struct sprite * total[MAX_INDEX_VALID]
struct sprite * action_decision_want
struct sprite * unhappy[MAX_NUM_UPKEEP_SPRITES]
struct sprite_vector worked_tile_overlay
struct sprite * corner[8]
struct named_sprites::@257 grid
struct sprite * darkness[MAX_INDEX_CARDINAL]
struct named_sprites::@247 units
struct sprite * tax_science
struct named_sprites::@258 colors
struct named_sprites::@256 extras[MAX_EXTRA_TYPES]
struct named_sprites::@253::@261 s[GTS_COUNT]
struct sprite * odd[MAX_INDEX_HALF]
struct named_sprites::citizen_graphic citizen[CITIZEN_LAST]
struct sprite * unavailable
struct sprite * worked_tile
struct river_sprites rivers
struct drawing_data * drawing[MAX_NUM_ITEMS]
struct sprite * middleground
struct sprite * foreground
struct named_sprites::@256::@262::@264 road
struct citybar_sprites citybar
struct sprite * auto_explore
struct sprite * turns_tens[NUM_TILES_DIGITS]
struct sprite * tech[A_LAST]
struct named_sprites::@246 mask
struct sprite * worked[EDGE_COUNT]
struct sprite_vector overlays
struct editor_sprites editor
struct named_sprites::@254 user
struct sprite * size_hundreds[NUM_TILES_DIGITS]
struct named_sprites::@248 cursor[CURSOR_LAST]
struct sprite * size[NUM_TILES_DIGITS]
struct sprite * cardinals[MAX_INDEX_CARDINAL]
struct named_sprites::@255 tx
struct sprite * fortifying
struct sprite * main[EDGE_COUNT]
struct sprite * events[E_COUNT]
struct sprite * auto_attack
struct city_sprite * wall[NUM_WALL_TYPES]
struct sprite * arrow[ARROW_LAST]
struct sprite * grid_borders[EDGE_COUNT][2]
union named_sprites::@256::@262::@264::@265 ru
struct sprite * attention
union named_sprites::@256::@262 u
struct city_sprite * occupied
struct sprite * cultivate
char flag_graphic_str[MAX_LEN_NAME]
char flag_graphic_alt[MAX_LEN_NAME]
enum borders_mode borders
struct sprite * spec[MAX_INDEX_CARDINAL]
struct sprite * outlet[MAX_INDEX_CARDINAL]
struct extra_type_list * integrators
struct sprite * big_sprite
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
const struct tile * tile[NUM_CORNER_TILES]
const struct tile * tile[NUM_EDGE_TILES]
struct extra_type * placing
char given_name[MAX_LEN_NAME]
int num_cardinal_tileset_dirs
struct named_sprites sprites
char * main_intro_filename
char version[MAX_LEN_NAME]
struct extra_type_list * flagged_bases_list
enum darkness_style darkness_style
struct estyle_hash * estyle_hash
struct small_sprite_list * small_sprites
struct extra_type_list * style_lists[ESTYLE_COUNT]
enum direction8 unit_default_orientation
struct tileset::tileset_layer layers[MAX_NUM_LAYERS]
struct sprite_hash * sprite_hash
int unit_upkeep_small_offset_y
enum mapview_layer layer_order[LAYER_COUNT]
enum direction8 cardinal_tileset_dirs[8]
enum direction8 valid_tileset_dirs[8]
struct color_system * color_system
struct drawing_hash * tile_hash
int num_valid_tileset_dirs
struct specfile_list * specfiles
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
enum action_decision action_decision_want
enum unit_activity activity
struct unit::@80::@82 client
struct extra_type * activity_target
enum server_side_agent ssa_controller
int style_of_city(const struct city *pcity)
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
int fc_strcasecmp(const char *str0, const char *str1)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
#define sz_strlcpy(dest, src)
struct advance * valid_advance(struct advance *padvance)
const char * advance_rule_name(const struct advance *padvance)
Tech_type_id advance_index(const struct advance *padvance)
#define advance_iterate(_start, _p)
static Tech_type_id advance_count(void)
#define advance_iterate_end
Terrain_type_id terrain_index(const struct terrain *pterrain)
const char * terrain_rule_name(const struct terrain *pterrain)
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
#define terrain_type_iterate(_p)
#define is_ocean_tile(ptile)
#define terrain_type_iterate_end
#define tile_worked(_tile)
#define tile_terrain(_tile)
static const bv_extras * tile_extras(const struct tile *ptile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
struct sprite * get_government_sprite(const struct tileset *t, const struct government *gov)
void tileset_load_tiles(struct tileset *t)
struct sprite * get_nuke_explode_sprite(const struct tileset *t)
#define sprite_hash_iterate(hash, tag_name, sprite)
int tileset_hex_width(const struct tileset *t)
struct sprite * get_building_sprite(const struct tileset *t, const struct impr_type *pimprove)
int tileset_unit_width(const struct tileset *t)
static void tileset_setup_citizen_types(struct tileset *t)
static int fill_goto_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct tile *ptile, const struct tile_edge *pedge, const struct tile_corner *pcorner)
struct unit * get_drawable_unit(const struct tileset *t, struct tile *ptile, const struct city *citymode)
static int check_sprite_type(const char *sprite_type, const char *tile_section)
struct sprite * get_attention_crosshair_sprite(const struct tileset *t)
int tileset_unit_height(const struct tileset *t)
static struct tileset * tileset_new(void)
void tileset_setup_unit_type(struct tileset *t, struct unit_type *ut)
static bool check_tilespec_capabilities(struct section_file *file, const char *which, const char *us_capstr, const char *filename, bool verbose)
static struct sprite * load_gfx_file(const char *gfx_filename)
int tileset_small_sprite_width(const struct tileset *t)
#define specfile_list_iterate_end
static struct sprite * load_sprite(struct tileset *t, const char *tag_name, bool scale, bool smooth)
static struct sprite * create_plr_sprite(struct color *pcolor)
static struct sprite * get_unit_nation_flag_sprite(const struct tileset *t, const struct unit *punit)
struct tileset * get_tileset(void)
#define MAX_NUM_MATCH_WITH
static struct sprite * get_city_sprite(const struct city_sprite *city_sprite, const struct city *pcity)
void tileset_setup_government(struct tileset *t, struct government *gov)
#define sprite_hash_iterate_end
struct sprite * get_city_flag_sprite(const struct tileset *t, const struct city *pcity)
static bool is_valid_tileset_dir(const struct tileset *t, enum direction8 dir)
struct sprite * get_basic_fog_sprite(const struct tileset *t)
static enum direction8 dir_by_tileset_name(const char *str)
#define ADD_SPRITE_SIMPLE(s)
static int fill_basic_road_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct extra_type *pextra)
struct sprite * get_unittype_sprite(const struct tileset *t, const struct unit_type *punittype, enum direction8 facing)
static int fill_unit_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct unit *punit, int stack, bool backdrop)
int tileset_full_tile_height(const struct tileset *t)
bool tilespec_try_read(const char *tileset_name, bool verbose, int topo_id, bool global_default)
static bool tileset_setup_unit_type_from_tag(struct tileset *t, int uidx, const char *tag)
struct tileset * unscaled_tileset
static int fill_irrigation_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, bv_extras textras, bv_extras *textras_near, const struct city *pcity)
int fill_basic_extra_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct extra_type *pextra)
#define specfile_list_iterate(list, pitem)
void tileset_setup_specialist_type(struct tileset *t, Specialist_type_id id)
struct sprite * get_unit_upkeep_sprite(const struct tileset *t, Output_type_id otype, const struct unit *punit, const int *upkeep_cost)
const char * tileset_main_intro_filename(const struct tileset *t)
void tileset_setup_tile_type(struct tileset *t, const struct terrain *pterrain)
static const char direction4letters[4]
void tileset_player_init(struct tileset *t, struct player *pplayer)
const struct strvec * get_tileset_list(const struct option *poption)
int tileset_unit_layout_offset_y(const struct tileset *t)
int tileset_citybar_offset_y(const struct tileset *t)
#define MAX_NUM_UPKEEP_SPRITES
struct sprite * get_treaty_thumb_sprite(const struct tileset *t, bool on_off)
bool unit_drawn_with_city_outline(const struct unit *punit, bool check_focus)
double get_focus_unit_toggle_timeout(const struct tileset *t)
#define SET_SPRITE_ALT_OPT(field, tag, alt)
static int calculate_max_upkeep_height(const struct tileset *t)
static int fill_fog_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct tile *ptile, const struct tile_edge *pedge, const struct tile_corner *pcorner)
#define TILE_SECTION_PREFIX
static struct city_sprite * load_city_sprite(struct tileset *t, const char *tag)
static char * valid_index_str(const struct tileset *t, int idx)
void tileset_free_tiles(struct tileset *t)
void tileset_setup_impr_type(struct tileset *t, struct impr_type *pimprove)
static struct tileset * tileset_read_toplevel(const char *tileset_name, bool verbose, int topology_id, float scale)
static bool sprite_exists(const struct tileset *t, const char *tag_name)
const struct sprite_vector * get_unit_explode_animation(const struct tileset *t)
static int load_city_thresholds_sprites(struct tileset *t, const char *tag, char *graphic, char *graphic_alt, struct city_style_threshold **thresholds)
static void unload_all_sprites(struct tileset *t)
static const char * dir_get_tileset_name(enum direction8 dir)
#define SET_SPRITE_UNSCALED(field, tag)
void tileset_background_init(struct tileset *t)
void tileset_setup_tech_type(struct tileset *t, struct advance *padvance)
static const int DIR4_TO_DIR8[4]
static int fill_terrain_sprite_layer(struct tileset *t, struct drawn_sprite *sprs, int layer_num, const struct tile *ptile, const struct terrain *pterrain, struct terrain **tterrain_near)
static void unload_sprite(struct tileset *t, const char *tag_name)
static void drawing_data_destroy(struct drawing_data *draw)
static int fill_terrain_sprite_darkness(struct tileset *t, struct drawn_sprite *sprs, const struct tile *ptile, struct terrain **tterrain_near)
#define small_sprite_list_iterate_end
static struct drawing_data * drawing_data_new(void)
static void build_tile_data(const struct tile *ptile, struct terrain *pterrain, struct terrain **tterrain_near, bv_extras *textras_near)
static void tileset_player_free(struct tileset *t, int plrid)
float tileset_scale(const struct tileset *t)
int tileset_unit_with_small_upkeep_height(const struct tileset *t)
bool tileset_layer_in_category(enum mapview_layer layer, enum layer_category cat)
static int fill_grid_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, 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)
#define small_sprite_list_iterate(list, pitem)
int tileset_num_city_colors(const struct tileset *t)
bool tileset_is_isometric(const struct tileset *t)
bool tileset_use_hard_coded_fog(const struct tileset *t)
void tileset_use_preferred_theme(const struct tileset *t)
static bool tileset_setup_unit_direction(struct tileset *t, int uidx, const char *base_str, enum direction8 dir, bool has_icon)
#define FULL_TILE_X_OFFSET
void tileset_setup_city_tiles(struct tileset *t, int style)
struct sprite * get_nation_shield_sprite(const struct tileset *t, const struct nation_type *pnation)
const char * tileset_description(struct tileset *t)
#define SET_GOTO_TURN_SPRITE(state, state_name, factor, factor_name)
struct sprite * tiles_lookup_sprite_tag_alt(struct tileset *t, enum log_level level, const char *tag, const char *alt, const char *what, const char *name, bool scale)
void tileset_background_free(struct tileset *t)
int tileset_unit_layout_small_offset_y(const struct tileset *t)
struct sprite * get_event_sprite(const struct tileset *t, enum event_type event)
void toggle_focus_unit_state(struct tileset *t)
void tilespec_reread_frozen_refresh(const char *tname)
int tileset_small_sprite_height(const struct tileset *t)
void tileset_free(struct tileset *t)
static const char * cardinal_index_str(const struct tileset *t, int idx)
void focus_unit_in_combat(struct tileset *t)
static int tileset_upkeep_height(const struct tileset *t)
const char * tileset_summary(struct tileset *t)
struct sprite * get_icon_sprite(const struct tileset *t, enum icon_type icon)
static void ensure_big_sprite(struct specfile *sf, const char *tset_name)
static bool tileset_update
#define FULL_TILE_Y_OFFSET
struct sprite * get_indicator_sprite(const struct tileset *t, enum indicator_type indicator, int idx)
struct sprite * get_sample_city_sprite(const struct tileset *t, int style_idx)
#define ADD_SPRITE_FULL(s)
void tileset_setup_extra(struct tileset *t, struct extra_type *pextra)
void tileset_init(struct tileset *t)
static int fill_city_overlays_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct tile *ptile, const struct city *citymode)
static char * tilespec_gfx_filename(const char *gfx_filename, const char *tset_name)
const char * tileset_basename(const struct tileset *t)
int fill_basic_terrain_layer_sprite_array(struct tileset *t, struct drawn_sprite *sprs, int layer, struct terrain *pterrain)
int tileset_tile_height(const struct tileset *t)
#define LOAD_FACING_SPRITE(dir)
#define SET_SPRITE_NOTSMOOTH(field, tag)
static int fill_road_corner_sprites(const struct tileset *t, const struct extra_type *pextra, struct drawn_sprite *sprs, bool road, bool *road_near, bool hider, bool *hider_near)
static bool is_extra_drawing_enabled(struct extra_type *pextra)
struct sprite * get_spaceship_sprite(const struct tileset *t, enum spaceship_part part)
int tileset_unit_with_upkeep_height(const struct tileset *t)
static void tileset_free_toplevel(struct tileset *t)
struct sprite * get_cursor_sprite(const struct tileset *t, enum cursor_type cursor, int *hot_x, int *hot_y, int frame)
static const char edge_name[EDGE_COUNT][3]
struct color_system * get_color_system(const struct tileset *t)
int tileset_hex_height(const struct tileset *t)
void reset_focus_unit_state(struct tileset *t)
static const char * citizen_rule_name(enum citizen_category citizen)
bool tileset_is_fully_loaded(void)
static int fill_terrain_sprite_blending(const struct tileset *t, struct drawn_sprite *sprs, const struct tile *ptile, const struct terrain *pterrain, struct terrain **tterrain_near)
const struct citybar_sprites * get_citybar_sprites(const struct tileset *t)
static bool is_cardinal_tileset_dir(const struct tileset *t, enum direction8 dir)
#define SET_SPRITE(field, tag)
static void tileset_lookup_sprite_tags(struct tileset *t)
struct sprite * get_arrow_sprite(const struct tileset *t, enum arrow_type arrow)
struct sprite * get_unit_unhappy_sprite(const struct tileset *t, const struct unit *punit, int happy_cost)
static int fill_unit_type_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct unit_type *putype, enum direction8 facing)
static int fill_basic_base_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct extra_type *pextra)
static void tileset_setup_base(struct tileset *t, const struct extra_type *pextra, const char *tag)
static int fill_road_sprite_array(const struct tileset *t, const struct extra_type *pextra, struct drawn_sprite *sprs, bv_extras textras, bv_extras *textras_near, struct terrain *tterrain_near[8], const struct city *pcity)
void finish_loading_sprites(struct tileset *t)
#define SET_EDITOR_SPRITE(x)
#define SET_SPRITE_ALT(field, tag, alt)
#define SET_SPRITE_OPT(field, tag)
void tilespec_reread_callback(struct option *poption)
static bool load_river_sprites(struct tileset *t, struct river_sprites *store, const char *tag_pfx)
const char * tileset_name_get(struct tileset *t)
static char * tilespec_fullname(const char *tileset_name)
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)
#define ADD_SPRITE(s, draw_fog, x_offset, y_offset)
int tileset_full_tile_width(const struct tileset *t)
struct sprite * get_tax_sprite(const struct tileset *t, Output_type_id otype)
struct sprite * get_citizen_sprite(const struct tileset *t, enum citizen_category type, int citizen_index, const struct city *pcity)
static int fill_terrain_sprite_array(struct tileset *t, struct drawn_sprite *sprs, int l, const struct tile *ptile, const struct terrain *pterrain, struct terrain **tterrain_near, struct drawing_data *draw)
const char * tileset_version(struct tileset *t)
static void free_city_sprite(struct city_sprite *city_sprite)
static int ts_topology_index(int actual_topology)
char * tileset_what_ruleset(struct tileset *t)
struct sprite * get_nation_flag_sprite(const struct tileset *t, const struct nation_type *pnation)
int tileset_tile_width(const struct tileset *t)
int tileset_tilelabel_offset_y(const struct tileset *t)
static void tileset_setup_road(struct tileset *t, struct extra_type *pextra, const char *tag)
struct sprite * get_tech_sprite(const struct tileset *t, Tech_type_id tech)
static int get_irrigation_index(const struct tileset *t, struct extra_type *pextra, bv_extras *textras_near)
#define MAX_INDEX_CARDINAL
void tileset_error(enum log_level level, const char *tset_name, const char *format,...)
const struct editor_sprites * get_editor_sprites(const struct tileset *t)
int tileset_topo_index(struct tileset *t)
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
void tileset_setup_nation_flag(struct tileset *t, struct nation_type *nation)
void tileset_ruleset_reset(struct tileset *t)
#define ADD_SPRITE_IF_NOT_NULL(x)
static void scan_specfile(struct tileset *t, struct specfile *sf, bool duplicates_ok)
enum mapview_layer tileset_get_layer(const struct tileset *t, int n)
#define NUM_CURSOR_FRAMES
#define TERRAIN_LAYER_COUNT
#define sprite_vector_iterate_end
#define NUM_TILES_PROGRESS
#define MAX_NUM_CITIZEN_SPRITES
#define sprite_vector_iterate(sprite_vec, psprite)
bool unit_is_cityfounder(const struct unit *punit)
bool unit_transported(const struct unit *pcargo)
bool unit_has_orders(const struct unit *punit)
#define MAX_NUM_BATTLEGROUPS
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
const char * utype_rule_name(const struct unit_type *punittype)
Unit_type_id utype_index(const struct unit_type *punittype)
#define utype_fuel(ptype)
#define unit_type_iterate(_p)
#define unit_type_iterate_end
#define worker_task_list_iterate(tasklist, ptask)
#define worker_task_list_iterate_end