[Freeciv-Dev] Re: Map coordinate cleanups.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
There are two problems with this. The first is that the GUI allows one to
scroll more or less continuously in one direction. Internally I think it
resets the coordinates after a full map shift, but this means an order of
magnitude increase in the sizes of maps (3x3 ~ 10).
Secondly it doesn't remove the basic problem of dealing with faulty off map
accesses, even though it does reduce the probability. To be safe (paranoid)
code would still have to check that it didn't index outside of the 3x3 case.
The idea is valid, though, and could be implemented without too much
trouble. The cost of doing a doubly indexed array lookup for each
coordintate pair, might turn out to be comparable to the current test and
if needed normalize.
Cheers,
RossW
=====
At 09:32 AM 01/08/17 -0700, Arien Malec wrote:
[...]
>BTH, wouldn't a sensible way of implementing normalization be to generate at
>game initalization a suitably big array mapping coordinate positions to
>normalized coordinate positions? E.g., if the map is the maximum of 200x100,
>and sensible moves are < x/2 or y/2 (since if you go more than halfway around
>the map, you might as well go the other way), you would generate a 300X150
>array of ints, each cell of which would contain either the normalized
position,
>or NULL (if the position is irreal).
>
>That moves the tricky, expensive, and topology-dependent stuff to a one-off
>operation, and should make the implementation of is_real, is_normal, etc. and
>the iterate macros very very simple....
>
>Arien
- [Freeciv-Dev] Re: Map coordinate cleanups., (continued)
- [Freeciv-Dev] Re: Map coordinate cleanups., Marco Colombo, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Arien Malec, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups.,
Ross W. Wetmore <=
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Jason Dorje Short, 2001/08/18
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Tony Stuckey, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., David Pfitzner, 2001/08/17
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/18
- [Freeciv-Dev] Re: Map coordinate cleanups., Jason Dorje Short, 2001/08/18
|
|