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 /order.h | |
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 'order.h')
-rw-r--r-- | order.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -135,9 +135,9 @@ static inline uint32 PackOrder(const Order *order) static inline Order UnpackOrder(uint32 packed) { Order order; - order.type = (packed & 0x000000FF); - order.flags = (packed & 0x0000FF00) >> 8; - order.station = (packed & 0xFFFF0000) >> 16; + order.type = GB(packed, 0, 8); + order.flags = GB(packed, 8, 8); + order.station = GB(packed, 16, 16); order.next = NULL; order.index = 0; // avoid compiler warning return order; |