Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: the directional system
Home

[Freeciv-Dev] Re: the directional system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: the directional system
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Fri, 7 Sep 2001 04:51:36 -0700 (PDT)

On Fri, 7 Sep 2001, Jason Dorje Short wrote:

+#define DIR_REVERSE(dir) (((dir) + 4) % 8)

This is a faster way to do it.  Modulus operations are very expensive, but a
bitwise and is very cheap.

+#define DIR_REVERSE(dir) (((dir) + 4) & 7)



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