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: Sun, 11 Nov 2001 19:54:52 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

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?

> +/**************************************************************************
> +Finds the map coordinates corresponding to pixel coordinates.
> +**************************************************************************/
> +void base_get_map_xy(int canvas_x, int canvas_y,
> +                  int *map_x, int *map_y,
> +                  int map_view_x0, int map_view_y0)

Since base_get_map_xy isn't a general name IMHO what about
base_canvas_pos_to_map_pos and base_map_pos_to_canvas_pos?

> +void base_center_tile_mapcanvas(int map_x, int map_y,
> +                             int *map_view_x0, int *map_view_y0,
> +                             int map_view_width, int map_view_height)
> +{
> +  if (is_isometric) {

> +    map_x -= map_view_width/2;
> +    map_y += map_view_width/2;
> +    map_x -= map_view_height/2;
> +    map_y -= map_view_height/2;

This looks weird.

        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


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