Author: mir3x Date: Thu Feb 2 20:56:50 2017 New Revision: 34939 URL: http://svn.gna.org/viewcvs/freeciv?rev=34939&view=rev Log: Fixed some tileset variables scaled 2 times
See bug #25474 Modified: branches/S2_6/client/tilespec.c Modified: branches/S2_6/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=34939&r1=34938&r2=34939&view=diff ============================================================================== --- branches/S2_6/client/tilespec.c (original) +++ branches/S2_6/client/tilespec.c Thu Feb 2 20:56:50 2017 @@ -1915,8 +1915,12 @@ log_error("Tileset \"%s\" invalid: %s", t->name, secfile_error()); goto ON_ERROR; } - t->unit_tile_width = ceil(t->unit_tile_width * t->scale); - t->unit_tile_height = ceil(t->unit_tile_height * t->scale); + if (t->unit_tile_width != t->unit_tile_width && t->scale != 1.0f) { + t->unit_tile_width = ceil(t->unit_tile_width * t->scale); + } + if (t->unit_tile_height != t->unit_tile_height && t->scale != 1.0f) { + t->unit_tile_height = ceil(t->unit_tile_height * t->scale); + } t->small_sprite_width = t->small_sprite_width * t->scale; t->small_sprite_height = t->small_sprite_height * t->scale; log_verbose("tile sizes %dx%d, %d%d unit, %d%d small", @@ -2014,9 +2018,14 @@ t->tilelabel_offset_y = t->scale * t->tilelabel_offset_y; t->occupied_offset_x = t->scale * t->occupied_offset_x; t->occupied_offset_y = t->scale * t->occupied_offset_y; - t->unit_upkeep_offset_y = t->scale * t->unit_upkeep_offset_y; - t->unit_upkeep_small_offset_y = t->scale * t->unit_upkeep_small_offset_y; - + if (t->scale != 1.0f + && t->unit_upkeep_offset_y != tileset_tile_height(t)) { + t->unit_upkeep_offset_y = t->scale * t->unit_upkeep_offset_y; + } + if (t->scale != 1.0f + && t->unit_upkeep_small_offset_y != t->unit_upkeep_offset_y) { + t->unit_upkeep_small_offset_y = t->scale * t->unit_upkeep_small_offset_y; + } set_city_names_font_sizes(t->city_names_font_size, t->city_productions_font_size); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits