[Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
freeciv-dev@xxxxxxxxxxx (Freeciv developers) |
Subject: |
[Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem |
From: |
Reinier Post <rp@xxxxxxxxxx> |
Date: |
Sun, 26 Aug 2001 13:24:44 +0200 |
On Sat, Aug 25, 2001 at 08:48:04AM +0200, Raimar Falke wrote:
> > It would also be possible to iterate over the whole canvas to look for
> > coordinates that match the given ones. The update could be performed
> > for each of those coordinates. This would be substantially faster:
> >
> > for (x=x0; x<x0+width; x++)
> > for (y=y0; y<y0+width; y++)
> > int mapx=x, mapy=y;
> > if (normalize_map_pos(&mapx, &mapy)
> > && mapx==update_x && mapy==update_y)
> > do_update_function(x, y);
>
> I also thought about the problem and also found this solution. There
> may be performance issues however.
I don't understand, you can iterate by the wrapping size:
normalize_map_pos(&x0, &y0);
for (x=x0; x<x0+canvas_width; x+=map_width) {
for (y=y0; y<y0+canvas_height; y+=map_height) {
do_update_function(x, y);
}
}
--
Reinier
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, (continued)
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Jason Dorje Short, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Reinier Post, 2001/08/25
- [Freeciv-Dev] more topology (was: Re: [PATCH] bugfix for wrapping problem), Mike Kaufman, 2001/08/26
- Message not available
- [Freeciv-Dev] Re: more topology (was: Re: [PATCH] bugfix for wrapping problem), Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: more topology (was: Re: [PATCH] bugfix for wrapping problem), Reinier Post, 2001/08/26
- [Freeciv-Dev] new civworld patch, Mike Kaufman, 2001/08/27
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Ross W. Wetmore, 2001/08/25
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Trent Piepho, 2001/08/25
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Reinier Post, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Raimar Falke, 2001/08/25
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem,
Reinier Post <=
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Raimar Falke, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Reinier Post, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Jason Dorje Short, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Vasco Alexandre Da Silva Costa, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Raimar Falke, 2001/08/24
- [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem, Reinier Post, 2001/08/24
|
|