[Freeciv-Dev] Re: topology RFC (again)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
At 10:35 AM 01/10/29 +0100, Raimar Falke wrote:
>On Sun, Oct 28, 2001 at 03:10:58PM -0400, Ross W. Wetmore wrote:
>> [...]
>> >*** 1c. Current Operator Functions
>> >
>> >The following functions are necessary to do operations and checks on map
>> >positions. All should work under the arbitrary topology discussed
>> >above.
>>
>> It is worth stressing that these are functions that apply to "map"
positions
>> or gaming coordinates.
>>
>> It is in general meaningless to feed them arbitrary coordinates, GUI or
>> citymap coordinates for instance.
>
>> There may be corresponding functions which do take GUI or citymap
>> coordinates
>
>There will no special citymap functions. All citymap can and should be
>transformed to map positions.
Raimar, citymap coordinates run from [0:CITY_MAP_SIZE-1][0:CITY_MAP_SIZE-1]
and lots of code uses these.
What do you think the citymap macros in city.h are doing? Are they
to all go? or get converted to use map coordiantes?
It does not make a lot of sense to convert all this code to use map_pos
coordinates so the citymap would maybe be [5:9][34:39]. It is very
difficult to check the diagonal2 tile spots when you are looking for
[5][34], [5][39], [9][34] and [9][39] or some other set rather than
[0][0], [4][0], [0][4] and [4][4] in every case.
Citymap coordinates are "flat-earth"-like i.e. clipped to their 5x5
normal set, with anything beyond being unreal, so you don't access
a citymap object at locations [0][23] or you will fault.
There are already map_to_citymap and citymap_to_map transformations
as one set of functions in the general model. These are actually
combinations of a pure transformation and a normalize_citymap_pos
since the final return value does an is_valid_city_coords() which
is really the is_real_tile() equivalent, and normalizing is just
clipping, or no actual change to the numerical value as in flat-earth.
Lots of code is so optimized, but the concepts are all there.
If you ever decide that citymaps should be elliptical, you will
probably wish you had more of the infrastructure and less
optimization :-).
This is not a point to lapse into deity mode. King Canute had such
delusions and look at what it brought him :-).
[...]
> Raimar
>
>--
> email: rf13@xxxxxxxxxxxxxxxxx
> "Transported to a surreal landscape, a young girl kills the first woman
> she meets and then teams up with three complete strangers to kill again."
> -- TV listing for the Wizard of Oz in the Marin Independent Journal
Cheers,
RossW
=====
- [Freeciv-Dev] Re: topology RFC (again), (continued)
- [Freeciv-Dev] Re: topology RFC (again), Ross W. Wetmore, 2001/10/28
- [Freeciv-Dev] Re: topology RFC (again), Jason Dorje Short, 2001/10/28
- [Freeciv-Dev] Re: topology RFC (again), Ross W. Wetmore, 2001/10/29
- [Freeciv-Dev] Re: topology RFC (again), Jason Dorje Short, 2001/10/29
- [Freeciv-Dev] Re: topology RFC (again), Ross W. Wetmore, 2001/10/30
- [Freeciv-Dev] Re: topology RFC (again), Jason Dorje Short, 2001/10/30
- [Freeciv-Dev] Re: topology RFC (again), Ross W. Wetmore, 2001/10/30
- [Freeciv-Dev] Re: topology RFC (again), Jason Dorje Short, 2001/10/31
[Freeciv-Dev] Re: topology RFC (again), Jason Dorje Short, 2001/10/28
[Freeciv-Dev] Re: topology RFC (again), Raimar Falke, 2001/10/29
|
|