Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8627) best overview for iso-maps
Home

[Freeciv-Dev] Re: (PR#8627) best overview for iso-maps

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8627) best overview for iso-maps
From: "Marcelo Burda" <mburda@xxxxxxxxx>
Date: Sun, 9 May 2004 07:53:17 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8627 >

Le dim 09/05/2004 à 16:30, Jason Short a écrit :
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8627 >
> 
> Marcelo Burda wrote:
> 
> >  void overview_to_map_pos(int *map_x, int *map_y,
> >                      int overview_x, int overview_y)
> >  {
> > -  int nat_x = overview_x / OVERVIEW_TILE_WIDTH + overview.map_x0;
> > -  int nat_y = overview_y / OVERVIEW_TILE_HEIGHT + overview.map_y0;
> > +    int ntl_x = overview_x / OVERVIEW_TILE_WIDTH,
> > +   ntl_y = overview_y / OVERVIEW_TILE_HEIGHT;
> >  
> > -  native_to_map_pos(map_x, map_y, nat_x, nat_y);
> > +  /* if there are no wraps in x axes, we need to correct
> > +     return value of the unused(black) space in iso view */
> > +  if(topo_has_flag(TF_ISO) && !topo_has_flag(TF_WRAPX)) {
> > +      int dx = (ntl_y & 1);
> > +    if ( ntl_x >= map.xsize * 2 - 2 + dx ) {
> > +      ntl_x -= 1;
> > +    } else  if (ntl_x < dx ) {
> > +      ntl_x += 1;
> > +    }
> > +  }
> 
> This code is too much of a hack.
> 
> If we use natural coordinates outright, we need to do it correctly. 
> Don't hard-code the natural system in the overview code.  Like I said 
> before, this will be hard.
> 
> I'm okay with using "modified native coordinates" here for now.  That's 
> just as much of a hack but it's much smaller.
> 
This is asolutly no clear to me! modified native coordinates are
naturals  ones! but realy ugly too see, when making a new overview we
can choice to work in natural or go back to native, until that there are
more clear if the code is in natural.(i symple fill the unused space of
natural coordinate to make efective tiles of 2*Width 
I was thinked a litle in these new overview, and personaly i think to
work in naturals! as sample think to pu 4x4 masked tiles(with your mask)
in natural coordinate calculated over 2x2,this work well if right
hacked! (probably you think to other technics)  
About "too much of a hack", this is contradictory. You like well done
code or not?
> jason
-- 
 . /  .     '    ,    .      (*)   '        `     '      `    .    
  |    ,  |   `     ,     .      ,   '  Marcelo Julián Burda      .
 /  '     \     `     \@_     '      .        '      `        '    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




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