[Freeciv-commits] r34102 - in /branches/S2_6/client: client_main.c options.c options.h tilespec.c tilespec.h

2016-10-11 Thread cazfi74
Author: cazfi
Date: Wed Oct 12 02:29:31 2016
New Revision: 34102

URL: http://svn.gna.org/viewcvs/freeciv?rev=34102=rev
Log:
Fill initial default for tileset option for all topologies.

See patch #6875

Modified:
branches/S2_6/client/client_main.c
branches/S2_6/client/options.c
branches/S2_6/client/options.h
branches/S2_6/client/tilespec.c
branches/S2_6/client/tilespec.h

Modified: branches/S2_6/client/client_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/client_main.c?rev=34102=34101=34102=diff
==
--- branches/S2_6/client/client_main.c  (original)
+++ branches/S2_6/client/client_main.c  Wed Oct 12 02:29:31 2016
@@ -662,10 +662,12 @@
   helpdata_init();
   boot_help_texts();
 
+  fill_topo_ts_default();
+
   if (forced_tileset_name[0] != '\0') {
-tilespec_try_read(forced_tileset_name, TRUE);
+tilespec_try_read(forced_tileset_name, TRUE, -1, TRUE);
   } else {
-tilespec_try_read(gui_options.default_tileset_name, FALSE);
+tilespec_try_read(gui_options.default_tileset_name, FALSE, -1, TRUE);
   }
 
   audio_real_init(sound_set_name, music_set_name, sound_plugin_name);

Modified: branches/S2_6/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.c?rev=34102=34101=34102=diff
==
--- branches/S2_6/client/options.c  (original)
+++ branches/S2_6/client/options.c  Wed Oct 12 02:29:31 2016
@@ -6278,3 +6278,49 @@
   opt->str_vtable->set(opt, tileset_basename(t));
   option_gui_update(opt);
 }
+
+/
+  Does topology-specific tileset option lack value?
+/
+static bool is_ts_option_unset(const char *optname)
+{
+  struct option *opt;
+  const char *val;
+
+  opt = optset_option_by_name(client_optset, optname);
+
+  if (opt == NULL) {
+return TRUE;
+  }
+
+  val = opt->str_vtable->get(opt);
+
+  if (val == NULL || val[0] == '\0') {
+return TRUE;
+  }
+
+  return FALSE;
+}
+
+/
+  Fill default tilesets for topology-specific settings.
+/
+void fill_topo_ts_default(void)
+{
+  if (is_ts_option_unset("default_tileset_overhead_name")) {
+log_debug("Setting tileset for overhead topology.");
+tilespec_try_read(NULL, FALSE, 0, FALSE);
+  }
+  if (is_ts_option_unset("default_tileset_iso_name")) {
+log_debug("Setting tileset for iso topology.");
+tilespec_try_read(NULL, FALSE, TF_ISO, FALSE);
+  }
+  if (is_ts_option_unset("default_tileset_hex_name")) {
+log_debug("Setting tileset for hex topology.");
+tilespec_try_read(NULL, FALSE, TF_HEX, FALSE);
+  }
+  if (is_ts_option_unset("default_tileset_isohex_name")) {
+log_debug("Setting tileset for isohex topology.");
+tilespec_try_read(NULL, FALSE, TF_ISO | TF_HEX, FALSE);
+  }
+}

Modified: branches/S2_6/client/options.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.h?rev=34102=34101=34102=diff
==
--- branches/S2_6/client/options.h  (original)
+++ branches/S2_6/client/options.h  Wed Oct 12 02:29:31 2016
@@ -565,6 +565,7 @@
 
 const char *tileset_name_for_topology(int topology_id);
 void option_set_default_ts(struct tileset *t);
+void fill_topo_ts_default(void);
 
 #ifdef __cplusplus
 }

Modified: branches/S2_6/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=34102=34101=34102=diff
==
--- branches/S2_6/client/tilespec.c (original)
+++ branches/S2_6/client/tilespec.c Wed Oct 12 02:29:31 2016
@@ -967,7 +967,7 @@
 return is_valid_tileset_dir(t, dir);
   } else {
 return (dir == DIR8_NORTH || dir == DIR8_EAST
-   || dir == DIR8_SOUTH || dir == DIR8_WEST);
+|| dir == DIR8_SOUTH || dir == DIR8_WEST);
   }
 }
 
@@ -979,14 +979,15 @@
 {
   int idx;
 
-  if (actual_topology & TF_ISO) {
+  if ((actual_topology & TF_HEX)
+  && (actual_topology & TF_ISO)) {
+idx = TS_TOPO_ISOHEX;
+  } else if (actual_topology & TF_ISO) {
 idx = TS_TOPO_ISO;
+  } else if (actual_topology & TF_HEX) {
+idx = TS_TOPO_HEX;
   } else {
-idx = 0;
-  }
-
-  if (actual_topology & TF_HEX) {
-idx |= TS_TOPO_HEX;
+idx = TS_TOPO_OVERHEAD;
   }
 
   return idx;
@@ -1187,18 +1188,22 @@
   Call this function with the (guessed) name of the tileset, when
   starting the client.
 ***/
-void tilespec_try_read(const char *tileset_name, bool verbose)
-{
-  if (!(tileset = 

[Freeciv-commits] r34101 - in /trunk/client: client_main.c options.c options.h tilespec.c tilespec.h

2016-10-11 Thread cazfi74
Author: cazfi
Date: Wed Oct 12 02:29:23 2016
New Revision: 34101

URL: http://svn.gna.org/viewcvs/freeciv?rev=34101=rev
Log:
Fill initial default for tileset option for all topologies.

See patch #6875

Modified:
trunk/client/client_main.c
trunk/client/options.c
trunk/client/options.h
trunk/client/tilespec.c
trunk/client/tilespec.h

Modified: trunk/client/client_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/client_main.c?rev=34101=34100=34101=diff
==
--- trunk/client/client_main.c  (original)
+++ trunk/client/client_main.c  Wed Oct 12 02:29:23 2016
@@ -662,10 +662,12 @@
   helpdata_init();
   boot_help_texts();
 
+  fill_topo_ts_default();
+
   if (forced_tileset_name[0] != '\0') {
-tilespec_try_read(forced_tileset_name, TRUE);
+tilespec_try_read(forced_tileset_name, TRUE, -1, TRUE);
   } else {
-tilespec_try_read(gui_options.default_tileset_name, FALSE);
+tilespec_try_read(gui_options.default_tileset_name, FALSE, -1, TRUE);
   }
 
   audio_real_init(sound_set_name, music_set_name, sound_plugin_name);

Modified: trunk/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.c?rev=34101=34100=34101=diff
==
--- trunk/client/options.c  (original)
+++ trunk/client/options.c  Wed Oct 12 02:29:23 2016
@@ -6296,3 +6296,49 @@
   opt->str_vtable->set(opt, tileset_basename(t));
   option_gui_update(opt);
 }
+
+/
+  Does topology-specific tileset option lack value?
+/
+static bool is_ts_option_unset(const char *optname)
+{
+  struct option *opt;
+  const char *val;
+
+  opt = optset_option_by_name(client_optset, optname);
+
+  if (opt == NULL) {
+return TRUE;
+  }
+
+  val = opt->str_vtable->get(opt);
+
+  if (val == NULL || val[0] == '\0') {
+return TRUE;
+  }
+
+  return FALSE;
+}
+
+/
+  Fill default tilesets for topology-specific settings.
+/
+void fill_topo_ts_default(void)
+{
+  if (is_ts_option_unset("default_tileset_overhead_name")) {
+log_debug("Setting tileset for overhead topology.");
+tilespec_try_read(NULL, FALSE, 0, FALSE);
+  }
+  if (is_ts_option_unset("default_tileset_iso_name")) {
+log_debug("Setting tileset for iso topology.");
+tilespec_try_read(NULL, FALSE, TF_ISO, FALSE);
+  }
+  if (is_ts_option_unset("default_tileset_hex_name")) {
+log_debug("Setting tileset for hex topology.");
+tilespec_try_read(NULL, FALSE, TF_HEX, FALSE);
+  }
+  if (is_ts_option_unset("default_tileset_isohex_name")) {
+log_debug("Setting tileset for isohex topology.");
+tilespec_try_read(NULL, FALSE, TF_ISO | TF_HEX, FALSE);
+  }
+}

Modified: trunk/client/options.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.h?rev=34101=34100=34101=diff
==
--- trunk/client/options.h  (original)
+++ trunk/client/options.h  Wed Oct 12 02:29:23 2016
@@ -566,6 +566,7 @@
 
 const char *tileset_name_for_topology(int topology_id);
 void option_set_default_ts(struct tileset *t);
+void fill_topo_ts_default(void);
 
 #ifdef __cplusplus
 }

Modified: trunk/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=34101=34100=34101=diff
==
--- trunk/client/tilespec.c (original)
+++ trunk/client/tilespec.c Wed Oct 12 02:29:23 2016
@@ -980,7 +980,7 @@
 return is_valid_tileset_dir(t, dir);
   } else {
 return (dir == DIR8_NORTH || dir == DIR8_EAST
-   || dir == DIR8_SOUTH || dir == DIR8_WEST);
+|| dir == DIR8_SOUTH || dir == DIR8_WEST);
   }
 }
 
@@ -992,14 +992,15 @@
 {
   int idx;
 
-  if (actual_topology & TF_ISO) {
+  if ((actual_topology & TF_HEX)
+  && (actual_topology & TF_ISO)) {
+idx = TS_TOPO_ISOHEX;
+  } else if (actual_topology & TF_ISO) {
 idx = TS_TOPO_ISO;
+  } else if (actual_topology & TF_HEX) {
+idx = TS_TOPO_HEX;
   } else {
-idx = 0;
-  }
-
-  if (actual_topology & TF_HEX) {
-idx |= TS_TOPO_HEX;
+idx = TS_TOPO_OVERHEAD;
   }
 
   return idx;
@@ -1200,18 +1201,22 @@
   Call this function with the (guessed) name of the tileset, when
   starting the client.
 ***/
-void tilespec_try_read(const char *tileset_name, bool verbose)
-{
-  if (!(tileset = tileset_read_toplevel(tileset_name, verbose, -1))) {
+void tilespec_try_read(const char *tileset_name, bool verbose, int topo_id,
+   bool global_default)
+{
+  if 

[Freeciv-commits] r34100 - in /branches/S2_6: client/gui-gtk-3.22/menu.c data/gtk3.22_menus.xml

2016-10-11 Thread cazfi74
Author: cazfi
Date: Tue Oct 11 21:30:46 2016
New Revision: 34100

URL: http://svn.gna.org/viewcvs/freeciv?rev=34100=rev
Log:
Use gtk_builder instead of gtk_ui_manager in gtk3.22-client

See patch #7771

Modified:
branches/S2_6/client/gui-gtk-3.22/menu.c
branches/S2_6/data/gtk3.22_menus.xml

[This mail would be too long, it was shortened to contain the URLs only.]

Modified: branches/S2_6/client/gui-gtk-3.22/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/menu.c?rev=34100=34099=34100=diff

Modified: branches/S2_6/data/gtk3.22_menus.xml
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/gtk3.22_menus.xml?rev=34100=34099=34100=diff


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


[Freeciv-commits] r34099 - in /trunk: Makefile.am m4/gtk3x-client.m4

2016-10-11 Thread cazfi74
Author: cazfi
Date: Tue Oct 11 21:25:36 2016
New Revision: 34099

URL: http://svn.gna.org/viewcvs/freeciv?rev=34099=rev
Log:
Added gtk3x-client.m4

See patch #7799

Added:
trunk/m4/gtk3x-client.m4
Modified:
trunk/Makefile.am

Modified: trunk/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/Makefile.am?rev=34099=34098=34099=diff
==
--- trunk/Makefile.am   (original)
+++ trunk/Makefile.am   Tue Oct 11 21:25:36 2016
@@ -51,6 +51,7 @@
m4/gtk2-client.m4   \
m4/gtk3-client.m4   \
m4/gtk3.22-client.m4\
+   m4/gtk3x-client.m4  \
m4/iconv.m4 \
m4/intlmacosx.m4\
m4/lib-ld.m4\

Added: trunk/m4/gtk3x-client.m4
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/m4/gtk3x-client.m4?rev=34099=auto
==
--- trunk/m4/gtk3x-client.m4(added)
+++ trunk/m4/gtk3x-client.m4Tue Oct 11 21:25:36 2016
@@ -0,0 +1,31 @@
+# Try to configure the GTK+-3.x client (gui-gtk-3.9x)
+
+# FC_GTK3X_CLIENT
+# Test for GTK+-3.90 libraries needed for gui-gtk-3.9x
+
+AC_DEFUN([FC_GTK3X_CLIENT],
+[
+  # Add check "x$client" = "xauto"  when this becomes supported client
+  if test "x$gui_gtk3x" = "xyes" ||
+ test "x$client" = "xall" ; then
+PKG_CHECK_MODULES([GTK3X], [gtk+-4.0 >= 3.89.0],
+  [
+GTK3X_CFLAGS="$GTK3X_CFLAGS 
-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_90"
+GTK3X_CFLAGS="$GTK3X_CFLAGS 
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_50"
+gui_gtk3x=yes
+if test "x$client" = "xauto" ; then
+  client=yes
+fi
+gui_gtk3x_cflags="$GTK3X_CFLAGS"
+gui_gtk3x_libs="$GTK3X_LIBS"
+if test "x$MINGW" = "xyes"; then
+  dnl Required to compile gtk3 on Windows platform
+  gui_gtk3x_cflags="$gui_gtk3x_cflags -mms-bitfields"
+  gui_gtk3x_ldflags="$gui_gtk3x_ldflags -mwindows"
+fi
+  ],
+  [
+FC_NO_CLIENT([gtk3x], [GTK+-3.9x libraries not found])
+  ])
+  fi
+])


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


[Freeciv-commits] r34095 - in /trunk: common/actions.c common/actions.h server/rssanity.c

2016-10-11 Thread sveinung84
Author: sveinung
Date: Tue Oct 11 16:16:15 2016
New Revision: 34095

URL: http://svn.gna.org/viewcvs/freeciv?rev=34095=rev
Log:
Move obligatory hard requirements to actions.c.

An action may force all its enablers to include one or more of its hard
requirements. The information about what requirements are obligatory for
what actions has lived in rssanity.c's sanity_check_ruleset_data() until
now. Move it to the new function action_enabler_obligatory_reqs_missing().
Make it possible to check each individual action enabler.

See patch #7801

Modified:
trunk/common/actions.c
trunk/common/actions.h
trunk/server/rssanity.c

[This mail would be too long, it was shortened to contain the URLs only.]

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34095=34094=34095=diff

Modified: trunk/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.h?rev=34095=34094=34095=diff

Modified: trunk/server/rssanity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/rssanity.c?rev=34095=34094=34095=diff


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


[Freeciv-commits] r34094 - in /trunk/utility: string_vector.c string_vector.h

2016-10-11 Thread sveinung84
Author: sveinung
Date: Tue Oct 11 16:15:46 2016
New Revision: 34094

URL: http://svn.gna.org/viewcvs/freeciv?rev=34094=rev
Log:
Introduce are_strvecs_equal().

See patch #7800

Modified:
trunk/utility/string_vector.c
trunk/utility/string_vector.h

Modified: trunk/utility/string_vector.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/string_vector.c?rev=34094=34093=34094=diff
==
--- trunk/utility/string_vector.c   (original)
+++ trunk/utility/string_vector.c   Tue Oct 11 16:15:46 2016
@@ -346,6 +346,27 @@
 }
 
 /**
+  Returns TRUE if stv1 and stv2 are equal.
+**/
+bool are_strvecs_equal(const struct strvec *stv1,
+   const struct strvec *stv2)
+{
+  int i;
+
+  if (strvec_size(stv1) != strvec_size(stv2)) {
+return FALSE;
+  }
+
+  for (i = 0; i < strvec_size(stv1); i++) {
+if (0 != strcmp(stv1->vec[i], stv2->vec[i])) {
+  return FALSE;
+}
+  }
+
+  return TRUE;
+}
+
+/**
   Returns the datas of the vector.
 **/
 const char *const *strvec_data(const struct strvec *psv)

Modified: trunk/utility/string_vector.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/string_vector.h?rev=34094=34093=34094=diff
==
--- trunk/utility/string_vector.h   (original)
+++ trunk/utility/string_vector.h   Tue Oct 11 16:15:46 2016
@@ -45,6 +45,8 @@
 bool strvec_remove(struct strvec *psv, size_t svindex);
 
 size_t strvec_size(const struct strvec *psv);
+bool are_strvecs_equal(const struct strvec *stv1,
+   const struct strvec *stv2);
 const char *const *strvec_data(const struct strvec *psv);
 bool strvec_index_valid(const struct strvec *psv, size_t svindex);
 const char *strvec_get(const struct strvec *psv, size_t svindex);


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


[Freeciv-commits] r34093 - /branches/S2_6/doc/README.msys2

2016-10-11 Thread cazfi74
Author: cazfi
Date: Tue Oct 11 13:25:47 2016
New Revision: 34093

URL: http://svn.gna.org/viewcvs/freeciv?rev=34093=rev
Log:
Removed mention of gtk3x-client from README.msys2

See patch #7809

Modified:
branches/S2_6/doc/README.msys2

Modified: branches/S2_6/doc/README.msys2
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/doc/README.msys2?rev=34093=34092=34093=diff
==
--- branches/S2_6/doc/README.msys2  (original)
+++ branches/S2_6/doc/README.msys2  Tue Oct 11 13:25:47 2016
@@ -12,7 +12,7 @@
 - Msys1, not msys2, is still the official freeciv Windows Installer
   build method
 - Buildable clients are gtk3, gtk2, sdl2, and Qt
-  - Official pre-made msys2 environment supports only gtk3-, gtk3x-, and
+  - Official pre-made msys2 environment supports only gtk3- and
 sdl2-client builds
 
 


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