Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8627) best overview for iso-maps
Home

[Freeciv-Dev] Re: (PR#8627) best overview for iso-maps

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8627) best overview for iso-maps
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 7 May 2004 22:01:20 -0700
Reply-to: rt@xxxxxxxxxxx

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

1.  The patch needs to be updated for current cvs.

2.  There's still a problem with !TF_WRAPX maps.  The problem now is 
that if you click on one of the black zig-zag areas you are clicking on 
a nonexistant tile.  What happens afterward is unspecified.

If you click on the zig-zag on the left, because of integer rounding you 
end up as if you had clicked on the tile just to the right of where you 
clicked.

If you click on the zig-zag on the right, theoretically the assertion in 
overview_to_map_pos should trigger.  However I can't get it to trigger 
under the gtk2 client.  I believe this is another bug: clicking on the 
rightmost pixel of the overview in the gtk2 client simply ignores the 
click.  (However I did manage to get the assertion in the gtk client.)

Solving this is either ugly or takes some with.  Either:

- Use nearest_real_map_pos instead of normalize_map_pos in 
overview_to_map_pos.  This is ugly and bad.

- Have overview_to_map_pos return a boolean.  Callers must filter based 
on this return value.  This is probably the best thing to do but takes 
some work.

- Clip the left and right half-tile of the overview.  That is, instead 
of adding on an extra half-tile to the overview dimensions, and a for 
all positions with (y & 1) == 1, subtract off a half-tile from the 
overview dimensions, and for all positions with (y & 1) == 0.  This will 
look pretty but makes some positions hard to click on.

3.  The overview dimensions aren't set properly.  You set

   HEIGHT = MAX(120 / xsize, 1)
   WIDTH = 2 * HEIGHT

but the goal is that the width be as close to 120 as possible.  So with 
an xsize of 60 you should have HEIGHT==1, WIDTH==2 but instead you have 
HEIGHT==2, WIDTH==4.  Instead I think you should have

   HEIGHT = MAX(60 / xsize, 1)
   WIDTH = 2 * HEIGHT

Of course instead of using 60 or 120 here we should really use the 
actual panel dimensions to allow for a resizable overview.  But this 
will take some changes to the GUI code.  (Or maybe this is done already? 
  I forget.)

jason




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