Mercurial > hg > openttd
diff src/direction.h @ 6248:0789677a15a0 draft
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 07 Mar 2007 12:11:48 +0000 |
parents | 46d001ebacf6 |
children | fc703c6dc92c |
line wrap: on
line diff
--- a/src/direction.h +++ b/src/direction.h @@ -8,7 +8,7 @@ #include "helpers.hpp" /* Direction as commonly used in v->direction, 8 way. */ -typedef enum Direction { +enum Direction { DIR_BEGIN = 0, DIR_N = 0, DIR_NE = 1, ///< Northeast, upper right on your monitor @@ -20,7 +20,7 @@ DIR_NW = 7, DIR_END, INVALID_DIR = 0xFF, -} Direction; +}; /** Define basic enum properties */ template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {}; @@ -32,14 +32,14 @@ } -typedef enum DirDiff { +enum DirDiff { DIRDIFF_SAME = 0, DIRDIFF_45RIGHT = 1, DIRDIFF_90RIGHT = 2, DIRDIFF_REVERSE = 4, DIRDIFF_90LEFT = 6, DIRDIFF_45LEFT = 7 -} DirDiff; +}; static inline DirDiff DirDifference(Direction d0, Direction d1) { @@ -59,7 +59,7 @@ /* Direction commonly used as the direction of entering and leaving tiles, 4-way */ -typedef enum DiagDirection { +enum DiagDirection { DIAGDIR_BEGIN = 0, DIAGDIR_NE = 0, ///< Northeast, upper right on your monitor DIAGDIR_SE = 1, @@ -67,7 +67,7 @@ DIAGDIR_NW = 3, DIAGDIR_END, INVALID_DIAGDIR = 0xFF, -} DiagDirection; +}; DECLARE_POSTFIX_INCREMENT(DiagDirection); @@ -81,12 +81,12 @@ } -typedef enum DiagDirDiff { +enum DiagDirDiff { DIAGDIRDIFF_SAME = 0, DIAGDIRDIFF_90RIGHT = 1, DIAGDIRDIFF_REVERSE = 2, DIAGDIRDIFF_90LEFT = 3 -} DiagDirDiff; +}; static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta) { @@ -107,11 +107,11 @@ /* the 2 axis */ -typedef enum Axis { +enum Axis { AXIS_X = 0, AXIS_Y = 1, AXIS_END -} Axis; +}; static inline Axis OtherAxis(Axis a)