Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#8507) generalized tile boundaries
Home

[Freeciv-Dev] Re: (PR#8507) generalized tile boundaries

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8507) generalized tile boundaries
From: "Jason Short" <jshort@xxxxxxxxxxxxxx>
Date: Wed, 14 Apr 2004 23:30:28 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8507 >


> Hmmm, why not simply returns a list of the vertexes of the bounding
> convex polygon on a tile, for all directions?

This would work as an internal implementation for the function, and in
time I think that's what should be done.  (I hard-coded the different
directions for two reasons: that's the way they're done now, so it seemed
easier to transpose the logic this way; and the directional ordering
[including DIR_CW and DIR_CCW] is sufficiently ugly that the array of
corners wouldn't be very elegant.)

However to have the function return this list directly means a fair amount
of extra work the caller has to do.  Consider:

- The caller has to check whether the X and Y points are equal to see if
the side exists.

- When width comes into play the ending point for one boundary isn't the
same as the starting point for the next.  Consider, in iso-view, the W and
S national border lines (edges) drawn to the SW corner (vertex) at (x,y). 
The W line must be drawn smack up against the W boundary, but since the
width of the line is 2 (lines extend upward from their origin) it is drawn
from (x,y+1).  Meanwhile the S line is drawn to within 1 pixel of the S
boundary, and since we don't have to account for width in this case it is
drawn to (x, y-1).  This makes little sense unless you examine it closely,
which is one reason why it should be concealed behind the function
interface.  Another is just that it would be fairly difficult for the
caller to make this adjustment; it's easier to do it at the time the
boundary vertices are generated.

jason




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