Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem
Home

[Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Reinier Post <rp@xxxxxxxxxx>
Cc: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] bugfix for wrapping problem
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 26 Aug 2001 13:53:22 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Aug 26, 2001 at 01:24:44PM +0200, Reinier Post wrote:
> 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:

Not for a general topology.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "There are three ways to get something done. Do it yourself, hire someone
  to do it for you or forbid your kids to do it."


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