equal
deleted
inserted
replaced
91 |
91 |
92 |
92 |
93 /* the 2 axis */ |
93 /* the 2 axis */ |
94 typedef enum Axis { |
94 typedef enum Axis { |
95 AXIS_X = 0, |
95 AXIS_X = 0, |
96 AXIS_Y = 1 |
96 AXIS_Y = 1, |
|
97 AXIS_END |
97 } Axis; |
98 } Axis; |
98 |
99 |
99 |
100 |
100 static inline Axis DiagDirToAxis(DiagDirection d) |
101 static inline Axis DiagDirToAxis(DiagDirection d) |
101 { |
102 { |
110 static inline DiagDirection AxisToDiagDir(Axis a) |
111 static inline DiagDirection AxisToDiagDir(Axis a) |
111 { |
112 { |
112 return (DiagDirection)(2 - a); |
113 return (DiagDirection)(2 - a); |
113 } |
114 } |
114 |
115 |
|
116 static inline bool IsValidDiagDirection(DiagDirection d) |
|
117 { |
|
118 return d < DIAGDIR_END; |
|
119 } |
|
120 |
|
121 static inline bool IsValidDirection(DiagDirection d) |
|
122 { |
|
123 return d < DIR_END; |
|
124 } |
|
125 |
|
126 static inline bool IsValidAxis(DiagDirection d) |
|
127 { |
|
128 return d < AXIS_END; |
|
129 } |
|
130 |
115 #endif |
131 #endif |