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: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Map coordinate cleanups.
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: Fri, 17 Aug 2001 02:34:08 +0200

On Thu, 16 Aug 2001, jshort@xxxxxxxxxxxxx wrote:
> 
> Are you saying there is a reason other than speed to make them
> macros?

Yes.  For one thing, this makes it feasible to put them in other
places where it would be silly to use a function.  A slightly cheesy
example would be the definition of IS_PROP_TILE(), which basically
IS_NORM_TILE && IS_REAL_TILE.  That would be a silly thing to write in
terms of functions.  A somewhat more relevant example might be the
adjc_dir_iterate() macro you wrote.  I added an assert() which
amounted to IS_PROP_TILE() to it before committing it.  This actually
had a measurable impact on performance, and having a function call
would probably make it even slower.  Doing it this way means that we
can use the macro there with no worries.

> Well, never mind.  You're right that the work necessary to convert
> them back is minimal.  There is a _lot_ of work ahead before an
> isometric map would be possible (although I'm not too worried about
> is_real_tile; it's only one line).  The biggest problem is replacing
> all map_adjust_[xy] macro uses with normalize_map_pos (or whatever
> macro you come up with to replace it).

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
What's the MATTER Sid?..  Is your BEVERAGE unsatisfactory?


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