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
commitce590b59f359b6ac8db7d29f0af6a885b63f53c0 (patch)
tree2318fb83c6ee94fe4c568067e21ff837afb6888b /src/vehicle.h
parente5ea54fe222032dd61cd3c00c9cb98ed23a9b02e (diff)
downloadopenttd-ce590b59f359b6ac8db7d29f0af6a885b63f53c0.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);