Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3936) introducing native coordinates
Home

[Freeciv-Dev] Re: (PR#3936) introducing native coordinates

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3936) introducing native coordinates
From: Jason Dorje Short <vze49r5w@xxxxxxxxxxx>
Date: Mon, 14 Apr 2003 12:20:47 -0500
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

Raimar Falke wrote:
On Mon, Apr 14, 2003 at 11:02:28AM -0500, Jason Dorje Short wrote:
Raimar Falke wrote:
On Sun, Apr 13, 2003 at 05:37:59PM -0500, Jason Dorje Short wrote:

I'm not sure. Certainly there are some additional (non-mapview-specific) ones in mapview.


Conversely, if we use map coordinates as standard there are just a few places that need to convert to native coordinates. These include a few map.c backend functions (normalize_map_pos, map_distance_vector, rand_map_pos, map_to_index_pos, index_to_map_pos) as well as a very few pieces of user code (savegames, map debug output).


So we both say that our changes are minimal.

Yep. I'm not against the idea of using native coordinates as standard. I'm just not willing to track down all the places that need to be fixed for it, since I've already spent 2 years doing it the other way.

- mapview: is reduced to one file (mapview_common) AFAIK

Don't just lump in everything in mapview.c and mapview_common.c into "mapview" and write it off. mapview does have some very specialized needs (like clipping the window), but also some generalized ones as well (like rectangle_iterate).


You agree that all this should and can be done in mapview_common?!

I also said in the past that the mapview_common change won't be easy.

But again you're lumping all this stuff together. There is a discrete set of changes:

- clip_mapview_window - localized and ugly. Does not relate to the current discussion.

- mapview scrolling - non-localized and ugly. Does not relate to the current discussion.

- overview window: non-localized, but fairly low-impact.

- unnormalize_map_pos: localized and complicated. Does not relate to the current discussion.

- Other misc changes. These generally do relate to the current discussion. For instance under your system, all of the mapview iterations need to be done in map coordinates and need a manual conversion. This is not localized, and cannot be written off as "part of that mapview change" since it relates directly to this discussion.

Let me create some code so that we can have some facts. Hopefully this
week.

Is there an implementation of your approach which is complete? For
measure of speed and general impact this doesn't have to support
mapview.

Excellent. See the gen-topologies patch in freeciv-test. It is out-of-date for current CVS (by about 2 weeks, I think - I have an updated patch locally).

You do need to support mapview. Most of the mapview code can remain unchanged (note, clip_mapview_window and mapview scrolling do not work perfectly). What you will need to fix is the fact that mapview deals exclusively in map coordinates, so you'll need to convert to/from native coordinates all over the place.

But you can drop all of the existing map<->native conversion operations, so this will approximately balance out. This includes huge quantities of mapgen.c, some stuff in map.c, and some scattered other places.

Compared to mapgen and mapview, everything else is tiny. So as a measure of "general impact" these two are very significant.

jason



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