Move tile search functions to new header file

mapgen-water-desert-removal-circular
Jonathan G Rennison 5 months ago
parent 16b840d86e
commit 34d7482285

@ -497,6 +497,7 @@ add_files(
tilehighlight_func.h
tilehighlight_type.h
tilematrix_type.hpp
tilesearch_func.h
timetable.h
timetable_cmd.cpp
timetable_gui.cpp

@ -44,6 +44,7 @@
#include "cmd_helper.h"
#include "string_func.h"
#include "event_logs.h"
#include "tilesearch_func.h"
#include "table/strings.h"
#include "table/industry_land.h"

@ -33,6 +33,7 @@
#include "sl/saveload.h"
#include "framerate_type.h"
#include "town.h"
#include "tilesearch_func.h"
#include "3rdparty/cpp-btree/btree_set.h"
#include "scope_info.h"
#include "core/ring_buffer.hpp"

@ -9,6 +9,7 @@
#include "stdafx.h"
#include "debug.h"
#include "tilesearch_func.h"
#include "core/alloc_func.hpp"
#include "water_map.h"
#include "string_func.h"

@ -426,20 +426,6 @@ inline DiagDirection DiagdirBetweenTiles(TileIndex tile_from, TileIndex tile_to)
}
}
/**
* A callback function type for searching tiles.
*
* @param tile The tile to test
* @param user_data additional data for the callback function to use
* @return A boolean value, depend on the definition of the function.
*/
typedef bool TestTileOnSearchProc(TileIndex tile, void *user_data);
bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, void *user_data);
bool CircularTileSearch(TileIndex *tile, uint radius, uint w, uint h, TestTileOnSearchProc proc, void *user_data);
bool EnoughContiguousTilesMatchingCondition(TileIndex tile, uint threshold, TestTileOnSearchProc proc, void *user_data);
/**
* Get a random tile out of a given seed.
* @param r the random 'seed'

@ -10,6 +10,7 @@
#include "stdafx.h"
#include "debug.h"
#include "landscape.h"
#include "tilesearch_func.h"
#include "newgrf_house.h"
#include "newgrf_spritegroup.h"
#include "newgrf_text.h"

@ -33,6 +33,7 @@
#include "newgrf_debug.h"
#include "vehicle_func.h"
#include "station_func.h"
#include "tilesearch_func.h"
#include "table/strings.h"
#include "table/object_land.h"

@ -61,6 +61,7 @@
#include "cheat_type.h"
#include "newgrf_roadstop.h"
#include "core/math_func.hpp"
#include "tilesearch_func.h"
#include "table/strings.h"

@ -33,6 +33,7 @@
#include "zoom_func.h"
#include "departures_gui.h"
#include "graph_gui.h"
#include "tilesearch_func.h"
#include "zoning.h"
#include "newgrf_debug.h"
#include "roadveh.h"

@ -0,0 +1,29 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file tilesearch_func.h Tile search functions. */
#ifndef TILESEARCH_FUNC_H
#define TILESEARCH_FUNC_H
#include "tile_type.h"
/**
* A callback function type for searching tiles.
*
* @param tile The tile to test
* @param user_data additional data for the callback function to use
* @return A boolean value, depend on the definition of the function.
*/
typedef bool TestTileOnSearchProc(TileIndex tile, void *user_data);
bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, void *user_data);
bool CircularTileSearch(TileIndex *tile, uint radius, uint w, uint h, TestTileOnSearchProc proc, void *user_data);
bool EnoughContiguousTilesMatchingCondition(TileIndex tile, uint threshold, TestTileOnSearchProc proc, void *user_data);
#endif /* TILESEARCH_FUNC_H */

@ -49,6 +49,7 @@
#include "depot_base.h"
#include "object_map.h"
#include "object_base.h"
#include "tilesearch_func.h"
#include "ai/ai.hpp"
#include "game/game.hpp"
#include "zoom_func.h"

@ -10,6 +10,7 @@
#include "stdafx.h"
#include "cmd_helper.h"
#include "landscape.h"
#include "tilesearch_func.h"
#include "viewport_func.h"
#include "command_func.h"
#include "town.h"

Loading…
Cancel
Save