Author: cazfi
Date: Fri Aug  7 19:14:19 2015
New Revision: 29388

URL: http://svn.gna.org/viewcvs/freeciv?rev=29388&view=rev
Log:
Made radar graphics optional

See patch #5745

Modified:
    branches/S2_6/client/gui-stub/graphics.c
    branches/S2_6/client/gui-xaw/graphics.c
    branches/S2_6/client/tilespec.c

Modified: branches/S2_6/client/gui-stub/graphics.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-stub/graphics.c?rev=29388&r1=29387&r2=29388&view=diff
==============================================================================
--- branches/S2_6/client/gui-stub/graphics.c    (original)
+++ branches/S2_6/client/gui-stub/graphics.c    Fri Aug  7 19:14:19 2015
@@ -26,7 +26,6 @@
 #include "graphics.h"
 
 struct sprite *intro_gfx_sprite;
-struct sprite *radar_gfx_sprite;
 
 /****************************************************************************
   Return whether the client supports given view type
@@ -44,7 +43,6 @@
 {
   /* PORTME */
   intro_gfx_sprite = load_gfxfile(tileset_main_intro_filename(tileset));
-  radar_gfx_sprite = load_gfxfile(tileset_mini_intro_filename(tileset));
 }
 
 /****************************************************************************
@@ -65,8 +63,4 @@
     free_sprite(intro_gfx_sprite);
     intro_gfx_sprite = NULL;
   }
-  if (radar_gfx_sprite) {
-    free_sprite(radar_gfx_sprite);
-    radar_gfx_sprite = NULL;
-  }
 }

Modified: branches/S2_6/client/gui-xaw/graphics.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/graphics.c?rev=29388&r1=29387&r2=29388&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/graphics.c     (original)
+++ branches/S2_6/client/gui-xaw/graphics.c     Fri Aug  7 19:14:19 2015
@@ -84,6 +84,7 @@
   const char *motto = freeciv_motto();
   XFontSetExtents *exts;
   const char *rev_ver = fc_svn_revision();
+  const char *radar_name;
 
   /* metrics */
 
@@ -116,7 +117,18 @@
 
   /* Minimap graphic */
 
-  radar_gfx_sprite = load_gfxfile(tileset_mini_intro_filename(tileset));
+  radar_name = tileset_mini_intro_filename(tileset);
+
+  if (radar_name != NULL) {
+    radar_gfx_sprite = load_gfxfile(radar_name);
+  } else {
+    struct color *pcol = color_alloc(0, 0, 0);
+
+    radar_gfx_sprite = create_sprite(200, 75, pcol);
+
+    color_free(pcol);
+  }
+
   tot = radar_gfx_sprite->width;
 
   y = radar_gfx_sprite->height - (2 * lin +

Modified: branches/S2_6/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=29388&r1=29387&r2=29388&view=diff
==============================================================================
--- branches/S2_6/client/tilespec.c     (original)
+++ branches/S2_6/client/tilespec.c     Fri Aug  7 19:14:19 2015
@@ -1737,9 +1737,13 @@
   t->main_intro_filename = tilespec_gfx_filename(c);
   log_debug("intro file %s", t->main_intro_filename);
 
-  c = secfile_lookup_str(file, "tilespec.minimap_intro_file");
-  t->minimap_intro_filename = tilespec_gfx_filename(c);
-  log_debug("radar file %s", t->minimap_intro_filename);
+  c = secfile_lookup_str_default(file, NULL, "tilespec.minimap_intro_file");
+  if (c == NULL) {
+    t->minimap_intro_filename = NULL;
+  } else {
+    t->minimap_intro_filename = tilespec_gfx_filename(c);
+    log_debug("radar file %s", t->minimap_intro_filename);
+  }
 
   /* Terrain layer info. */
   for (i = 0; i < MAX_NUM_LAYERS; i++) {


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

Reply via email to