diff options
author | tron <tron@openttd.org> | 2004-11-17 18:03:33 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-11-17 18:03:33 +0000 |
commit | 3a7abc2a35fba00e1e59d8ea7fbfb1442e9c20c9 (patch) | |
tree | 948381017e4e170aac46612f80b7a790ea6b75b7 /station.h | |
parent | c4e989685179fbe463d138834f71375e94e0fbad (diff) | |
download | openttd-3a7abc2a35fba00e1e59d8ea7fbfb1442e9c20c9.tar.xz |
(svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
Diffstat (limited to 'station.h')
-rw-r--r-- | station.h | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -93,6 +93,10 @@ void GetAcceptanceAroundTiles(uint *accepts, uint tile, int w, int h); uint GetStationPlatforms(Station *st, uint tile); +/* Station layout for given dimensions - it is a two-dimensional array + * where index is computed as (x * platforms) + platform. */ +typedef byte *StationLayout; + struct StationSpec { uint32 grfid; int localidx; // per-GRFFile station index + 1; SetCustomStation() takes care of this @@ -110,9 +114,41 @@ struct StationSpec { STAT_CLASS_CUSTOM, // some custom class } sclass; + /* Bitmask of platform numbers/lengths available for the station. Bits + * 0..6 correspond to 1..7, while bit 7 corresponds to >7 platforms or + * lenght. */ + byte allowed_platforms; + byte allowed_lengths; + + /* Custom sprites */ byte tiles; + /* 00 = plain platform + * 02 = platform with building + * 04 = platform with roof, left side + * 06 = platform with roof, right side + * + * These numbers are used for stations in NE-SW direction, or these + * numbers plus one for stations in the NW-SE direction. */ DrawTileSprites renderdata[8]; + /* Custom layouts */ + /* The layout array is organized like [lenghts][platforms], both being + * dynamic arrays, the field itself is length*platforms array containing + * indexes to @renderdata (only even numbers allowed) for the given + * station tile. */ + /* @lengths is length of the @platforms and @layouts arrays, that is + * number of maximal length for which the layout is defined (since + * arrays are indexed from 0, the length itself is at [length - 1]). */ + byte lengths; + /* @platforms is array of number of platforms defined for each length. + * Zero means no platforms defined. */ + byte *platforms; + /* @layout is @layouts-sized array of @platforms-sized arrays, + * containing pointers to length*platforms-sized arrays or NULL if + * default OTTD station layout should be used for stations of these + * dimensions. */ + StationLayout **layouts; + /* Sprite offsets for renderdata->seq->image. spritegroup[0] is default * whilst spritegroup[1] is "CID_PURCHASE". */ struct SpriteGroup spritegroup[2]; |