Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9818) Inland lakes and borders
Home

[Freeciv-Dev] (PR#9818) Inland lakes and borders

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mstefek@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#9818) Inland lakes and borders
From: "Marcelo Burda" <mburda@xxxxxxxxx>
Date: Sat, 28 Aug 2004 04:42:13 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [mstefek - Sam. Aoû. 28 11:30:13 2004]:
> 
> I synchronized my patch with Marcelo's work
> 
> Besides claiming inland lakes it also:
> - counts oceans and continent sizes during assign_continent_numbers
> - provides functions:
>   - int get_continent_size(Continent_id id)
>   - int get_ocean_size(Continent_id id)
> 
> calculate_inland_lakes is renamed recalculate_lake_surrounders. It is
> much better name.
> --
> mateusz
> 
whole_map_iterate(x, y) {
+    Continent_id cont = map_get_continent(x, y);
+    if (cont > 0) {
+      /* land */
you assume land has continent name positive, this shuld ne avoide  must
use is_ocean(get_terrains(x,y))
+      adjc_iterate(x, y, x2, y2) {
+        Continent_id cont2 = map_get_continent(x2, y2);
+       if (cont2 < 0) {
+         if (lake_surrounders[-cont2] == 0) {
+           lake_surrounders[-cont2] = cont;
+         } else if (lake_surrounders[-cont2] != cont) {
+           lake_surrounders[-cont2] = -1;
+         }
+       }
+      } adjc_iterate_end;
+    }
+  } whole_map_iterate_end;

Marcelo.


[Prev in Thread] Current Thread [Next in Thread]