Re: [Freeciv-Dev] (PR#40165) Re: Expanded terrain set, request for info

2008-06-30 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40165 

2008/3/24 Marko Lindqvist:

  TERRAIN_XXX_IDENTIFIER definitions have to go, and terrains must be
 selected by properly checking their flags, ocean_depth -value, or what
 ever is appropriate for each case.

 Attached patch removes code that creates these special ocean types.
If such special features are needed in the future, they should be
reimplemented in a proper, generic, fashion.
 civ1  civ2 rulesets have only one ocean type, default ruleset three
types; Lake, Ocean and Deep Ocean.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/control.c freeciv/client/control.c
--- freeciv/client/control.c2008-06-24 01:37:58.0 +0300
+++ freeciv/client/control.c2008-06-30 21:01:55.0 +0300
@@ -2858,14 +2858,6 @@
 }
 
 /**
-  Regenerate water.
-**/
-void key_editor_regenerate_water(void)
-{
-  send_packet_edit_regenerate_water(client.conn);
-}
-
-/**
   Send a request to the server to toggle fog-of-war for the current
   player (only applies in edit mode).
 **/
diff -Nurd -X.diff_ignore freeciv/client/control.h freeciv/client/control.h
--- freeciv/client/control.h2008-06-24 01:37:58.0 +0300
+++ freeciv/client/control.h2008-06-30 21:02:04.0 +0300
@@ -194,7 +194,6 @@
 
 void key_editor_toggle(void);
 void key_editor_recalculate_borders(void);
-void key_editor_regenerate_water(void);
 void key_editor_toggle_fogofwar(void);
 
 /* don't change this unless you also put more entries in data/Freeciv */
diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/menu.c 
freeciv/client/gui-gtk-2.0/menu.c
--- freeciv/client/gui-gtk-2.0/menu.c   2008-06-24 01:37:56.0 +0300
+++ freeciv/client/gui-gtk-2.0/menu.c   2008-06-30 21:03:08.0 +0300
@@ -169,7 +169,6 @@
  
   MENU_EDITOR_TOGGLE,
   MENU_EDITOR_RECALCULATE_BORDERS,
-  MENU_EDITOR_REGENERATE_WATER,
   MENU_EDITOR_TOGGLE_FOGOFWAR,
 
   MENU_HELP_LANGUAGES,
@@ -632,9 +631,6 @@
   case MENU_EDITOR_RECALCULATE_BORDERS:
 key_editor_recalculate_borders();
 break;
-  case MENU_EDITOR_REGENERATE_WATER:
-key_editor_regenerate_water();
-break;
   case MENU_EDITOR_TOGGLE_FOGOFWAR:
 key_editor_toggle_fogofwar();
 break;
@@ -806,8 +802,6 @@
editor_menu_callback, MENU_EDITOR_TOGGLE, CheckItem },
   { / N_(_Edit) / N_(Recalculate _Borders), NULL,
editor_menu_callback, MENU_EDITOR_RECALCULATE_BORDERS },
-  { / N_(_Edit) / N_(Regenerate _Water), NULL,
-   editor_menu_callback, MENU_EDITOR_REGENERATE_WATER },
   { / N_(_Edit) / N_(Toggle Fog-of-war), controlf,
editor_menu_callback, MENU_EDITOR_TOGGLE_FOGOFWAR },
 
diff -Nurd -X.diff_ignore freeciv/common/packets.def freeciv/common/packets.def
--- freeciv/common/packets.def  2008-06-30 12:02:12.0 +0300
+++ freeciv/common/packets.def  2008-06-30 20:41:22.0 +0300
@@ -1427,9 +1427,6 @@
   BOOL state;
 end
 
-PACKET_EDIT_REGENERATE_WATER=151;cs,handle-per-conn
-end
-
 PACKET_EDIT_RECALCULATE_BORDERS=152;cs,handle-per-conn
 end
 
diff -Nurd -X.diff_ignore freeciv/common/terrain.h freeciv/common/terrain.h
--- freeciv/common/terrain.h2008-06-28 20:49:38.0 +0300
+++ freeciv/common/terrain.h2008-06-30 21:16:26.0 +0300
@@ -152,13 +152,7 @@
 
   char identifier; /* Single-character identifier used in savegames. */
 
-#define TERRAIN_SEA_IDENTIFIER '-'
-#define TERRAIN_OCEAN_IDENTIFIER ' '
-#define TERRAIN_SHELF_IDENTIFIER ','
-#define TERRAIN_FLOOR_IDENTIFIER ':'
-#define TERRAIN_RIDGE_IDENTIFIER '^'
-#define TERRAIN_GLACIER_IDENTIFIER 'a'
-#define TERRAIN_UNKNOWN_IDENTIFIER 'u'
+#define TERRAIN_UNKNOWN_IDENTIFIER '?'
 
   int movement_cost;
   int defense_bonus; /* % defense bonus - defaults to zero */
diff -Nurd -X.diff_ignore freeciv/data/civ1/terrain.ruleset 
freeciv/data/civ1/terrain.ruleset
--- freeciv/data/civ1/terrain.ruleset   2008-06-30 12:02:12.0 +0300
+++ freeciv/data/civ1/terrain.ruleset   2008-06-30 21:13:09.0 +0300
@@ -172,41 +172,6 @@
 ; helptext = optional help text string; should escape all raw 
 ;newlines so that xgettext parsing works
 
-[terrain_salt_water_coast]
-name = _(Sea)
-graphic  = coast
-graphic_alt  = -
-identifier   = -
-movement_cost= 1
-defense_bonus= 0
-food = 1
-shield   = 0
-trade= 2
-resources= resource_fish
-road_trade_incr  = 0
-road_time= 0
-irrigation_result= no
-irrigation_food_incr = 0
-irrigation_time  = 0
-mining_result= no
-mining_shield_incr   = 0
-mining_time  = 0
-transform_result = no
-transform_time   = 

Re: [Freeciv-Dev] (PR#40165) Re: Expanded terrain set, request for info

2008-06-30 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40165 

Marko Lindqvist wrote:
 URL: http://bugs.freeciv.org/Ticket/Display.html?id=40165 
 
 2008/3/24 Marko Lindqvist:
  TERRAIN_XXX_IDENTIFIER definitions have to go, and terrains must be
 selected by properly checking their flags, ocean_depth -value, or what
 ever is appropriate for each case.
 
  Attached patch removes code that creates these special ocean types.
 If such special features are needed in the future, they should be
 reimplemented in a proper, generic, fashion.
  civ1  civ2 rulesets have only one ocean type, default ruleset three
 types; Lake, Ocean and Deep Ocean.

Great.

I don't understand though what the identifiers are supposed to do?  I 
understand and am happy that they're being removed but what could 
possibly have prompted the re-addition of hardcoded terrain identifiers 
in the first place?

-jason



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


[Freeciv-Dev] (PR#40165) Re: Expanded terrain set, request for info

2008-03-23 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40165 

On 16/03/2008, Marko Lindqvist  wrote:

   If there has been no other changes, custom ruleset defined terrains
  should still work.

 I tried to make ruleset with just two ocean types, as the plan for
the new trireme rules was (I wonder how new trireme move restrictions
work with current default ruleset...) I found out that there has been
unacceptable changes to codebase. Work of several years to make
terrain handling more flexible has been wasted by adding new set of
hardcoded identifiers to terrain.h.

 TERRAIN_XXX_IDENTIFIER definitions have to go, and terrains must be
selected by properly checking their flags, ocean_depth -value, or what
ever is appropriate for each case.


 - ML



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