diff options
author | tron <tron@openttd.org> | 2005-11-14 08:09:57 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-11-14 08:09:57 +0000 |
commit | 833032adc09ce95c68d4a4b412221a0b3f88e670 (patch) | |
tree | 80b15078ff5a1c09815ccb23f4c9e7629774dae4 /smallmap_gui.c | |
parent | 357aba747578ecd3b8cc1a29bc740634211ada37 (diff) | |
download | openttd-833032adc09ce95c68d4a4b412221a0b3f88e670.tar.xz |
(svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT
Diffstat (limited to 'smallmap_gui.c')
-rw-r--r-- | smallmap_gui.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/smallmap_gui.c b/smallmap_gui.c index 4d7107680..8fc731e1f 100644 --- a/smallmap_gui.c +++ b/smallmap_gui.c @@ -197,15 +197,15 @@ static const uint16 * const _legend_table[] = { static inline void WRITE_PIXELS(Pixel* d, uint32 val) { # if defined(TTD_BIG_ENDIAN) - d[0] = (byte)(val >> 24); - d[1] = (byte)(val >> 16); - d[2] = (byte)(val >> 8); - d[3] = (byte)(val >> 0); + d[0] = GB(val, 24, 8); + d[1] = GB(val, 16, 8); + d[2] = GB(val, 8, 8); + d[3] = GB(val, 0, 8); # elif defined(TTD_LITTLE_ENDIAN) - d[0] = (byte)(val >> 0); - d[1] = (byte)(val >> 8); - d[2] = (byte)(val >> 16); - d[3] = (byte)(val >> 24); + d[0] = GB(val, 0, 8); + d[1] = GB(val, 8, 8); + d[2] = GB(val, 16, 8); + d[3] = GB(val, 24, 8); # endif } @@ -213,15 +213,15 @@ static const uint16 * const _legend_table[] = { static inline void WRITE_PIXELS_OR(Pixel* d, uint32 val) { # if defined(TTD_BIG_ENDIAN) - d[0] |= (byte)(val >> 24); - d[1] |= (byte)(val >> 16); - d[2] |= (byte)(val >> 8); - d[3] |= (byte)(val >> 0); + d[0] |= GB(val, 24, 8); + d[1] |= GB(val, 16, 8); + d[2] |= GB(val, 8, 8); + d[3] |= GB(val, 0, 8); # elif defined(TTD_LITTLE_ENDIAN) - d[0] |= (byte)(val >> 0); - d[1] |= (byte)(val >> 8); - d[2] |= (byte)(val >> 16); - d[3] |= (byte)(val >> 24); + d[0] |= GB(val, 0, 8); + d[1] |= GB(val, 8, 8); + d[2] |= GB(val, 16, 8); + d[3] |= GB(val, 24, 8); # endif } #else |