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 14:11:10 -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 à 22:19, Jason Short a écrit :
> 
>><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 >
>>>>
> 
>>>>+      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); 
>>>>+      }
>>
> i no understand you or you not understand this code!
> i test it whit gtk-2, i find no problems.
> these code in the mail work if topo_has_flag(TF_WRAPX) and (base_x ==
> map.xsize - 1) to show the wraped half tile only if needed.

Ahh, yes you're right.

However the bug I'm talking about is different.  If 
!topo_has_flag(TF_WRAPX) then those tiles from above don't get drawn at all.

>>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.
> 
> the original code make black all!!
> that is i get in my screan !!!(probably best as gray but for me black is
> ok)

No.  You can see in refresh_overview_canvas it doesn't all get drawn 
black.  When we iterate over an unknown tile we draw that tile black, 
which is why it all starts out as black.  But unused portions of the 
overview (like the zig-zag areas in !TF_WRAPX maps) don't get drawn at all.

>>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.
> 
> this can't arrive in iso-map, i force it to be 2*OVERVIEW_TILE_HEIGHT,
> then never odd.

Doesn't seem like a good idea.  What if map.xsize==200?

jason




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