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]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3936) introducing native coordinates
From: Jason Dorje Short <vze49r5w@xxxxxxxxxxx>
Date: Thu, 24 Apr 2003 19:34:49 -0500
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

Raimar Falke wrote:
On Thu, Apr 24, 2003 at 08:58:16AM -0500, Jason Dorje Short wrote:

- how can mapview code done in an easier way (IMHO with an
intermediate form)

Again you are lumping a whole collection of unrelated operations into one term.

This is a bit terse.

I'm trying to split unnormalize_map_pos into two operations. First the
wrapping and than the rotating and scaling to pixels. What is your
opinion?

unnormalize_map_pos is only a small part of the mapview code - just a single part of one function (map_to_canvas_pos). It does the wrapping part only; the rotating and scaling to pixels is done separately by map_to_canvas_pos. So this split is already in place...


If it only does the wrapping it is complex. I have to look further
into this.

If you're willing to sacrifice correctness you can write something simpler by determining the map_distance_vector from the center tile of the mapview_canvas. However it will end up putting some tiles off-canvas when they could rightfully be wrapped directly onto the canvas.

Something truly simple could be written with basic wrapping, ignoring the iso nature of the mapview. This is what the current code does, but it has a signficant bug: even if you make the canvas infinitely large some tiles will never be shown.

For full correctness, unnormalize_map_pos should take a width and height parameter. This also potentially allows multiple drawing of tiles. However, this makes it even more complicated and only helps in a few pathological cases.

jason



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