[Freeciv-Dev] (PR#13950) separate unit and city flag offsets
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13950 >
The tilespec format allows definition of the offset from the tile origin
at which to draw flags.
In the Amplio tileset however the city graphics take up a large area.
For cities, the flag needs to be drawn further away from the origin than
it does for units. Thus an experimental feature is to add a separate
unit and city flag offset. This patch does that. It only does the
tilespec.c changes (no tileset changes are done although all tilesets
need to be updated).
I'm not entirely convinced this will solve the problem. With all the
tileset options these days (shield-graphics-for-units, larger-citybar,
etc.) it may be hard to get things to work with all combinations. But
this patch should give the artists something to play around with.
-jason
? diff
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.322
diff -p -u -r1.322 tilespec.c
--- client/tilespec.c 25 Aug 2005 18:57:22 -0000 1.322
+++ client/tilespec.c 13 Sep 2005 08:17:59 -0000
@@ -352,7 +352,8 @@ struct tileset {
enum fog_style fogstyle;
enum darkness_style darkness_style;
- int flag_offset_x, flag_offset_y;
+ int unit_flag_offset_x, unit_flag_offset_y;
+ int city_flag_offset_x, city_flag_offset_y;
int unit_offset_x, unit_offset_y;
int citybar_offset_y;
@@ -387,7 +388,7 @@ struct tileset {
struct tileset *tileset;
-#define TILESPEC_CAPSTR "+tilespec3 duplicates_ok +Freeciv.Devel.2005.Jun.6"
+#define TILESPEC_CAPSTR "+tilespec3 duplicates_ok +Freeciv.Devel.2005.Sep.13"
/*
* Tilespec capabilities acceptable to this program:
*
@@ -1315,14 +1316,16 @@ struct tileset *tileset_read_toplevel(co
freelog(LOG_FATAL, _("Invalid darkness style set in tileset."));
exit(EXIT_FAILURE);
}
- t->flag_offset_x = secfile_lookup_int_default(file, 0,
- "tilespec.flag_offset_x");
- t->flag_offset_y = secfile_lookup_int_default(file, 0,
- "tilespec.flag_offset_y");
- t->unit_offset_x = secfile_lookup_int_default(file, 0,
- "tilespec.unit_offset_x");
- t->unit_offset_y = secfile_lookup_int_default(file, 0,
- "tilespec.unit_offset_y");
+ t->unit_flag_offset_x
+ = secfile_lookup_int(file, "tilespec.unit_flag_offset_x");
+ t->unit_flag_offset_y
+ = secfile_lookup_int(file, "tilespec.unit_flag_offset_y");
+ t->city_flag_offset_x
+ = secfile_lookup_int(file, "tilespec.city_flag_offset_x");
+ t->city_flag_offset_y
+ = secfile_lookup_int(file, "tilespec.city_flag_offset_y");
+ t->unit_offset_x = secfile_lookup_int(file, "tilespec.unit_offset_x");
+ t->unit_offset_y = secfile_lookup_int(file, "tilespec.unit_offset_y");
t->citybar_offset_y
= secfile_lookup_int_default(file, t->normal_tile_height,
@@ -2784,8 +2787,8 @@ static int fill_unit_sprite_array(const
if (backdrop) {
if (!solid_color_behind_units) {
ADD_SPRITE(get_unit_nation_flag_sprite(t, punit), TRUE,
- FULL_TILE_X_OFFSET + t->flag_offset_x,
- FULL_TILE_Y_OFFSET + t->flag_offset_y);
+ FULL_TILE_X_OFFSET + t->unit_flag_offset_x,
+ FULL_TILE_Y_OFFSET + t->unit_flag_offset_y);
} else {
/* Taken care of in the LAYER_BACKGROUND. */
}
@@ -3922,8 +3925,8 @@ int fill_sprite_array(struct tileset *t,
if (pcity && draw_cities) {
if (!draw_full_citybar && !solid_color_behind_units) {
ADD_SPRITE(get_city_flag_sprite(t, pcity), TRUE,
- FULL_TILE_X_OFFSET + t->flag_offset_x,
- FULL_TILE_Y_OFFSET + t->flag_offset_y);
+ FULL_TILE_X_OFFSET + t->city_flag_offset_x,
+ FULL_TILE_Y_OFFSET + t->city_flag_offset_y);
}
ADD_SPRITE_FULL(get_city_sprite(t, pcity));
if (!draw_full_citybar && pcity->client.occupied) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#13950) separate unit and city flag offsets,
Jason Short <=
|
|