mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Use ring buffers for tile/landscape candidate queues
This commit is contained in:
parent
69683eecb8
commit
7502fbd44b
@ -35,10 +35,10 @@
|
||||
#include "town.h"
|
||||
#include "3rdparty/cpp-btree/btree_set.h"
|
||||
#include "scope_info.h"
|
||||
#include "core/ring_buffer.hpp"
|
||||
#include <array>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <deque>
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/sprites.h"
|
||||
@ -1359,7 +1359,7 @@ static bool FlowRiver(TileIndex spring, TileIndex begin, uint min_river_length)
|
||||
SET_MARK(begin);
|
||||
|
||||
/* Breadth first search for the closest tile we can flow down to. */
|
||||
std::deque<TileIndex> queue;
|
||||
ring_buffer<TileIndex> queue;
|
||||
queue.push_back(begin);
|
||||
|
||||
bool found = false;
|
||||
|
@ -15,8 +15,8 @@
|
||||
#include "rail_map.h"
|
||||
#include "tunnelbridge_map.h"
|
||||
#include "3rdparty/cpp-btree/btree_map.h"
|
||||
#include "core/ring_buffer.hpp"
|
||||
#include <array>
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
|
||||
#if defined(__linux__)
|
||||
@ -442,7 +442,7 @@ bool EnoughContiguousTilesMatchingCondition(TileIndex tile, uint threshold, Test
|
||||
static_assert(MAX_MAP_TILES_BITS <= 30);
|
||||
|
||||
btree::btree_set<uint32> processed_tiles;
|
||||
std::deque<uint32> candidates;
|
||||
ring_buffer<uint32> candidates;
|
||||
uint matching_count = 0;
|
||||
|
||||
auto process_tile = [&](TileIndex t, DiagDirection exclude_onward_dir) {
|
||||
|
Loading…
Reference in New Issue
Block a user