[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]
rwetmore@xxxxxxxxxxxx wrote:
> It is the wrapping that is tricky. The obvious logic is something like:
> if (map_x < map_view_x0) {
> map_x += map.xsize;
> }
>
> Your "obvious logic" makes assumptions about the map coordinate being within
> a particular range, which actually has led to a number of bugs in the past.
> The WRAP or while loop constructs in (un)normalize_map_pos() fix this. The
> latter are actually so incredibly efficient for your special case that there
> is never a reason to use the buggy "obvious logic" form.
You may have noted that the "obvious logic" was immediately debunked as
not working for gen-topologies. However it does fix several bugs in the
current code (since the current logic is even worse) and is therefore
worth a quick fix IMO.
jason
- [Freeciv-Dev] (PR#4648) how to do wrapping in map_to_canvas_pos?, Jason Short, 2003/07/22
- Message not available
- [Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?, rwetmore@xxxxxxxxxxxx, 2003/07/26
- Message not available
- [Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?, Jason Short, 2003/07/27
- Message not available
- [Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?, rwetmore@xxxxxxxxxxxx, 2003/07/28
- Message not available
- [Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?, Jason Short, 2003/07/28
- Message not available
- [Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?, rwetmore@xxxxxxxxxxxx, 2003/07/28
- Message not available
- [Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?, Jason Short, 2003/07/28
- Message not available
- [Freeciv-Dev] Re: (PR#4648) how to do wrapping in map_to_canvas_pos?,
Jason Short <=
|
|