Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] Re: (PR#9119) veteran and stack sprites
Home

[Freeciv-Dev] Re: (PR#9119) veteran and stack sprites

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9119) veteran and stack sprites
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 27 Jun 2004 09:35:43 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9119 >

OK, this patch makes two changes:

- Don't die if a vet_lev sprite isn't present.  Instead just don't use 
it.  This prevents non-supporting tilesets from completely failing, and 
is faster since I've removed the empty veteran=0 sprite.

- Draw the vet_lev sprite even if the stacked sprite is present.  This 
works fine for isotrident but not for trident.  Either the stacked 
sprite or all of the veteran sprites must be moved.  The former seems 
easier.  I tried moving it up and moving it left.  The two attached 
screenshots show this.  I prefer the second one.  I'll attach the image 
files as comments.

jason


? data/trident/stack
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.177
diff -u -r1.177 tilespec.c
--- client/tilespec.c   25 Jun 2004 23:35:55 -0000      1.177
+++ client/tilespec.c   27 Jun 2004 16:31:56 -0000
@@ -1136,7 +1136,7 @@
 
   for(i = 0; i < MAX_VET_LEVELS; i++) {
     my_snprintf(buffer, sizeof(buffer), "unit.vet_%d", i);
-    SET_SPRITE(unit.vet_lev[i], buffer);
+    sprites.unit.vet_lev[i] = load_sprite(buffer);
   }
 
   SET_SPRITE(city.disorder, "city.disorder");
@@ -1689,10 +1689,12 @@
 
   if (stack || punit->occupy) {
     ADD_SPRITE_FULL(sprites.unit.stack);
-  } else {
+  }
+
+  if (sprites.unit.vet_lev[punit->veteran]) {
     ADD_SPRITE_FULL(sprites.unit.vet_lev[punit->veteran]);
   }
- 
+
   ihp = ((NUM_TILES_HP_BAR-1)*punit->hp) / unit_type(punit)->hp;
   ihp = CLIP(0, ihp, NUM_TILES_HP_BAR-1);
   ADD_SPRITE_FULL(sprites.unit.hp_bar[ihp]);
Index: data/isotrident/units.spec
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/isotrident/units.spec,v
retrieving revision 1.6
diff -u -r1.6 units.spec
--- data/isotrident/units.spec  3 Feb 2004 20:21:15 -0000       1.6
+++ data/isotrident/units.spec  27 Jun 2004 16:31:57 -0000
@@ -78,7 +78,6 @@
 
 ; Veteran Levels: up to 9 military honors for experienced units
 
-  3, 10, "unit.vet_0"
   3, 0, "unit.vet_1"
   3, 1, "unit.vet_2"
   3, 2, "unit.vet_3"
Index: data/trident/tiles.png
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/trident/tiles.png,v
retrieving revision 1.3
diff -u -r1.3 tiles.png
Binary files /tmp/cvsHbgphn and tiles.png differ
Index: data/trident/tiles.spec
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/trident/tiles.spec,v
retrieving revision 1.15
diff -u -r1.15 tiles.spec
--- data/trident/tiles.spec     24 Feb 2004 05:20:26 -0000      1.15
+++ data/trident/tiles.spec     27 Jun 2004 16:31:58 -0000
@@ -456,7 +456,6 @@
 
 ; Veteran Levels: up to 9 military honors for experienced units
 
- 17, 10, "unit.vet_0"
  17, 11, "unit.vet_1"
  17, 12, "unit.vet_2"
  17, 13, "unit.vet_3"

PNG image

PNG image


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#9119) veteran and stack sprites, Jason Short <=