Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: get_canvas_xy unification (PR#1054)
Home

[Freeciv-Dev] Re: get_canvas_xy unification (PR#1054)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: get_canvas_xy unification (PR#1054)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Nov 2001 20:38:06 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Nov 12, 2001 at 10:46:51AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> Raimar Falke wrote:
> > 
> > On Sun, Nov 11, 2001 at 08:21:04PM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx 
> > wrote:
> > > Raimar Falke wrote:
> > > >
> > > > On Wed, Nov 07, 2001 at 12:07:45PM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx 
> > > > wrote:
> > > > > Andreas Kemnade wrote:
> > > > > >
> > > >
> > > > > +/**************************************************************************
> > > > > +Finds the pixel coordinates of a tile.  Beside setting the results in
> > > > > +canvas_x,canvas_y it returns whether the tile is inside the visible 
> > > > > map.
> > > > > +**************************************************************************/
> > > > > +int base_get_canvas_xy(int map_x, int map_y,
> > > > > +                    int *canvas_x, int *canvas_y,
> > > >
> > > > > +                    int map_view_x0, int map_view_y0,
> > > > > +                    int map_win_width, int map_win_height)
> > > >
> > > > It looks like map_view_* is a map position and map_win_* are
> > > > pixel. Correct? Can this be clarified in the variable names?
> > >
> > > Yes, but how?  I really haven't been able to think of a good naming
> > > system.
> > 
> > map_view_topleft_map_pos_[xy]
> > map_view_pixel_{width,height}
> 
> A bit lengthy, but it could work.  We also want
> map_view_tile_{width,height}, which can be easily determined from
> map_view_pixel_{...}, but sometimes we don't want to go to the trouble. 
> Most GUI's track both values anyway.
> 
> > Maybe we can also pass "map_win_width/NORMAL_TILE_WIDTH" instead of
> > "map_win_width".
> 
> isometric-view get_canvas_xy (map_pos_to_canvas_pos) needs to know more
> than this to determine if the tile is on-screen, since tiles are spaced
> only NORMAL_TILE_WIDTH/2 apart.

Ok.

> > I thought the non-base_ version is for the gui-*/* files.
> 
> Yeah, but they're consistently named get_canvas_xy and get_map_xy.  I
> thought we could leave those names intact and just give the "correct"
> naming to the backend GUI function.

Ok.

> > No. Please make two patches. Or create the second if the first is in
> > the CVS.
> 
> OK.  The first patch will remain relatively unchanged, then (except for
> the names, as above).  A new patch will follow.

Ok.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  (On the statement print "42 monkeys"+"1 snake"): BTW, both perl and Python
  get this wrong. Perl gives 43 and Python gives "42 monkeys1 snake", when 
  the answer is clearly "41 monkeys and 1 fat snake".  
    -- Jim Fulton, 10 Aug 1999


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