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: Thu, 6 May 2004 13:19:29 -0700
Reply-to: rt@xxxxxxxxxxx

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

Marcelo Burda wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8627 >
> 
> Le jeu 06/05/2004 à 18:56, Jason Short a écrit :
> 
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=8627 >
>>
>>I'm still not convinced that this is the way to do it (although I agree
>>the current method is bad; this may be a good temporary way to improve it).
>>
>>However there are still some problems:
>>
>>- Your patch is out of date.
>>- What is the purpose of the packhand.c changes?  I don't think those
>>should be in there.
> 
> i move this in best place! bad placed original code too

Yes, I see.  Can you make a simple patch that _just_ moves this code 
into set_overview_dimensions?

>>- There are problems with iso-maps that don't have TF_WRAPX (topos 4 and
>>6).  The problems come because the left and right side of the map are
>>actually zig-zags on the overview.  However obviously the overview can't
>>draw it like that.  The result is that the left side is drawn zig-zag
>>with some colors uninitialized.  The right side is OVERVIEW_TILE_WIDTH /
>>2 pixels too small (the overview width isn't enough, it should be
>>map.xsize * OVERVIEW_TILE_WIDTH + OVERVIEW_TILE_WIDTH / 2) and so the
>>zig-zag is clipped off.
> 
> this was related ot the hard wraps code, (this code update a half tile
> left side)

>>+      if ((base_x == map.xsize - 1) && topo_has_flag(TF_WRAPX)) {
>>+       /* ups we need update half tile at 0 */
>>+     canvas_put_rectangle(overview.store,
>>+                          overview_tile_color(map_x, map_y), 0, base_y,
>>+                          OVERVIEW_TILE_WIDTH / 2, OVERVIEW_TILE_HEIGHT); 
>>+      }

This isn't the right way to do it.

First, the left side of the overview shouldn't show tiles from the right 
side when the map doesn't wrap in that direction.  So at a minimum this 
tile should be drawn black instead of the overview_tile_color.

Second, I believe we'll have the same problem on the right side of the 
overview.  And here you can't fix it the same way because there is no 
map tile corresponding to that area of the overview.

I think the correct solution is just to draw the whole overview canvas 
black before redrawing it.  Then those tiles will show up black by 
default unless it gets drawn over.


Also (unrelated) you need to consider what happens when 
OVERVIEW_TILE_WIDTH is an odd number.  The math will mostly just work 
out but in some places I think you need to use (OVERVIEW_TILE_WIDTH + 1) 
/ 2.

jason




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