diff options
author | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
commit | ac66e3e28f35c6939d3af68d1f0e26eb9b34e377 (patch) | |
tree | a82679a91beaee405777f0f3c5e3c45814f1ea5d /station_cmd.c | |
parent | f432314fa907d4f3ee63537d399bad64a35033bd (diff) | |
download | openttd-ac66e3e28f35c6939d3af68d1f0e26eb9b34e377.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.c | 8 |
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; |