[Freeciv-Dev] Re: [Patch] MAPSTEP
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, Sep 24, 2001 at 03:07:39PM +0100, Gregory Berkolaiko wrote:
> --- "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx> wrote:
>
> > Actually, a "get the (x,y) delta for direction dir" is not a bad
> > change. It forces you to hand in all the coordinates (in 2-D) and
> > returns a full 2-D result which is needed for isometric and a few
> > other cases.
>
> I must loudly disagree with you here. (x,y) delta still has x-component
> and y-component and is still additive as long as the surface you are
> playing on is locally R^2 (planar). And DIRSTEP explecitly returns these
> separate components and then they are explicitly used in GUI code. So I
> think you are fooling yourself here.
The step of changing DIR_D[XY] to DIRSTEP and MAPSTEP was only the
first step. Yes DIRSTEP is not general enough for all circumstances.
int canvas_src_x, canvas_src_y, canvas_dest_x, canvas_dest_y;
get_canvas_xy(x, y, &canvas_src_x, &canvas_src_y);
DIRSTEP(canvas_dest_x, canvas_dest_y, dir);
canvas_dest_x = canvas_src_x + (NORMAL_TILE_WIDTH * canvas_dest_x) / 2;
canvas_dest_y = canvas_src_y + (NORMAL_TILE_WIDTH * canvas_dest_y) / 2;
can be replaced by
int canvas_src_x, canvas_src_y, canvas_dest_x, canvas_dest_y;
int dest_x,dest_y;
get_canvas_xy(x, y, &canvas_src_x, &canvas_src_y);
MAPSTEP(dest_x,dest_y,x,y,dir);
get_canvas_xy(dest_x, dest_y, &canvas_dest_x, &canvas_dest_y);
... some extra fiddling with canvas_dest_x and canvas_dest_y
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Transported to a surreal landscape, a young girl kills the first woman
she meets and then teams up with three complete strangers to kill again."
-- TV listing for the Wizard of Oz in the Marin Independent Journal
- [Freeciv-Dev] Re: [Patch] MAPSTEP, (continued)
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Gregory Berkolaiko, 2001/09/23
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Raimar Falke, 2001/09/23
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Gregory Berkolaiko, 2001/09/23
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Raimar Falke, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/25
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Gregory Berkolaiko, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP,
Raimar Falke <=
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/25
[Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/22
|
|