Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10760) alternate flags
Home

[Freeciv-Dev] (PR#10760) alternate flags

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10760) alternate flags
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Oct 2004 11:48:56 -0700
Reply-to: rt@xxxxxxxxxxx

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

The first patch gives Bosnia an alternate flag.  This should be applied 
immediately since otherwise beta2 clients are unplayable on current S2_0 
servers.

The second patch changes clients to automatically use a fallback if no 
flag graphic is available.  In the long run this replaces the need for 
the first patch (but not in the short term, since beta2 clients won't 
have this).  Note this doesn't replace the need for a graphic_alt tag 
for flags, since there may be a better alternate than f.unknown available.

jason

Index: data/nation/bosnia.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/bosnia.ruleset,v
retrieving revision 1.2
diff -u -r1.2 bosnia.ruleset
--- data/nation/bosnia.ruleset  26 Oct 2004 14:58:57 -0000      1.2
+++ data/nation/bosnia.ruleset  27 Oct 2004 18:38:52 -0000
@@ -12,7 +12,7 @@
            "Male","Male", "Male",
            "Male", "Male", "Male"
 flag="f.bosnia"
-flag_alt = "-"
+flag_alt = "f.unknown"
 city_style = "European"
 
 ruler_titles = { "government",      "male_title",      "female_title"
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.208
diff -u -r1.208 tilespec.c
--- client/tilespec.c   23 Oct 2004 19:10:26 -0000      1.208
+++ client/tilespec.c   27 Oct 2004 18:43:53 -0000
@@ -1813,13 +1813,22 @@
 ***********************************************************************/
 void tilespec_setup_nation_flag(int id)
 {
-  struct nation_type *this_nation = get_nation_by_idx(id);
+  struct nation_type *nation = get_nation_by_idx(id);
 
-  this_nation->flag_sprite = 
lookup_sprite_tag_alt(this_nation->flag_graphic_str, 
-                                           this_nation->flag_graphic_alt,
-                                           TRUE, "nation", this_nation->name);
-
-  /* should probably do something if NULL, eg generic default? */
+  nation->flag_sprite = load_sprite(nation->flag_graphic_str);
+  if (!nation->flag_sprite) {
+    nation->flag_sprite = load_sprite(nation->flag_graphic_alt);
+  }
+  if (!nation->flag_sprite) {
+    freelog(LOG_ERROR, "No flag for %s; using fallback graphic instead.",
+           nation->name);
+    nation->flag_sprite = load_sprite("f.unknown");
+  }
+  if (!nation->flag_sprite) {
+    freelog(LOG_FATAL,
+           "No fallback flag graphic (tag f.unknown) available.");
+    exit(EXIT_FAILURE);
+  }
 }
 
 /**********************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10760) alternate flags, Jason Short <=