summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-20 15:29:28 +0000
committertron <tron@openttd.org>2005-07-20 15:29:28 +0000
commitf09638ad3d3eaf3574086e351a56bf5c14159894 (patch)
treea82679a91beaee405777f0f3c5e3c45814f1ea5d /station_cmd.c
parentf3645d73073e262d9dba2f4d69a9848be435b7df (diff)
downloadopenttd-f09638ad3d3eaf3574086e351a56bf5c14159894.tar.xz
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 1e0d2af44..c76965c51 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -933,8 +933,8 @@ static void GetStationLayout(byte *layout, int numtracks, int plat_len, StationS
* @param x,y starting position of station dragging/placement
* @param p1 various bitstuffed elements
* - p1 = (bit 0) - orientation (p1 & 1)
- * - p1 = (bit 8-15) - number of tracks (p1 >> 8) & 0xFF)
- * - p1 = (bit 16-23) - platform length (p1 >> 16) & 0xFF)
+ * - p1 = (bit 8-15) - number of tracks
+ * - p1 = (bit 16-23) - platform length
* @param p2 various bitstuffed elements
* - p2 = (bit 0- 3) - railtype (p2 & 0xF)
* - p2 = (bit 4) - set for custom station (p2 & 0x10)
@@ -961,8 +961,8 @@ int32 CmdBuildRailroadStation(int x, int y, uint32 flags, uint32 p1, uint32 p2)
/* unpack parameters */
direction = p1 & 1;
- numtracks = (p1 >> 8) & 0xFF;
- plat_len = (p1 >> 16) & 0xFF;
+ numtracks = GB(p1, 8, 8);
+ plat_len = GB(p1, 16, 8);
/* w = length, h = num_tracks */
if (direction) {
h_org = plat_len;