# HG changeset patch
# User peter1138
# Date 1146691549 0
# Node ID 8528d7737361c1283a132d72a2e17921c8472908
# Parent e901ee333003f5c4410bd60a3d93be79e612ee1c
(svn r4724) - Newstations: Add per-tile random data for station tiles.
diff -r e901ee333003 -r 8528d7737361 docs/landscape.html
--- a/docs/landscape.html Wed May 03 21:19:21 2006 +0000
+++ b/docs/landscape.html Wed May 03 21:25:49 2006 +0000
@@ -381,6 +381,7 @@
m1: owner of the station
m2: index into the array of stations
m3 bits 0..3: track type for railway stations, must be 0 for all the other stations
+m3 bits 4..7: persistent random data for newstations
m4 = custom station id; 0 means standard graphics
diff -r e901ee333003 -r 8528d7737361 docs/landscape_grid.html
--- a/docs/landscape_grid.html Wed May 03 21:19:21 2006 +0000
+++ b/docs/landscape_grid.html Wed May 03 21:25:49 2006 +0000
@@ -145,7 +145,7 @@
station |
XXXX XXXX |
XXXX XXXX XXXX XXXX |
- OOOO XXXX |
+ XXXX XXXX |
XXXX XXXX |
XXXX XXXX |
XXXX XXXX |
diff -r e901ee333003 -r 8528d7737361 station_cmd.c
--- a/station_cmd.c Wed May 03 21:19:21 2006 +0000
+++ b/station_cmd.c Wed May 03 21:25:49 2006 +0000
@@ -1083,6 +1083,7 @@
MakeRailStation(tile, st->owner, st->index, axis, *layout_ptr++, GB(p2, 0, 4));
SetCustomStationSpecIndex(tile, specindex);
+ SetStationTileRandomBits(tile, GB(Random(), 0, 4));
tile += tile_delta;
} while (--w);
diff -r e901ee333003 -r 8528d7737361 station_map.h
--- a/station_map.h Wed May 03 21:19:21 2006 +0000
+++ b/station_map.h Wed May 03 21:25:49 2006 +0000
@@ -236,6 +236,18 @@
return _m[t].m4;
}
+static inline void SetStationTileRandomBits(TileIndex t, byte random_bits)
+{
+ assert(IsTileType(t, MP_STATION));
+ SB(_m[t].m3, 4, 4, random_bits);
+}
+
+static inline byte GetStationTileRandomBits(TileIndex t)
+{
+ assert(IsTileType(t, MP_STATION));
+ return GB(_m[t].m3, 4, 4);
+}
+
static inline void MakeStation(TileIndex t, Owner o, StationID sid, byte m5)
{
SetTileType(t, MP_STATION);