From a14ad77a36c836fd3f6940eadeb8161e7ad02f92 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 25 Oct 2008 13:51:47 +0000 Subject: (svn r14528) -Codechange: cache the closest town for all road tiles instead of only roads owned by tiles. This replaces a O(n) search over all towns from the road's tileloop with a O(1) lookup (PhilSophus) --- docs/landscape.html | 2 +- docs/landscape_grid.html | 2 +- src/openttd.cpp | 4 ++++ src/road_cmd.cpp | 27 +++++++++++++++++++++++++-- src/road_cmd.h | 1 + src/road_map.h | 6 +++--- src/station_cmd.cpp | 2 +- src/town_cmd.cpp | 21 +++++++++++++++++++++ src/town_gui.cpp | 9 +++++++-- 9 files changed, 64 insertions(+), 10 deletions(-) diff --git a/docs/landscape.html b/docs/landscape.html index ffa55dced..7dce5470f 100644 --- a/docs/landscape.html +++ b/docs/landscape.html @@ -513,6 +513,7 @@