direction.h
author Darkvater
Mon, 31 Jul 2006 15:49:12 +0000
branch0.4
changeset 10070 308b88d1851f
parent 10032 fcf09abbde96
permissions -rw-r--r--
(svn r5678) - Prepare 0.4 branch for release. Update readme's, bugs, installers, changelog, etc. to 0.4.8-RC2
/* $Id$ */

#ifndef DIRECTION_H
#define DIRECTION_H


/* the 2 axis */
typedef enum Axis {
	AXIS_X = 0,
	AXIS_Y = 1,
	AXIS_END
} Axis;


static inline Axis DiagDirToAxis(uint d)
{
	return (Axis)(d & 1);
}


/*
 * Converts an Axis to a DiagDirection
 * Points always in the positive direction, i.e. S[EW]
 */
static inline uint AxisToDiagDir(Axis a)
{
	return (uint)(2 - a);
}

#endif