Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#2749) mapgen patch 2 of 3 - land placement
Home

[Freeciv-Dev] (PR#2749) mapgen patch 2 of 3 - land placement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kayeats@xxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#2749) mapgen patch 2 of 3 - land placement
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Thu, 28 Aug 2003 15:21:26 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[kayeats - Mon Mar 24 15:46:16 2003]:

> Hi, this is just a slight modification on the previous patch fixing one
> little thing.

Unfortunately, there are more things to fix.

1. You call calloc many times.  I don't see any calls to free.  A grave
error indeed.  In this case it is better to free memory in the same
function that allocates it, for transparency.  Although you can do it in
place_ter_type.

2. Sometimes you do not use {} after "if".

3. I think "make ocean" bit should be separated into a function, for
uniformity :)

4. The header comment to place_ter_type is not clear to me at all.

5 (suggestions) When you do spillover in forest_fn and such, you can
make a const 5x5 array and then just do one square_iterate and
  fmap(x1, y1) += val * spill[dx][dy] / 256;
rather than
(i) assigning the centre separately (ii) assigning the adjacent
separately etc.  Such array can make E-W bias for desert growth easier
to implement if wanted.  Also, if we want such bias, we want a sharper
distribution (so that we get real high values which spill out
significantly).  Maybe squaring the result of myrand can work here.

Best wishes,
G.



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2749) mapgen patch 2 of 3 - land placement, Gregory Berkolaiko <=