[Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jason Short wrote:
> rwetmore@xxxxxxxxxxxx wrote:
[...]
> But if you base your calculations off of the center tile this problem
> becomes moot. In fact it fixes another problem as well: in iso view
> with unnormalize_map_pos the top and left row of tiles will always be
> drawn halfway out of sight, no matter how large the mapview window
> becomes. By using the center tile as origin we guarantee that the set
> of positions we draw is always centered on the mapview.
Maybe, but it is as easy to fix the GUI code to use top-left as it is
center offsets - I take it back, it is easier to use top-left, as this
is standard array index looping with no negative offsets that screwup
DIV scaling and such.
Note, you have free choice in unnormalize_map_pos() to choose the origin.
If your GUI code doesn't get its EXTRA_BOTTOM_ROW alignments quite right
you can do compensating shifts to get the right normal window to match
your GUI offsets.
But whether you draw full or half tiles has nothing to do with the
unnormalize algorithm internal implementation :-).
If your EXTRA_BOTTOM_ROW borders add black tile border as part of the
window, the origin used to define where viewable tiles start might be
slightly inset, but not necessarily as far as the mapview origin. You
need to unnormalize according to how you want to lay things out. Note
that not using a strict mapview origin means that you will either be
drawing some iso-tiles twice (to make them full on each side), or won't
see them at the opposite side of the map. It might be aesthetically
pleasing to draw some tiles half on each side, but that needs special
handling in the GUI code.
Your claim about things never being drawn right is a GUI code problem
not unnormalize though. It should be fixed in the GUI code. Hopefully
you have some ideas from this though.
> jason
Cheers,
RossW
=====
|
|