summaryrefslogtreecommitdiff
path: root/src/vehicle.h
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-06-12 11:22:32 +0000
committerpeter1138 <peter1138@openttd.org>2007-06-12 11:22:32 +0000
commit78d797a6b7cbafb79d128550d95867482cf3e931 (patch)
tree2318fb83c6ee94fe4c568067e21ff837afb6888b /src/vehicle.h
parent105c7455aea5a8d3ec9729cd7f66077343e7134b (diff)
downloadopenttd-78d797a6b7cbafb79d128550d95867482cf3e931.tar.xz
(svn r10111) -Codechange: Add new vehicle hash table for collision detection and finding vehicles on a tile. The hash area scanned is far smaller than the old hash table, which is now used for viewport updates only. This should give a significant performance improvement for games with many vehicles. (Based on work by 'B. N. SmatZ!' and 'madman2003')
Diffstat (limited to 'src/vehicle.h')
-rw-r--r--src/vehicle.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vehicle.h b/src/vehicle.h
index 8d734bf22..2d808c0b9 100644
--- a/src/vehicle.h
+++ b/src/vehicle.h
@@ -290,6 +290,8 @@ struct Vehicle {
int32 right_coord;
int32 bottom_coord;
Vehicle *next_hash;
+ Vehicle *next_new_hash;
+ Vehicle **old_new_hash;
/* Related to age and service time */
Date age; // Age in days
@@ -497,6 +499,7 @@ uint CountVehiclesInChain(const Vehicle* v);
bool IsEngineCountable(const Vehicle *v);
void DeleteVehicleChain(Vehicle *v);
void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc);
+void *VehicleFromPosXY(int x, int y, void *data, VehicleFromPosProc *proc);
void CallVehicleTicks();
Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z);