[Freeciv-Dev] Re: (PR#6285) rand_map_pos using native coordinates
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
rwetmore@xxxxxxxxxxxx wrote:
> Try ...
>
> do {
> *x = myrand(map.xsize);
> *y = myrand(map.ysize);
> native_to_map_pos(x, y, *x, *y);
> } while (!normalize_map_pos(x, y));
>
> This is actually a better solution, since it is possible under gen-topologies
> to have unreal positions arise from filter constraints, rather than geometric
> boundaries. The classic example is an elliptical map which fits inside the
> native rectangle.
This will slow down the code, for no short-term benefit (since nobody
has yet provided any code to support filter constraints).
But we can go ahead and change it now anyway, if you'll make a patch.
jason
|
|