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: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8627) best overview for iso-maps
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 May 2004 07:30:19 -0700
Reply-to: rt@xxxxxxxxxxx

<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.

jason




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