equal
deleted
inserted
replaced
242 assert(IsValidDiagDirection(dir)); |
242 assert(IsValidDiagDirection(dir)); |
243 return _tileoffs_by_diagdir[dir]; |
243 return _tileoffs_by_diagdir[dir]; |
244 } |
244 } |
245 |
245 |
246 /** |
246 /** |
|
247 * Returns the TileIndexDiffC offset from a Direction. |
|
248 * |
|
249 * @param dir The given direction |
|
250 * @return The offset as TileIndexDiffC value |
|
251 */ |
|
252 static inline TileIndexDiffC TileIndexDiffCByDir(Direction dir) |
|
253 { |
|
254 extern const TileIndexDiffC _tileoffs_by_dir[DIR_END]; |
|
255 |
|
256 assert(IsValidDirection(dir)); |
|
257 return _tileoffs_by_dir[dir]; |
|
258 } |
|
259 |
|
260 /** |
247 * Add a TileIndexDiffC to a TileIndex and returns the new one. |
261 * Add a TileIndexDiffC to a TileIndex and returns the new one. |
248 * |
262 * |
249 * Returns tile + the diff given in diff. If the result tile would end up |
263 * Returns tile + the diff given in diff. If the result tile would end up |
250 * outside of the map, INVALID_TILE is returned instead. |
264 * outside of the map, INVALID_TILE is returned instead. |
251 * |
265 * |