Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Map coordinate cleanups.
Home

[Freeciv-Dev] Re: Map coordinate cleanups.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Map coordinate cleanups.
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Sat, 18 Aug 2001 01:03:17 +0100 (BST)

 --- Gaute B Strokkenes <gs234@xxxxxxxxx> wrote: 
> On Fri, 17 Aug 2001, gberkolaiko@xxxxxxxxxxx wrote:
> > Thanks for your friendly advice.
> 
> I'm sorry if you took that personally, but it wasn't meant that way.

no worries, I didn't take it personally :)
but I must note that sometimes the tempers are unnecessarily high in our
discussions which should be avoided (after all we are working for the
common goal).  And you, as I understand, is now one of the top people at
Freeciv, so you should be especially carefull not to turn people off.

> My original intent of MAP was to have a tile accessor function which
> would dump core if you gave it a non-real tile, without having to add

this is brave, but it should be done some time.

> I was slightly peeved since your criticism seemed to say that I didn't
> understand or care about map coordinate issues, which seemed a bit

not at all :)
I just thought that you are going half way, when you can just as well go
the whole way for the same price.  that is if you put
  x=adjust_x(x)
  if (IS_REAL(x,y)) {...}
you might as well write
  if (normalize_map_pos(&x,&y)) {...}
which will be more isometric-compatible.

> I stuck some "x = map_adjust_x(x)"-like statements in a number of the
> low-level map_get_fubar() functions because 1) the old code contained
> the equivalent and 2) we're not ready to remove them yet and 3) my
> first priority was to catch invalid y values, rather than unwrapped x
> values.

completely agree with 1) 
2) -- probably should not ever remove them
3) explains changes like
==================
-  assert(is_real_tile(x, y));
-  (map.tiles + map_adjust_x(x) + y * map.xsize)->continent=val;
+  x = map_adjust_x(x);
+  MAP(x, y)->continent = val;
==================
(actually now I do see the usefulness of MAP...)
but does not explain the use of 
==================
-  if (y<0 || y>=map.ysize)
+  x = map_adjust_x(x);
+  if (!IS_REAL_TILE(x, y))
==================
which does not catch anything.

But I guess my criticism is mostly nitpicking...  Sorry.

Best,
G.

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie


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