diff options
author | darkvater <darkvater@openttd.org> | 2004-11-14 14:53:15 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-11-14 14:53:15 +0000 |
commit | 58473175266f453b900e4262588ccce075ec05c3 (patch) | |
tree | 548d0fcde9c3e1cc23af25dbd64d758bbf662231 /station.h | |
parent | ccc496ba2ce07be7bd8faf0a084e983dbed5e80b (diff) | |
download | openttd-58473175266f453b900e4262588ccce075ec05c3.tar.xz |
(svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
Diffstat (limited to 'station.h')
-rw-r--r-- | station.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -110,13 +110,22 @@ typedef struct DrawTileSprites { struct StationSpec { - int globalidx; + uint32 grfid; + int localidx; // per-GRFFile station index + 1; SetCustomStation() takes care of this + uint32 classid; + byte tiles; DrawTileSprites renderdata[8]; }; +/* Here, @stid is local per-GRFFile station index. If spec->localidx is not yet + * set, it gets new dynamically allocated global index and spec->localidx is + * set to @stid, otherwise we take it as that we are replacing it and try to + * search for it first (that isn't much fast but we do it only very seldom). */ void SetCustomStation(byte stid, struct StationSpec *spec); +/* Here, @stid is global station index (in continous range 0..GetCustomStationsCount()) + * (lookup is therefore very fast as we do this very frequently). */ DrawTileSprites *GetCustomStationRenderdata(uint32 classid, byte stid); int GetCustomStationsCount(uint32 classid); |