diff options
author | frosch <frosch@openttd.org> | 2008-06-25 18:46:05 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-06-25 18:46:05 +0000 |
commit | 4e6d827ea6c958c8f45ec7d7c734f8823925136f (patch) | |
tree | 24031ec42e26783cfac0ed9981d326b8edbd421b /src/map.cpp | |
parent | 644fa403394f5426477c6c141aadc0d13aec754c (diff) | |
download | openttd-4e6d827ea6c958c8f45ec7d7c734f8823925136f.tar.xz |
(svn r13632) -Codechange: Use 'void *' for user-data of CircularTileSearch().
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp index 640864c0a..12f7a0266 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -261,12 +261,12 @@ uint DistanceFromEdge(TileIndex tile) * @param tile to start the search from. Upon completion, it will return the tile matching the search * @param size: number of tiles per side of the desired search area * @param proc: callback testing function pointer. - * @param data to be passed to the callback function. Depends on the implementation + * @param user_data to be passed to the callback function. Depends on the implementation * @return result of the search * @pre proc != NULL * @pre size > 0 */ -bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, uint32 data) +bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, void *user_data) { uint n, x, y; DiagDirection dir; @@ -281,7 +281,7 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, u /* If the length of the side is uneven, the center has to be checked * separately, as the pattern of uneven sides requires to go around the center */ n = 2; - if (proc(TileXY(x, y), data)) { + if (proc(TileXY(x, y), user_data)) { *tile = TileXY(x, y); return true; } @@ -304,7 +304,7 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, u uint j; for (j = n; j != 0; j--) { if (x <= MapMaxX() && y <= MapMaxY() && ///< Is the tile within the map? - proc(TileXY(x, y), data)) { ///< Is the callback successful? + proc(TileXY(x, y), user_data)) { ///< Is the callback successful? *tile = TileXY(x, y); return true; ///< then stop the search } |