Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] Re: (PR#6285) rand_map_pos using native coordinates
Home

[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]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#6285) rand_map_pos using native coordinates
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Oct 2003 00:11:42 -0700
Reply-to: rt@xxxxxxxxxxxxxx

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




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