Author: cazfi
Date: Sun Nov  6 15:35:48 2016
New Revision: 34405

URL: http://svn.gna.org/viewcvs/freeciv?rev=34405&view=rev
Log:
Added support for tileset specified offset for selected unit sprites.

See patch #7923

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=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/client/tilespec.c     (original)
+++ trunk/client/tilespec.c     Sun Nov  6 15:35:48 2016
@@ -495,6 +495,8 @@
   int tilelabel_offset_y;
   int activity_offset_x;
   int activity_offset_y;
+  int select_offset_x;
+  int select_offset_y;
   int occupied_offset_x;
   int occupied_offset_y;
   int unit_upkeep_offset_y;
@@ -1970,6 +1972,10 @@
                              "tilespec.activity_offset_x")
       || !secfile_lookup_int(file, &t->activity_offset_y,
                              "tilespec.activity_offset_y")
+      || !secfile_lookup_int(file, &t->select_offset_x,
+                             "tilespec.select_offset_x")
+      || !secfile_lookup_int(file, &t->select_offset_y,
+                             "tilespec.select_offset_y")
       || !secfile_lookup_int(file, &t->city_offset_x,
                              "tilespec.city_offset_x")
       || !secfile_lookup_int(file, &t->city_offset_y,
@@ -5662,7 +5668,8 @@
          && t->sprites.unit.select[0]) {
        /* Special case for drawing the selection rectangle.  The blinking
         * unit is handled separately, inside get_drawable_unit(). */
-       ADD_SPRITE_SIMPLE(t->sprites.unit.select[focus_unit_state]);
+       ADD_SPRITE(t->sprites.unit.select[focus_unit_state], TRUE,
+                   t->select_offset_x, t->select_offset_y);
       }
 
       sprs += fill_unit_sprite_array(t, sprs, punit, stacked, backdrop);

Modified: trunk/data/alio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alio.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/alio.tilespec    (original)
+++ trunk/data/alio.tilespec    Sun Nov  6 15:35:48 2016
@@ -61,6 +61,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 74
 activity_offset_y = 28
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 15

Modified: trunk/data/amplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/amplio.tilespec  (original)
+++ trunk/data/amplio.tilespec  Sun Nov  6 15:35:48 2016
@@ -52,6 +52,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 0
 activity_offset_y = 0
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 0

Modified: trunk/data/amplio2.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio2.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/amplio2.tilespec (original)
+++ trunk/data/amplio2.tilespec Sun Nov  6 15:35:48 2016
@@ -52,6 +52,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 49
 activity_offset_y = 0
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 0

Modified: trunk/data/cimpletoon.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/cimpletoon.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/cimpletoon.tilespec      (original)
+++ trunk/data/cimpletoon.tilespec      Sun Nov  6 15:35:48 2016
@@ -56,6 +56,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 0
 activity_offset_y = 0
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 0

Modified: trunk/data/hex2t.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/hex2t.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/hex2t.tilespec   (original)
+++ trunk/data/hex2t.tilespec   Sun Nov  6 15:35:48 2016
@@ -55,6 +55,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 0
 activity_offset_y = 0
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 0

Modified: trunk/data/hexemplio.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/hexemplio.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/hexemplio.tilespec       (original)
+++ trunk/data/hexemplio.tilespec       Sun Nov  6 15:35:48 2016
@@ -57,6 +57,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 74
 activity_offset_y = 28
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 15

Modified: trunk/data/isophex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/isophex.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/isophex.tilespec (original)
+++ trunk/data/isophex.tilespec Sun Nov  6 15:35:48 2016
@@ -55,6 +55,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 0
 activity_offset_y = 0
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 0

Modified: trunk/data/isotrident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/isotrident.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/isotrident.tilespec      (original)
+++ trunk/data/isotrident.tilespec      Sun Nov  6 15:35:48 2016
@@ -54,6 +54,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 0
 activity_offset_y = 0
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 0

Modified: trunk/data/toonhex.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/toonhex.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/toonhex.tilespec (original)
+++ trunk/data/toonhex.tilespec Sun Nov  6 15:35:48 2016
@@ -58,6 +58,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 74
 activity_offset_y = 28
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 15

Modified: trunk/data/trident.tilespec
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/trident.tilespec?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/data/trident.tilespec (original)
+++ trunk/data/trident.tilespec Sun Nov  6 15:35:48 2016
@@ -53,6 +53,10 @@
 ; offset of the normal activity icons
 activity_offset_x = 0
 activity_offset_y = 0
+
+; offset of the selected unit sprites
+select_offset_x = 0
+select_offset_y = 0
 
 ; offset the cities by this amount
 city_offset_x = 0

Modified: trunk/doc/README.graphics
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.graphics?rev=34405&r1=34404&r2=34405&view=diff
==============================================================================
--- trunk/doc/README.graphics   (original)
+++ trunk/doc/README.graphics   Sun Nov  6 15:35:48 2016
@@ -132,6 +132,8 @@
   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
+  select_offset_x      : Gives an offset from the tile origin at which to
+  select_offset_y        draw selected unit sprites.
   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.


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

Reply via email to