* Increment the direction by 45 degrees. * @param dir Direction to rotate. * @return Rotated direction. */
| 111 | * @return Rotated direction. |
| 112 | */ |
| 113 | static inline Direction2 rotate45(Direction2 dir, int count = 1) |
| 114 | { |
| 115 | return (Direction2)(((dir - DIR2_NORTH + count) & 7) + DIR2_NORTH); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Rotate the direction by 90 degrees. |