tron@10032: /* $Id$ */ tron@10032: tron@10032: #ifndef DIRECTION_H tron@10032: #define DIRECTION_H tron@10032: tron@10032: tron@10032: /* the 2 axis */ tron@10032: typedef enum Axis { tron@10032: AXIS_X = 0, tron@10032: AXIS_Y = 1, tron@10032: AXIS_END tron@10032: } Axis; tron@10032: tron@10032: tron@10032: static inline Axis DiagDirToAxis(uint d) tron@10032: { tron@10032: return (Axis)(d & 1); tron@10032: } tron@10032: tron@10032: tron@10032: /* tron@10032: * Converts an Axis to a DiagDirection tron@10032: * Points always in the positive direction, i.e. S[EW] tron@10032: */ tron@10032: static inline uint AxisToDiagDir(Axis a) tron@10032: { tron@10032: return (uint)(2 - a); tron@10032: } tron@10032: tron@10032: #endif