Author: cazfi
Date: Mon Nov 16 22:00:38 2015
New Revision: 30644

URL: http://svn.gna.org/viewcvs/freeciv?rev=30644&view=rev
Log:
Made unit upkeep icon offset tileset configurable.

See patch #6511

Modified:
    trunk/client/tilespec.c
    trunk/data/alio.tilespec
    trunk/data/amplio.tilespec
    trunk/data/amplio2.tilespec
    trunk/data/cimpletoon.tilespec
    trunk/data/hex2t.tilespec
    trunk/data/hexemplio.tilespec
    trunk/data/isophex.tilespec
    trunk/data/isotrident.tilespec
    trunk/data/toonhex.tilespec
    trunk/data/trident.tilespec
    trunk/doc/README.graphics

Modified: trunk/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/client/tilespec.c     (original)
+++ trunk/client/tilespec.c     Mon Nov 16 22:00:38 2015
@@ -491,6 +491,7 @@
   int activity_offset_y;
   int occupied_offset_x;
   int occupied_offset_y;
+  int unit_upkeep_offset_y;
 
 #define NUM_CORNER_DIRS 4
 #define TILES_PER_CORNER 4
@@ -798,7 +799,7 @@
 ****************************************************************************/
 int tileset_unit_layout_offset_y(const struct tileset *t)
 {
-  return tileset_tile_height(tileset);
+  return t->unit_upkeep_offset_y;
 }
 
 /****************************************************************************
@@ -1841,6 +1842,9 @@
     log_error("Tileset \"%s\" invalid: %s", t->name, secfile_error());
     goto ON_ERROR;
   }
+
+  t->unit_upkeep_offset_y = secfile_lookup_int_default(file, 
tileset_tile_height(t),
+                                                       
"tilespec.unit_upkeep_offset_y");
 
   set_city_names_font_sizes(t->city_names_font_size,
                             t->city_productions_font_size);

Modified: trunk/data/alio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alio.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/alio.tilespec    (original)
+++ trunk/data/alio.tilespec    Mon Nov 16 22:00:38 2015
@@ -71,6 +71,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 20
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: trunk/data/amplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/amplio.tilespec  (original)
+++ trunk/data/amplio.tilespec  Mon Nov 16 22:00:38 2015
@@ -61,6 +61,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 15
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: trunk/data/amplio2.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio2.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/amplio2.tilespec (original)
+++ trunk/data/amplio2.tilespec Mon Nov 16 22:00:38 2015
@@ -61,6 +61,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 15
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: trunk/data/cimpletoon.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/cimpletoon.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/cimpletoon.tilespec      (original)
+++ trunk/data/cimpletoon.tilespec      Mon Nov 16 22:00:38 2015
@@ -61,6 +61,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 15
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: trunk/data/hex2t.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/hex2t.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/hex2t.tilespec   (original)
+++ trunk/data/hex2t.tilespec   Mon Nov 16 22:00:38 2015
@@ -64,6 +64,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 28
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "6x13bold"

Modified: trunk/data/hexemplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/hexemplio.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/hexemplio.tilespec       (original)
+++ trunk/data/hexemplio.tilespec       Mon Nov 16 22:00:38 2015
@@ -67,6 +67,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 20
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: trunk/data/isophex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/isophex.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/isophex.tilespec (original)
+++ trunk/data/isophex.tilespec Mon Nov 16 22:00:38 2015
@@ -64,6 +64,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 10
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: trunk/data/isotrident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/isotrident.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/isotrident.tilespec      (original)
+++ trunk/data/isotrident.tilespec      Mon Nov 16 22:00:38 2015
@@ -63,6 +63,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 10
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: trunk/data/toonhex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/toonhex.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/toonhex.tilespec (original)
+++ trunk/data/toonhex.tilespec Mon Nov 16 22:00:38 2015
@@ -68,6 +68,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 20
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font to use to draw city names:
 city_names_font = "9x15bold"

Modified: trunk/data/trident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/trident.tilespec?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/data/trident.tilespec (original)
+++ trunk/data/trident.tilespec Mon Nov 16 22:00:38 2015
@@ -63,6 +63,13 @@
 
 ; offset the tile label text by this amount
 tilelabel_offset_y = 10
+
+; offset the upkeep icons by this amount from the top of the unit itself.
+; The default is the normal tile height, which means that the upkeep icons
+; appear below the unit icon if the unit icons are equal to tile height
+; (typical in overhead tileset), or overlay lower part of the unit icon,
+; if unit icon is higher than tiles (typical in iso tilesets)
+;unit_upkeep_offset_y = 0
 
 ; Font size (points) to use to draw city names and productions:
 city_names_font_size = 10

Modified: trunk/doc/README.graphics
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.graphics?rev=30644&r1=30643&r2=30644&view=diff
==============================================================================
--- trunk/doc/README.graphics   (original)
+++ trunk/doc/README.graphics   Mon Nov 16 22:00:38 2015
@@ -130,6 +130,14 @@
   activity_offset_y      draw normal unit activity icons. "Auto" icons are not
                          affected by this as they are usually wanted in 
different
                          offset than real activity icons for both to appear 
simultaneously
+  unit_upkeep_offset_y : Gives an offset from the unit origin at which to draw
+                         the upkeep icons when they are shown along the unit. 
The upkeep
+                         icons can safely extend below the unit icon itself.
+                         If this value is omitted, normal tile height is used 
instead;
+                         - Upkeep icons appear below the unit icon if the unit 
icons are
+                           equal to tile height (typical in overhead tileset)
+                         - Upkeep icons overlay lower part of the unit icon, 
if unit icon
+                           is higher than tile height (typical in iso tilesets)
   citybar_offset_y     : Gives an offset from city tile origin at which to
                          draw city bar text.
   hex_side             : When is_hex is specified (see is_hex, below), this


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to