Author: cazfi
Date: Mon Nov  7 08:58:47 2016
New Revision: 34431

URL: http://svn.gna.org/viewcvs/freeciv?rev=34431&view=rev
Log:
Added support for tileset specified offset for city size number sprites.

See patch #7946

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=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/client/tilespec.c     (original)
+++ trunk/client/tilespec.c     Mon Nov  7 08:58:47 2016
@@ -490,6 +490,7 @@
   int city_flag_offset_x, city_flag_offset_y;
   int unit_offset_x, unit_offset_y;
   int city_offset_x, city_offset_y;
+  int city_size_offset_x, city_size_offset_y;
 
   int citybar_offset_y;
   int tilelabel_offset_y;
@@ -1980,6 +1981,10 @@
                              "tilespec.city_offset_x")
       || !secfile_lookup_int(file, &t->city_offset_y,
                              "tilespec.city_offset_y")
+      || !secfile_lookup_int(file, &t->city_size_offset_x,
+                             "tilespec.city_size_offset_x")
+      || !secfile_lookup_int(file, &t->city_size_offset_y,
+                             "tilespec.city_size_offset_y")
       || !secfile_lookup_int(file, &t->citybar_offset_y,
                              "tilespec.citybar_offset_y")
       || !secfile_lookup_int(file, &t->tilelabel_offset_y,
@@ -5746,18 +5751,22 @@
     if (pcity && gui_options.draw_cities && !gui_options.draw_full_citybar) {
       bool warn = FALSE;
 
-      ADD_SPRITE(t->sprites.city.size[city_size_get(pcity) % 10],
-                 FALSE, FULL_TILE_X_OFFSET, FULL_TILE_Y_OFFSET);
+      ADD_SPRITE(t->sprites.city.size[city_size_get(pcity) % 10], FALSE,
+                 FULL_TILE_X_OFFSET + t->city_size_offset_x,
+                 FULL_TILE_Y_OFFSET + t->city_size_offset_y);
       if (10 <= city_size_get(pcity)) {
-        ADD_SPRITE(t->sprites.city.size_tens[(city_size_get(pcity) / 10)
-                   % 10], FALSE, FULL_TILE_X_OFFSET, FULL_TILE_Y_OFFSET);
+        ADD_SPRITE(t->sprites.city.size_tens[(city_size_get(pcity) / 10) 
+                   % 10], FALSE,
+                   FULL_TILE_X_OFFSET + t->city_size_offset_x,
+                   FULL_TILE_Y_OFFSET + t->city_size_offset_y);
         if (100 <= city_size_get(pcity)) {
           struct sprite *sprite =
               t->sprites.city.size_hundreds[(city_size_get(pcity) / 100) % 10];
 
           if (NULL != sprite) {
             ADD_SPRITE(sprite, FALSE,
-                       FULL_TILE_X_OFFSET, FULL_TILE_Y_OFFSET);
+                       FULL_TILE_X_OFFSET + t->city_size_offset_x,
+                       FULL_TILE_Y_OFFSET + t->city_size_offset_y);
           } else {
             warn = TRUE;
           }

Modified: trunk/data/alio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alio.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/alio.tilespec    (original)
+++ trunk/data/alio.tilespec    Mon Nov  7 08:58:47 2016
@@ -69,6 +69,11 @@
 ; offset the cities by this amount
 city_offset_x = 15
 city_offset_y = 20
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 40

Modified: trunk/data/amplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/amplio.tilespec  (original)
+++ trunk/data/amplio.tilespec  Mon Nov  7 08:58:47 2016
@@ -60,6 +60,11 @@
 ; offset the cities by this amount
 city_offset_x = 0
 city_offset_y = 0
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 30

Modified: trunk/data/amplio2.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio2.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/amplio2.tilespec (original)
+++ trunk/data/amplio2.tilespec Mon Nov  7 08:58:47 2016
@@ -60,6 +60,11 @@
 ; offset the cities by this amount
 city_offset_x = 0
 city_offset_y = 0
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 30

Modified: trunk/data/cimpletoon.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/cimpletoon.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/cimpletoon.tilespec      (original)
+++ trunk/data/cimpletoon.tilespec      Mon Nov  7 08:58:47 2016
@@ -64,6 +64,11 @@
 ; offset the cities by this amount
 city_offset_x = 0
 city_offset_y = 0
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 30

Modified: trunk/data/hex2t.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/hex2t.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/hex2t.tilespec   (original)
+++ trunk/data/hex2t.tilespec   Mon Nov  7 08:58:47 2016
@@ -63,6 +63,11 @@
 ; offset the cities by this amount
 city_offset_x = 0
 city_offset_y = 0
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 48

Modified: trunk/data/hexemplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/hexemplio.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/hexemplio.tilespec       (original)
+++ trunk/data/hexemplio.tilespec       Mon Nov  7 08:58:47 2016
@@ -65,6 +65,11 @@
 ; offset the cities by this amount
 city_offset_x = 15
 city_offset_y = 20
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 40

Modified: trunk/data/isophex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/isophex.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/isophex.tilespec (original)
+++ trunk/data/isophex.tilespec Mon Nov  7 08:58:47 2016
@@ -63,6 +63,11 @@
 ; offset the cities by this amount
 city_offset_x = 0
 city_offset_y = 0
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 20

Modified: trunk/data/isotrident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/isotrident.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/isotrident.tilespec      (original)
+++ trunk/data/isotrident.tilespec      Mon Nov  7 08:58:47 2016
@@ -62,6 +62,11 @@
 ; offset the cities by this amount
 city_offset_x = 0
 city_offset_y = 0
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 20

Modified: trunk/data/toonhex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/toonhex.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/toonhex.tilespec (original)
+++ trunk/data/toonhex.tilespec Mon Nov  7 08:58:47 2016
@@ -66,6 +66,11 @@
 ; offset the cities by this amount
 city_offset_x = 15
 city_offset_y = 20
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 40

Modified: trunk/data/trident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/trident.tilespec?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/data/trident.tilespec (original)
+++ trunk/data/trident.tilespec Mon Nov  7 08:58:47 2016
@@ -61,6 +61,11 @@
 ; offset the cities by this amount
 city_offset_x = 0
 city_offset_y = 0
+
+; offset the city size number by this amount
+; This is relative to full sprite origin.
+city_size_offset_x = 0
+city_size_offset_y = 0
 
 ; offset the city bar text by this amount (from the city tile origin)
 citybar_offset_y = 27

Modified: trunk/doc/README.graphics
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.graphics?rev=34431&r1=34430&r2=34431&view=diff
==============================================================================
--- trunk/doc/README.graphics   (original)
+++ trunk/doc/README.graphics   Mon Nov  7 08:58:47 2016
@@ -126,6 +126,8 @@
   city_flag_offset_y     is placed correctly behind the unit/city.
   occupied_offset_x    : Gives an offset form the tile origin at which to
   occupied_offset_y      draw city occupied icon (in many tilesets placed 
above the flag)
+  city_size_offset_x   : Gives an offset from the full tile origin at which to
+  city_size_offset_y     draw city size number.
   unit_offset_x        : Gives an offset from the tile origin at which to
   unit_offset_y          draw units.
   activity_offset_x    : Gives an offset from the tile origin at which to


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

Reply via email to