Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: PATCH: check_map_pos
Home

[Freeciv-Dev] Re: PATCH: check_map_pos

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: check_map_pos
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Oct 2001 21:15:20 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Oct 15, 2001 at 02:59:51PM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> > 
> > On Mon, Oct 15, 2001 at 04:29:10AM -0400, Jason Dorje Short wrote:
> > > The attached patch introduces a check_map_pos() function.
> > >
> > > It's done as an inline function within map.h, but this is unimportant at
> > > this point.  As said before, the advantage of a function is that it can
> > > be used within map_inx if desired; there's not really any advantage to a
> > > macro.
> > >
> > > It does not touch client code.  With all the different GUI's and the
> > > tendancy to pass around coordinates picked by the user, the client is
> > > not yet ready for this function.
> > >
> > > I have run several full (endyear=2000) autogames, and have not had any
> > > problems yet.
> > >
> > > Note that check_map_pos is not called on coordinates that are simply
> > > passed off to another function; for instance most of the code in map.c
> > > just calls MAP_TILE or map_inx with the coordinates so it's not
> > > necessary to call check_map_pos directly.
> > 
> > So since the code base is ready for the change we have to discuss
> > about the form. IMHO we should use macros to be able to completely
> > disable this checks. IMHO it isn't a good idea to mix these two things
> > (introduction of check_map_pos and inline).
> 
> Here is an updated check_map_pos patch.
> 
> Differences from the earlier patch: one use of check_map_pos removed
> (normalization was needed), fill_tile_sprite_array in tilespec.[ch]
> changed, square_iterate (from the other topology patch I submitted) is
> used in control.c, and punit->x=-1 is removed in control.c.  I have not
> yet done any changes to the check_map_pos function.
> 
> jason
> ? rc
> ? old
> ? topology
> ? mydiff
> ? check_map_pos
> ? client/mapview_common.c
> ? client/mapview_common.h
> Index: client/control.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
> retrieving revision 1.60
> diff -u -r1.60 control.c
> --- client/control.c  2001/09/15 15:31:19     1.60
> +++ client/control.c  2001/10/15 18:49:30
> @@ -1033,7 +1033,7 @@
>    was_teleported=!is_tiles_adjacent(punit->x, punit->y, pinfo->x, pinfo->y);
>    x=punit->x;
>    y=punit->y;

> -  punit->x=-1;  /* focus hack - if we're moving the unit in focus, it wont
> +  /* punit->x=-1; */  /* focus hack - if we're moving the unit in focus, it 
> wont
>                * be redrawn on top of the city */

No. Either remove it or leave it there.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  reality.sys corrupt. Reboot Universe? (y,n,q)


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