82#define TILESPEC_CAPSTR "+Freeciv-tilespec-3.3-Devel-2024-Nov-16 duplicates_ok"
98#define SPEC_CAPSTR "+Freeciv-spec-3.3-Devel-2023.Apr.05"
106#define TILESPEC_SUFFIX ".tilespec"
107#define TILE_SECTION_PREFIX "tile_"
110#define MAX_INDEX_CARDINAL 64
111#define MAX_INDEX_HALF 16
112#define MAX_INDEX_VALID 256
114#define NUM_TILES_HP_BAR 11
115#define NUM_TILES_DIGITS 10
116#define MAX_NUM_UPKEEP_SPRITES 10
118#define SPECENUM_NAME extrastyle_id
119#define SPECENUM_VALUE0 ESTYLE_ROAD_ALL_SEPARATE
120#define SPECENUM_VALUE0NAME "RoadAllSeparate"
121#define SPECENUM_VALUE1 ESTYLE_ROAD_PARITY_COMBINED
122#define SPECENUM_VALUE1NAME "RoadParityCombined"
123#define SPECENUM_VALUE2 ESTYLE_ROAD_ALL_COMBINED
124#define SPECENUM_VALUE2NAME "RoadAllCombined"
125#define SPECENUM_VALUE3 ESTYLE_RIVER
126#define SPECENUM_VALUE3NAME "River"
127#define SPECENUM_VALUE4 ESTYLE_SINGLE1
128#define SPECENUM_VALUE4NAME "Single1"
129#define SPECENUM_VALUE5 ESTYLE_SINGLE2
130#define SPECENUM_VALUE5NAME "Single2"
131#define SPECENUM_VALUE6 ESTYLE_3LAYER
132#define SPECENUM_VALUE6NAME "3Layer"
133#define SPECENUM_VALUE7 ESTYLE_CARDINALS
134#define SPECENUM_VALUE7NAME "Cardinals"
135#define SPECENUM_COUNT ESTYLE_COUNT
182#define MAX_NUM_LAYERS 3
188#define MAX_NUM_MATCH_WITH 8
430#define SPECLIST_TAG specfile
431#define SPECLIST_TYPE struct specfile
434#define specfile_list_iterate(list, pitem) \
435 TYPED_LIST_ITERATE(struct specfile, list, pitem)
436#define specfile_list_iterate_end LIST_ITERATE_END
460#define SPECLIST_TAG small_sprite
461#define SPECLIST_TYPE struct small_sprite
463#define small_sprite_list_iterate(list, pitem) \
464 TYPED_LIST_ITERATE(struct small_sprite, list, pitem)
465#define small_sprite_list_iterate_end LIST_ITERATE_END
468#define SPECHASH_TAG sprite
469#define SPECHASH_ASTR_KEY_TYPE
470#define SPECHASH_IDATA_TYPE struct small_sprite *
472#define sprite_hash_iterate(hash, tag_name, sprite) \
473 TYPED_HASH_ITERATE(const char *, struct small_sprite *, \
474 hash, tag_name, sprite)
475#define sprite_hash_iterate_end HASH_ITERATE_END
478#define SPECHASH_TAG anim
479#define SPECHASH_ASTR_KEY_TYPE
480#define SPECHASH_IDATA_TYPE struct anim *
482#define anim_hash_iterate(hash, tag_name, sprite) \
483 TYPED_HASH_ITERATE(const char *, struct anim *, \
484 hash, tag_name, anim)
485#define anim_hash_iterate_end HASH_ITERATE_END
490#define SPECHASH_TAG drawing
491#define SPECHASH_CSTR_KEY_TYPE
492#define SPECHASH_IDATA_TYPE struct drawing_data *
493#define SPECHASH_IDATA_FREE drawing_data_destroy
496#define SPECHASH_TAG estyle
497#define SPECHASH_ASTR_KEY_TYPE
498#define SPECHASH_ENUM_DATA_TYPE extrastyle_id
555#define NUM_CORNER_DIRS 4
556#define TILES_PER_CORNER 4
601 bool verbose,
int topology_id,
651 const char *format, ...)
695 for (
i = 0;
i < 4;
i++) {
696 if (
draw->blend[
i]) {
700 for (
i = 0;
i <
draw->num_layers;
i++) {
1031 log_error(
"Wrong direction8 variant: %d.", dir);
1133static void ts_list_cb(
const char *modpack_name,
const char *filename,
1152 static struct strvec *
tilesets[3] = {
nullptr,
nullptr,
nullptr };
1208 const char *filename,
1216 log_base(
level,
"\"%s\": %s file doesn't have a capability string",
1229 "that client doesn't support:", filename,
which);
1284 if (
tslp->match_types) {
1285 for (j = 0; j <
tslp->match_count; j++) {
1332static void ts_cb(
const char *modpack_name,
const char *filename,
void *data)
1451 log_fatal(
"Failed to re-read the currently loaded tileset.");
1493 _(
"Map topology (%s) and tileset (%s) incompatible."),
1660 _(
"Specfile %s has incompatible capabilities"), sf->
file_name);
1669 _(
"Could not load gfx file for the spec file \"%s\"."),
1694 _(
"Specfile %s has incompatible capabilities"), sf->
file_name);
1743 log_error(
"%s small sprite \"%s.tiles%d\" invalid: %s",
1775 log_error(
"warning: %s already has a sprite for \"%s\".",
1797 const char *filename;
1802 "extra.sprites%d.tag",
i))
1804 "extra.sprites%d.file",
i))) {
1805 log_error(
"%s extra sprite \"extra.sprites%d\" invalid: %s",
1825 log_error(
"warning: %s already have a sprite for \"%s\".",
1867 _(
"Couldn't find a supported gfx file extension for \"%s\"."),
1932 bool verbose,
int topology_id,
1942 const char **layer_order;
1943 size_t num_preferred_themes;
1990 if (
tstr[0] !=
'\0') {
1999 if (
tstr[0] !=
'\0') {
2015 if (
tstr[0] !=
'\0') {
2086 if (topology_id >= 0) {
2098 log_normal(
_(
"Client does not support %s tilesets."),
2130 "tilespec.normal_tile_width")
2132 "tilespec.normal_tile_height")) {
2138 if (
scale != 1.0f) {
2140 while (
i % 8 != 0) {
2163 "tilespec.small_tile_width")
2165 "tilespec.small_tile_height")) {
2177 log_verbose(
"tile sizes %dx%d, %d%d unit, %d%d small",
2208 log_error(
"Invalid darkness style set in tileset \"%s\".", t->
name);
2213 "tilespec.unit_flag_offset_x")
2215 "tilespec.unit_flag_offset_y")
2217 "tilespec.city_flag_offset_x")
2219 "tilespec.city_flag_offset_y")
2221 "tilespec.unit_offset_x")
2223 "tilespec.unit_offset_y")
2225 "tilespec.activity_offset_x")
2227 "tilespec.activity_offset_y")
2229 "tilespec.select_offset_x")
2231 "tilespec.select_offset_y")
2233 "tilespec.stack_size_offset_x")
2235 "tilespec.stack_size_offset_y")
2237 "tilespec.city_offset_x")
2239 "tilespec.city_offset_y")
2241 "tilespec.city_size_offset_x")
2243 "tilespec.city_size_offset_y")
2245 "tilespec.citybar_offset_y")
2247 "tilespec.tilelabel_offset_y")
2249 "tilespec.occupied_offset_x")
2251 "tilespec.occupied_offset_y")) {
2257 "tilespec.unit_upkeep_offset_y");
2259 "tilespec.unit_upkeep_small_offset_y");
2285 if (t->
scale != 1.0f
2289 if (t->
scale != 1.0f
2295 "tilespec.unit_default_orientation");
2304 _(
"Unknown unit_default_orientation \"%s\""), c);
2320 "tilespec.layer_order");
2322 for (
i = 0;
i < num_layers;
i++) {
2329 log_error(
"layer_order: Invalid layer \"%s\" in %s",
2334 for (j = 0; j <
i; j++) {
2336 log_error(
"layer_order: Duplicate layer \"%s\" in %s",
2350 for (j = 0; j < num_layers; j++) {
2357 log_error(
"layer_order: Missing layer \"%s\" in %s",
2378 "layer%d.match_types",
i);
2379 for (j = 0; j <
tslp->match_count; j++) {
2382 for (k = 0; k < j; k++) {
2383 if (
tslp->match_types[k][0] ==
tslp->match_types[j][0]) {
2385 _(
"[layer%d] match_types: \"%s\" initial "
2386 "('%c') is not unique."),
2387 i,
tslp->match_types[j],
tslp->match_types[j][0]);
2398 _(
"No [%s] sections present."),
2435 for (
l = 0;
l <
draw->num_layers;
l++) {
2436 struct drawing_layer *
dlp = &
draw->layer[
l];
2455 "%s.layer%d_match_type",
2461 for (j = 0; j <
tslp->match_count; j++) {
2466 if (j >=
tslp->match_count) {
2467 log_error(
"[%s] invalid match_type \"%s\" in %s.",
2470 dlp->match_index[
dlp->match_indices++] = j;
2475 "%s.layer%d_match_with",
2481 log_error(
"[%s] match_with has too many types (%d, max %d) in %s",
2487 if (1 <
dlp->match_indices) {
2488 log_error(
"[%s] previous match_with ignored in %s.",
2490 dlp->match_indices = 1;
2491 }
else if (1 >
dlp->match_indices) {
2492 log_error(
"[%s] missing match_type, using \"%s\" in %s.",
2494 dlp->match_index[0] = 0;
2495 dlp->match_indices = 1;
2498 for (k = 0; k < count; k++) {
2499 for (j = 0; j <
tslp->match_count; j++) {
2504 if (j >=
tslp->match_count) {
2505 log_error(
"[%s] layer%d_match_with: invalid \"%s\".",
2507 }
else if (1 < count) {
2510 for (
m = 0;
m <
dlp->match_indices;
m++) {
2511 if (
dlp->match_index[
m] == j) {
2512 log_error(
"[%s] layer%d_match_with: duplicate \"%s\" in %s.",
2517 if (
m >=
dlp->match_indices) {
2518 dlp->match_index[
dlp->match_indices++] = j;
2521 dlp->match_index[
dlp->match_indices++] = j;
2529 switch (
dlp->match_indices) {
2535 if (
dlp->match_index[0] ==
dlp->match_index[1] ) {
2551 switch (
dlp->sprite_type) {
2557 ||
dlp->offset_x > 0
2558 ||
dlp->offset_y > 0) {
2559 log_error(
"[%s] layer %d: you cannot have tall terrain or\n"
2560 "a sprite offset with a cell-based drawing method in %s.",
2563 dlp->offset_x =
dlp->offset_y = 0;
2570 log_error(
"warning: multiple tile sections containing terrain tag \"%s\" in %s.",
2586 "extras.styles%d.name",
2592 "extras.styles%d.style",
i);
2595 log_error(
"Unknown extra style \"%s\" for extra \"%s\" in %s.",
2601 log_error(
"warning: duplicate extrastyle entry [%s] in %s.",
2632 log_error(
"No tile graphics files specified in \"%s\" for %s mode.",
2662 "tilespec.preferred_themes");
2680 if (
NULL != sections) {
2706 log_error(
"Unknown citizen type: %d.", (
int) citizen);
2722 int value = (idx >>
i) & 1;
2742 int value = (idx >>
i) & 1;
2827 _(
"Couldn't load gfx file \"%s\" for sprite '%s'."),
2838 _(
"Sprite '%s' in file \"%s\" isn't within the image!"),
2887 if (
ss->ref_count == 0) {
2907#define SET_SPRITE(field, tag) \
2909 t->sprites.field = load_sprite(t, tag, TRUE, TRUE, FALSE); \
2910 if (t->sprites.field == NULL) { \
2911 tileset_error(LOG_FATAL, tileset_name_get(t), \
2912 _("Sprite for tag '%s' missing."), tag); \
2917#define SET_SPRITE_NOTSMOOTH(field, tag) \
2919 t->sprites.field = load_sprite(t, tag, TRUE, FALSE, FALSE); \
2920 if (t->sprites.field == NULL) { \
2921 tileset_error(LOG_FATAL, tileset_name_get(t), \
2922 _("Sprite for tag '%s' missing."), tag); \
2926#define SET_SPRITE_UNSCALED(field, tag) \
2928 t->sprites.field = load_sprite(t, tag, FALSE, FALSE, FALSE); \
2929 if (t->sprites.field == NULL) { \
2930 tileset_error(LOG_FATAL, tileset_name_get(t), \
2931 _("Sprite for tag '%s' missing."), tag); \
2936#define SET_SPRITE_ALT(field, tag, alt) \
2938 t->sprites.field = load_sprite(t, tag, TRUE, TRUE, FALSE); \
2939 if (!t->sprites.field) { \
2940 t->sprites.field = load_sprite(t, alt, TRUE, TRUE, FALSE); \
2942 if (t->sprites.field == NULL) { \
2943 tileset_error(LOG_FATAL, tileset_name_get(t), \
2944 _("Sprite for tags '%s' and alternate '%s' are " \
2945 "both missing."), tag, alt); \
2950#define SET_SPRITE_DEPR_ALT(field, tag, alt, ver) \
2952 t->sprites.field = load_sprite(t, tag, TRUE, TRUE, FALSE); \
2953 if (!t->sprites.field) { \
2954 t->sprites.field = load_sprite(t, alt, TRUE, TRUE, FALSE); \
2955 if (t->sprites.field != NULL) { \
2956 log_deprecation(_("%s: Using tag \"%s\" deprecated by \"%s\" in %s"), \
2957 tileset_name_get(t), alt, tag, ver); \
2960 if (t->sprites.field == NULL) { \
2961 tileset_error(LOG_FATAL, tileset_name_get(t), \
2962 _("Sprite for tags '%s' and alternate '%s' are " \
2963 "both missing."), tag, alt); \
2968#define SET_SPRITE_OPT(field, tag) \
2969 t->sprites.field = load_sprite(t, tag, TRUE, TRUE, FALSE)
2971#define SET_SPRITE_ALT_OPT(field, tag, alt) \
2973 t->sprites.field = tiles_lookup_sprite_tag_alt(t, LOG_VERBOSE, tag, alt, \
2974 NULL, "sprite", #field, \
2978#define SET_ANIM(field, tag) \
2980 t->sprites.field = anim_load(t, tag, 0); \
2981 if (t->sprites.field == NULL) { \
2982 tileset_error(LOG_FATAL, tileset_name_get(t), \
2983 _("Animation for tag '%s' missing."), tag); \
3020 if (
ret->sprites[
i] ==
nullptr) {
3022 _(
"Animation sprite for tag '%s' missing."),
buf);
3071 "default set",
TRUE);
3088 const char *tag =
spe->graphic_str;
3096 fc_snprintf(buffer,
sizeof(buffer),
"%s_%d", tag, j);
3149 if (j == 0 && required) {
3153 _(
"No graphics for specialist \"%s\" in %s."),
3164 "default set",
TRUE);
3195 if (j == 0 && required) {
3199 _(
"No graphics for citizen \"%s\" in %s."),
3248 char *graphic,
char *graphic_alt,
3266 }
else if (
size == 0) {
3338 char buffer[512],
buffer2[512];
3348 const char *names[] = {
"science_bulb",
"warming_sun",
"cooling_flake"};
3351 fc_snprintf(buffer,
sizeof(buffer),
"s.%s_%d", names[j],
i);
3379 = {
"solar_panels",
"life_support",
"habitation",
3380 "structural",
"fuel",
"propulsion",
"exhaust"};
3382 fc_snprintf(buffer,
sizeof(buffer),
"spaceship.%s", names[
i]);
3388 {
"goto",
"patrol",
"paradrop",
"teleport",
"nuke",
"select",
3389 "invalid",
"attack",
"edit_paint",
"edit_add",
"wait"};
3395 fc_snprintf(buffer,
sizeof(buffer),
"cursor.%s%d", names[
i],
f);
3406 const char *names[
ICON_COUNT] = {
"freeciv",
"citydlg"};
3408 fc_snprintf(buffer,
sizeof(buffer),
"icon.%s", names[
i]);
3421 for (
i = 0; ;
i++) {
3424 fc_snprintf(buffer,
sizeof(buffer),
"explode.unit_%d",
i);
3453 fc_snprintf(buffer,
sizeof(buffer),
"unit.battlegroup_%d",
i);
3465 fc_snprintf(buffer,
sizeof(buffer),
"unit.hp_%d",
i*10);
3482 SET_SPRITE(citybar.shields,
"citybar.shields");
3485 SET_SPRITE(citybar.occupied,
"citybar.occupied");
3486 SET_SPRITE(citybar.background,
"citybar.background");
3488 for (
i = 0; ;
i++) {
3491 fc_snprintf(buffer,
sizeof(buffer),
"citybar.occupancy_%d",
i);
3500 _(
"Missing necessary citybar.occupancy_N sprites."));
3503#define SET_EDITOR_SPRITE(x) SET_SPRITE(editor.x, "editor." #x)
3520#undef SET_EDITOR_SPRITE
3528#define SET_GOTO_TURN_SPRITE(state, state_name, factor, factor_name) \
3529 fc_snprintf(buffer, sizeof(buffer), "path." state_name "_%d" #factor, i); \
3530 SET_SPRITE_OPT(path.s[state].turns ## factor_name [i], buffer); \
3531 if (t->sprites.path.s[state].turns ## factor_name [i] == NULL) { \
3532 t->sprites.path.s[state].turns ## factor_name [i] = \
3533 t->sprites.path.s[GTS_MP_LEFT].turns ## factor_name [i]; \
3537 fc_snprintf(buffer,
sizeof(buffer),
"city.size_%d",
i);
3544 fc_snprintf(buffer,
sizeof(buffer),
"city.size_%d0",
i);
3551 fc_snprintf(buffer,
sizeof(buffer),
"city.size_%d00",
i);
3559 fc_snprintf(buffer,
sizeof(buffer),
"city.t_food_%d",
i);
3561 fc_snprintf(buffer,
sizeof(buffer),
"city.t_shields_%d",
i);
3563 fc_snprintf(buffer,
sizeof(buffer),
"city.t_trade_%d",
i);
3566#undef SET_GOTO_TURN_SPRITE
3570 fc_strlcpy(buffer,
"upkeep.unhappy",
sizeof(buffer));
3600 SET_SPRITE(user.attention,
"user.attention");
3601 SET_SPRITE(user.infratile,
"user.infratile");
3611 for (
i = 0; ;
i++) {
3614 fc_snprintf(buffer,
sizeof(buffer),
"colors.overlay_%d",
i);
3623 _(
"Missing overlay-color sprite colors.overlay_0."));
3649 SET_SPRITE(grid.unavailable,
"grid.unavailable");
3676 for (
be = 0;
be < 2;
be++) {
3677 fc_snprintf(buffer,
sizeof(buffer),
"grid.borders.%c",
3698 _(
"Sprite tx.darkness missing."));
3700 for (
i = 0;
i < 4;
i++) {
3712 fc_snprintf(buffer,
sizeof(buffer),
"tx.darkness_%s",
3719 fc_snprintf(buffer,
sizeof(buffer),
"tx.darkness_%s",
3727 for (
i = 0;
i < 81;
i++) {
3729 char ids[] = {
'u',
'f',
'k'};
3730 char buf[512] =
"t.fog";
3731 int values[4],
vi, k =
i;
3733 for (
vi = 0;
vi < 4;
vi++) {
3770 fc_snprintf(buffer,
sizeof(buffer),
"%s_outlet_%s",
3791 if (sf->big_sprite) {
3793 sf->big_sprite =
NULL;
3817 const char *tag,
const char *alt,
3819 const char *
what,
const char *
name,
3826 "attempt to lookup for %s \"%s\" before "
3835 "(instead of \"%s\") for %s \"%s\".",
3843 log_verbose(
"Using second alternate graphic \"%s\" "
3844 "(instead of \"%s\" or \"%s\") for %s \"%s\".",
3851 _(
"Don't have graphics tags \"%s\" or \"%s\" for %s \"%s\"."),
3949#define LOAD_FACING_SPRITE(dir) \
3950 if (!tileset_setup_unit_direction(t, uidx, tag, dir, activity, has_icon)) { \
3951 facing_sprites[activity] = FALSE; \
3975#undef LOAD_FACING_SPRITE
3990 _(
"Missing %s unit sprite for tags \"%s\" and alternatives "
3991 "\"%s\" and \"%s\"."),
3993 ut->graphic_alt,
ut->graphic_alt2);
3999 _(
"Unit type %s has no unoriented sprite and "
4000 "tileset has no unit_default_orientation."),
4068 _(
"No extra style for \"%s\" or \"%s\"."),
4073 "(instead of \"%s\") for extra \"%s\".",
4087 switch (extrastyle) {
4123 _(
"No cardinal-style graphics \"%s*\" for "
4150 _(
"Missing %s building activity sprite for tags \"%s\" and alternatives \"%s\" and \"%s\"."),
4169 _(
"Missing %s removal activity sprite for tags \"%s\" "
4170 "and alternatives \"%s\" and \"%s\"."),
4197 "%s_isolated", tag);
4224 char c[64] =
"", d[64] =
"";
4227 int value = (
i >> j) & 1;
4261 _(
"No river-style graphics \"%s*\" for extra \"%s\""),
4317 _(
"No graphics with tag \"%s_bg/mg/fg\" for extra \"%s\""),
4327 const struct terrain *pterrain)
4338 _(
"Terrain \"%s\": no graphic tile \"%s\", \"%s\", or \"%s\"."),
4349 for (
l = 0;
l <
draw->num_layers;
l++) {
4355 switch (
dlp->sprite_type) {
4357 switch (
dlp->match_style) {
4360 for (
i = 0; ;
i++) {
4371 if (0 ==
i && 0 ==
l) {
4374 _(
"Missing base sprite for tag \"%s\"."), buffer);
4380 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_%s",
4384 NULL,
"matched terrain",
4396 const int count =
dlp->match_indices;
4399 switch (
dlp->match_style) {
4420 for (
i = 0;
i < number;
i++) {
4424 switch (
dlp->match_style) {
4426 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_cell_%c",
4430 NULL,
"cell terrain",
4434 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_cell_%c%d%d%d",
4436 (value) & 1, (value >> 1) & 1, (value >> 2) & 1);
4439 NULL,
"same cell terrain",
4443 fc_snprintf(buffer,
sizeof(buffer),
"t.l%d.%s_cell_%c_%c_%c_%c",
4445 tslp->match_types[
dlp->match_index[(value) & 1]][0],
4446 tslp->match_types[
dlp->match_index[(value >> 1) & 1]][0],
4447 tslp->match_types[
dlp->match_index[(value >> 2) & 1]][0]);
4450 NULL,
"cell pair terrain",
4455 int this =
dlp->match_index[0];
4459 v1 =
dlp->match_index[value % count];
4461 v2 =
dlp->match_index[value % count];
4463 v3 =
dlp->match_index[value % count];
4499 "t.l%d.cellgroup_%c_%c_%c_%c",
l,
4500 tslp->match_types[
n][0],
tslp->match_types[e][0],
4501 tslp->match_types[s][0],
tslp->match_types[w][0]);
4510 int x[4] = {
W / 4,
W / 4, 0,
W / 2};
4511 int y[4] = {
H / 2, 0,
H / 4,
H / 4};
4512 int xo[4] = {0, 0, -
W / 2,
W / 2};
4513 int yo[4] = {
H / 2, -
H / 2, 0, 0};
4523 log_error(
"Terrain graphics sprite for tag \"%s\" missing.", buffer);
4540 NULL,
"blend terrain",
4543 if (
draw->blending > 0) {
4544 const int bl =
draw->blending - 1;
4552 && 0 <
draw->layer[
li].base.size) {
4562 NULL,
"base (blend) terrain",
4572 {
W / 2, 0}, {0,
H / 2}, {
W / 2,
H / 2}, {0, 0}
4576 for (; dir < 4; dir++) {
4618 for (
i = 0; tags[
i] && !flag;
i++) {
4622 for (
i = 0; tags[
i] && !shield;
i++) {
4626 if (!flag || !shield) {
4663#define FULL_TILE_X_OFFSET ((t->normal_tile_width - t->full_tile_width) / 2)
4664#define FULL_TILE_Y_OFFSET (t->normal_tile_height - t->full_tile_height)
4666#define ADD_SPRITE(s, draw_fog, x_offset, y_offset) \
4667 (fc_assert(s != NULL), \
4669 sprs->foggable = (draw_fog && t->fogstyle == FOG_AUTO), \
4670 sprs->offset_x = x_offset, \
4671 sprs->offset_y = y_offset, \
4673#define ADD_SPRITE_SIMPLE(s) ADD_SPRITE(s, TRUE, 0, 0)
4674#define ADD_SPRITE_FULL(s) \
4675 ADD_SPRITE(s, TRUE, FULL_TILE_X_OFFSET, FULL_TILE_Y_OFFSET)
4677#define ADD_ANIM_SPRITE(s, draw_fog, x_offset, y_offset) \
4678 ADD_SPRITE(anim_get_current_frame(s), draw_fog, x_offset, y_offset)
4679#define ADD_ANIM_SPRITE_SIMPLE(s) \
4680 ADD_SPRITE(anim_get_current_frame(s), TRUE, 0, 0)
4681#define ADD_ANIM_FULL(s) \
4682 ADD_SPRITE(anim_get_current_frame(s), TRUE, \
4683 FULL_TILE_X_OFFSET, FULL_TILE_Y_OFFSET)
4685#define ADD_FRAME0_SIMPLE(s) ADD_SPRITE_SIMPLE(s->sprites[0])
4686#define ADD_FRAME0_FULL(s) \
4687 ADD_SPRITE_FULL(s->sprites[0])
4704 for (dir = 0; dir < 8; dir++) {
4715 log_error(
"build_tile_data() tile (%d,%d) has no terrain!",
4885 if (t->
sprites.
unit.action_decision_want !=
nullptr
4905 &&
ptype->move_rate > 0) {
4913 }
else if (stack > 1) {
5015 for (
i = 0;
i < 8;
i++) {
5041 for (dir = 0; dir < 8; dir++) {
5236 bool hidden =
FALSE;
5264 const struct tile *ptile,
5344 const struct tile *ptile,
5345 const struct terrain *pterrain,
5351 {
W/2, 0}, {0,
H / 2}, {
W / 2,
H / 2}, {0, 0}
5360 for (; dir < 4; dir++) {
5384 const struct tile *ptile,
5401 for (
i = 3;
i >= 0;
i--) {
5402 const int unknown = 0,
fogged = 1, known = 2;
5439 const struct tile *ptile,
5440 const struct terrain *pterrain,
5445 struct drawing_layer *
dlp = &
draw->layer[
l];
5446 int this =
dlp->match_index[0];
5447 int that =
dlp->match_index[1];
5449 int oy =
dlp->offset_y;
5453 (t->sprites.drawing[terrain_index(tterrain_near[(dir)])]->num_layers > l \
5454 ? t->sprites.drawing[terrain_index(tterrain_near[(dir)])]->layer[l].match_index[0] \
5457 switch (
dlp->sprite_type) {
5460 switch (
dlp->match_style) {
5485 if (
MATCH(dir) ==
this) {
5516 {
W / 4, 0}, {
W / 4,
H / 2}, {
W / 2,
H / 4}, {0,
H / 4}
5519 {0, 0}, {
W / 2,
H / 2}, {
W / 2, 0}, {0,
H / 2}
5524 const int count =
dlp->match_indices;
5533 switch (
dlp->match_style) {
5553 for (j = 0; j < 3; j++) {
5556 for (k = 0; k < count; k++) {
5558 if (
m[j] ==
dlp->match_index[k]) {
5591 const struct tile *ptile,
5598#define UNKNOWN(dir) \
5599 ((adjc_tile = mapstep(&(wld.map), ptile, (dir))) \
5600 && client_tile_get_known(adjc_tile) == TILE_UNKNOWN)
5606 for (
i = 0;
i < 4;
i++) {
5608 int offsets[4][2] = {{
W / 2, 0}, {0,
H / 2}, {
W / 2,
H / 2}, {0, 0}};
5656 const struct tile *ptile,
5657 const struct terrain *pterrain,
5663 const int l = (
draw->is_reversed
5684 if ((
l + 1) ==
draw->blending) {
5717 const struct tile *ptile,
5784 && known[0] && known[1]
5794 }
else if (known[0] || known[1]) {
5867 const struct tile *ptile,
5893 if (length >= 100) {
5899 if (length >= 1000) {
5918 log_normal(
_(
"Tileset \"%s\" doesn't support long goto paths, "
5919 "such as %d. Path not displayed as expected."),
6002 const struct tile *ptile,
6013 struct terrain *pterrain =
nullptr;
6030 int count = 0,
i,
cx,
cy;
6031 const struct tile *
const *tiles =
nullptr;
6041 tiles =
pedge->tile;
6045 for (
i = 0;
i < count;
i++) {
6060 if (
NULL != pterrain) {
6069 log_error(
"fill_sprite_array() tile (%d,%d) has no terrain!",
6086 if (
owner !=
nullptr) {
6119 if (
NULL != pterrain) {
6177 if (
NULL != pterrain) {
6203 if (
NULL != pterrain) {
6209 bool hidden =
FALSE;
6228 bool hidden =
FALSE;
6318 if (
NULL != pterrain) {
6324 bool hidden =
FALSE;
6343 bool hidden =
FALSE;
6407 if (
NULL != pterrain) {
6416 bool hidden =
FALSE;
6435 if (eowner !=
NULL) {
6438 bool hidden =
FALSE;
6503 log_normal(
_(
"Tileset \"%s\" doesn't support big cities size, "
6504 "such as %d. Size not displayed as expected."),
6540 if (
ptask->ptile == ptile) {
6541 switch (
ptask->act) {
6616 if (ptile !=
NULL) {
6692 _(
"City style \"%s\": no city graphics."),
6697 _(
"City style \"%s\": no occupied graphics."),
6796 while (
ss->ref_count > 0) {
6861 free(sf->file_name);
6862 if (sf->big_sprite) {
6864 sf->big_sprite =
NULL;
6965 if (graphic ==
NULL || graphic->
count == 0) {
6970 if (graphic->
count == 0) {
7186 int *hot_x,
int *hot_y,
int frame)
7346 log_verbose(
"The tileset doesn't specify preferred themes or none of its "
7347 "preferred themes can be used. Using system default.");
7375 for (j = 0; j < 2; j++) {
7413 for (
i = 0;
i < 8;
i++) {
7418 i =
draw->is_reversed ?
draw->num_layers - layer - 1 : layer;
7472 if (!t || !
sprs || !pextra) {
7518 if (!t || !
sprs || !pextra) {
7528#define ADD_FRAME0_IF_NOT_NULL(x) do {\
7529 if ((x) != nullptr) {\
7530 ADD_FRAME0_FULL(x);\
7539#undef ADD_FRAME0_IF_NOT_NULL
7633 for (j = 0; j < 2; j++) {
7668 for (j = 0; j < 2; j++) {
#define BV_ISSET(bv, bit)
struct canvas int int struct sprite int int int int height
struct canvas int int int int struct sprite *sprite struct canvas struct color * pcolor
struct canvas int int struct sprite int int offset_y
struct canvas int int struct sprite int offset_x
struct canvas int int struct sprite int int int width
bool has_capabilities(const char *us, const char *them)
bool base_city_celebrating(const struct city *pcity)
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)
static const struct city struct citystyle * city_styles
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)
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)
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)
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 * 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 struct unit struct city * pcity
bool editor_is_active(void)
bool editor_tile_is_selected(const struct tile *ptile)
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct req_context *other_context, enum effect_type effect_type)
static struct @25 events[]
const char * get_event_tag(enum event_type event)
#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
void show_tileset_error(bool fatal, const char *tset_name, const char *msg)
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 free_sprite(struct sprite *s)
struct sprite * create_sprite(int width, int height, struct color *pcolor)
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, bool svgflag)
const char ** gfx_fileextensions(void)
bool popup_theme_suggestion_dialog(const char *theme_name)
void gui_clear_theme(void)
struct client_properties gui_properties
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)
void update_map_canvas(int canvas_x, int canvas_y, int width, int height)
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)
const char * modpack_tileset_target(const char *name)
void modpack_tileset_cache_iterate(mrc_cb cb, void *data)
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
#define secfile_entry_ignore_by_path(_sfile_, _path_)
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)
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)
struct sprite int int int int struct sprite * mask
struct sprite int int int int struct sprite int int float scale
struct sprite int int int int struct sprite int int float bool smooth get_sprite_dimensions
int main(int argc, char *argv[])
static bool wall(char *str, bool check)
void strvec_append(struct strvec *psv, const char *string)
struct strvec * strvec_new(void)
struct sprite * sprite[MAX_NUM_CITIZEN_SPRITES]
struct citizen_graphic citizen[CITIZEN_LAST]
struct citizen_graphic specialist[SP_MAX]
struct city_style_threshold * land_thresholds
struct city_sprite::@259 * styles
struct sprite_vector occupancy
struct civ_game::@32::@35 client
struct rgbcolor * plr_bg_color
struct packet_ruleset_control control
struct packet_game_info info
char gui_sdl3_default_theme_name[512]
bool draw_fortress_airbase
bool draw_unit_stack_size
char gui_sdl2_default_theme_name[512]
char gui_gtk5_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_alt2[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
struct named_sprites::@263 explode
struct sprite * government[G_LAST]
struct sprite_vector nation_shield
struct citizen_set default_citizens
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 named_sprites::@266 city
struct named_sprites::@270::@276::@277 bmf
struct sprite * spaceship[SPACESHIP_COUNT]
struct named_sprites::@268 user
struct sprite * selected[EDGE_COUNT]
struct sprite * transform
struct named_sprites::@270::@276::@278::@279::@280 combo
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 sprite * size_tens[NUM_TILES_DIGITS]
struct city_sprite * tile
union named_sprites::@270::@276::@278::@279 ru
struct sprite * tile_tradenum[NUM_TILES_DIGITS]
struct sprite * unworked_tile
struct sprite * fortified
struct sprite * dither_tile
struct sprite * coastline[EDGE_COUNT]
struct style_citizen_set style_citizen_sets
struct sprite * treaty_thumb[2]
struct named_sprites::@261 units
union named_sprites::@270::@276 u
struct sprite * tax_luxury
struct sprite_vector unit
struct sprite * building[B_LAST]
struct sprite * turns_hundreds[NUM_TILES_DIGITS]
struct sprite * total[MAX_INDEX_VALID]
struct named_sprites::@269 tx
struct sprite * unhappy[MAX_NUM_UPKEEP_SPRITES]
struct sprite_vector worked_tile_overlay
struct named_sprites::@267 path
struct sprite * corner[8]
struct sprite * darkness[MAX_INDEX_CARDINAL]
struct named_sprites::@270::@276::@278 road
struct sprite * tax_science
struct sprite * icon[ICON_COUNT]
struct sprite * odd[MAX_INDEX_HALF]
struct sprite * unavailable
struct sprite * worked_tile
struct river_sprites rivers
struct drawing_data * drawing[MAX_NUM_ITEMS]
struct citybar_sprites citybar
struct sprite * auto_explore
struct sprite * turns_tens[NUM_TILES_DIGITS]
struct sprite * tech[A_LAST]
struct anim * action_decision_want
struct named_sprites::@272 colors
struct named_sprites::@265 upkeep
struct named_sprites::@270 extras[MAX_EXTRA_TYPES]
struct sprite * worked[EDGE_COUNT]
struct sprite_vector overlays
struct editor_sprites editor
struct sprite * size_hundreds[NUM_TILES_DIGITS]
struct sprite * size[NUM_TILES_DIGITS]
struct named_sprites::@271 grid
struct sprite * cardinals[MAX_INDEX_CARDINAL]
struct named_sprites::@274 player[MAX_NUM_PLAYER_SLOTS]
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 anim * middleground
struct named_sprites::@262 cursor[CURSOR_LAST]
struct named_sprites::@260 mask
struct sprite * arrow[ARROW_LAST]
struct sprite * grid_borders[EDGE_COUNT][2]
struct named_sprites::@267::@275 s[GTS_COUNT]
struct sprite * facing[U_LAST][DIR8_MAGIC_MAX][ACTIVITY_LAST]
struct sprite * attention
struct city_sprite * occupied
struct sprite * cultivate
struct sprite * auto_worker
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 sprite * big_sprite
char graphic_alt[MAX_LEN_NAME]
struct citizen_set * sets
char graphic_alt2[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
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]
int default_time_per_frame
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]
struct anim_hash * anim_hash
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
enum unit_activity activity
struct unit::@84::@86 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)
const char ** ordered_gfx_fextensions(void)
#define is_svg_flag_enabled()
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)
static Tech_type_id advance_count(void)
#define advance_iterate(_p)
#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)
static int fill_unit_type_sprite_array(const struct tileset *t, struct drawn_sprite *sprs, const struct unit_type *putype, enum unit_activity activity, enum direction8 facing)
void advance_global_anim_state(void)
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)
#define SET_SPRITE_DEPR_ALT(field, tag, alt, ver)
int tileset_unit_width(const 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 void free_all_anims(struct tileset *t)
static bool check_tilespec_capabilities(struct section_file *file, const char *which, const char *us_capstr, const char *filename, bool verbose)
int tileset_small_sprite_width(const struct tileset *t)
static struct sprite * load_gfx_file(const char *gfx_filename, bool svgflag)
#define specfile_list_iterate_end
static struct sprite * create_plr_sprite(struct color *pcolor)
int tileset_svg_flag_height(struct tileset *t)
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)
void tileset_setup_specialist_type_default_set(struct tileset *t, Specialist_type_id id)
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)
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)
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
static void anim_free(struct anim *a)
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)
struct sprite * load_popup_sprite(const char *tag)
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)
static void ts_cb(const char *modpack_name, const char *filename, void *data)
int tileset_num_city_colors(const struct tileset *t)
int index_ts_topology(int idx)
#define anim_hash_iterate(hash, tag_name, sprite)
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)
#define FULL_TILE_X_OFFSET
static int global_anim_time
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)
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)
#define ADD_FRAME0_IF_NOT_NULL(x)
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)
#define ADD_ANIM_SPRITE(s, draw_fog, x_offset, y_offset)
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)
static void anim_advance_time(struct anim *a)
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)
static struct sprite * load_sprite(struct tileset *t, const char *tag_name, bool scale, bool smooth, bool svgflag)
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)
static void tileset_setup_citizen_types_default_set(struct tileset *t)
bool tileset_is_fully_loaded(void)
static struct sprite * anim_get_current_frame(struct anim *a)
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)
#define ADD_ANIM_SPRITE_SIMPLE(s)
const struct citybar_sprites * get_citybar_sprites(const struct tileset *t)
static bool is_cardinal_tileset_dir(const struct tileset *t, enum direction8 dir)
void unload_popup_sprite(const char *tag)
#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_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)
static bool tileset_scan_single_list(struct tileset *t, const char *spec_filenames[], int num_spec_files, bool verbose, bool duplicates_ok)
#define anim_hash_iterate_end
static struct anim * anim_new(int frames, int time_per_frame)
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)
#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 void tileset_setup_specialist_type(struct tileset *t, struct citizen_set *set, Specialist_type_id id, const char *tag_group, const char *set_name, bool required)
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)
static const struct citizen_graphic * get_citizen_graphic(const struct citizen_set *set, enum citizen_category type)
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)
static struct anim * anim_load(struct tileset *t, const char *tag, int time_per_frame)
struct sprite * get_tax_sprite(const struct tileset *t, Output_type_id otype)
static bool tileset_setup_unit_direction(struct tileset *t, int uidx, const char *base_str, enum direction8 dir, enum unit_activity activity, bool has_icon)
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 bool focus_unit_state
static void free_city_sprite(struct city_sprite *city_sprite)
static int ts_topology_index(int actual_topology)
struct sprite * get_unittype_sprite(const struct tileset *t, const struct unit_type *punittype, enum unit_activity activity, enum direction8 facing)
char * tileset_what_ruleset(struct tileset *t)
static void ts_list_cb(const char *modpack_name, const char *filename, void *data)
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_citizen_types(struct tileset *t, struct citizen_set *set, const char *tag_group, const char *set_name, bool required)
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 ADD_FRAME0_SIMPLE(s)
#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 SET_ANIM(field, tag)
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 is_flagless_to_player(const struct unit *punit, const struct player *pplayer)
bool unit_has_orders(const struct unit *punit)
#define activity_type_iterate(_act_)
#define activity_type_iterate_end
#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