| [Freeciv-Dev] Re: [Patch] MAPSTEP[Top] [All Lists][Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
 On Sat, Sep 22, 2001 at 01:13:05PM +0100, Gregory Berkolaiko wrote:
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > 
> > The patch removes all occurrences of DIR_DX by:
> >  - replacing loops with adjc_[dir_]iterate or
> >  - useing the new macro MAPSTEP or _MAPSTEP
> 
> This patch is very badly needed and long waited for.  I cannot detect any
> mistakes, but I did not read it thouroughly or/and carefully.
> 
> However I strongly object to your use of _MAPSTEP because:
> 1. It obscures the code.
> 2. It is unnecessary.
> 3. It's got bad name (MAPSTEP_FROM_0 would be better if you insist on
> using it).
I introduced it for the case you mentioned below. You may have a way
to express this without an extra macro besides MAPSTEP.
> > I'm sure I have made mistakes. Can you please go over the patch? I
> 
> how about test runs and comparisons between old/new savegames ?
This is the next step.
> you patch shouldn't change any behaviour, right?
No.
> > @@ -2083,8 +2067,9 @@
> >    get_canvas_xy(x, y, &canvas_src_x, &canvas_src_y);
> >    canvas_src_x += NORMAL_TILE_WIDTH/2;
> >    canvas_src_y += NORMAL_TILE_HEIGHT/2;
> > -  canvas_dest_x = canvas_src_x + (NORMAL_TILE_WIDTH * DIR_DX[dir])/2;
> > -  canvas_dest_y = canvas_src_y + (NORMAL_TILE_WIDTH * DIR_DY[dir])/2;
> > +  _MAPSTEP(canvas_dest_x, canvas_dest_y, dir);
> > +  canvas_dest_x = canvas_src_x + (NORMAL_TILE_WIDTH * canvas_dest_x) /
> > 2;
        Raimar
-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Microsoft DNS service terminates abnormally when it recieves a response
  to a DNS query that was never made.
  Fix Information: Run your DNS service on a different platform."
    -- MS service information on bugtraq
 
[Freeciv-Dev] [Patch] MAPSTEP, Raimar Falke, 2001/09/21
[Freeciv-Dev] Re: [Patch] MAPSTEP, Gregory Berkolaiko, 2001/09/23
[Freeciv-Dev] Re: [Patch] MAPSTEP, Raimar Falke, 2001/09/23
[Freeciv-Dev] Re: [Patch] MAPSTEP, Gregory Berkolaiko, 2001/09/23
[Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/24
 
 |  |