equal
deleted
inserted
replaced
280 /* If the length of the side is uneven, the center has to be checked |
280 /* If the length of the side is uneven, the center has to be checked |
281 * separately, as the pattern of uneven sides requires to go around the center */ |
281 * separately, as the pattern of uneven sides requires to go around the center */ |
282 n = 2; |
282 n = 2; |
283 if (proc(TileXY(x, y), data)) return true; |
283 if (proc(TileXY(x, y), data)) return true; |
284 |
284 |
285 /* If tile test is not successfull, get one tile down and left, |
285 /* If tile test is not successful, get one tile down and left, |
286 * ready for a test in first circle around center tile */ |
286 * ready for a test in first circle around center tile */ |
287 x += _tileoffs_by_dir[DIR_W].x; |
287 x += _tileoffs_by_dir[DIR_W].x; |
288 y += _tileoffs_by_dir[DIR_W].y; |
288 y += _tileoffs_by_dir[DIR_W].y; |
289 } else { |
289 } else { |
290 n = 1; |
290 n = 1; |
298 for (; n < size; n += 2) { |
298 for (; n < size; n += 2) { |
299 for (dir = DIAGDIR_NE; dir < DIAGDIR_END; dir++) { |
299 for (dir = DIAGDIR_NE; dir < DIAGDIR_END; dir++) { |
300 uint j; |
300 uint j; |
301 for (j = n; j != 0; j--) { |
301 for (j = n; j != 0; j--) { |
302 if (x <= MapMaxX() && y <= MapMaxY() && ///< Is the tile within the map? |
302 if (x <= MapMaxX() && y <= MapMaxY() && ///< Is the tile within the map? |
303 proc(TileXY(x, y), data)) { ///< Is the callback successfulll? |
303 proc(TileXY(x, y), data)) { ///< Is the callback successful? |
304 return true; ///< then stop the search |
304 return true; ///< then stop the search |
305 } |
305 } |
306 |
306 |
307 /* Step to the next 'neighbour' in the circular line */ |
307 /* Step to the next 'neighbour' in the circular line */ |
308 x += _tileoffs_by_diagdir[dir].x; |
308 x += _tileoffs_by_diagdir[dir].x; |