diff options
author | tron <tron@openttd.org> | 2005-10-05 07:20:26 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-10-05 07:20:26 +0000 |
commit | ae4a1f3675bab50b93e443dcca07fd297fcdc58d (patch) | |
tree | 8281c38dbbb38386dacf57d352e00b62be0edc77 /town_cmd.c | |
parent | 102cf2615f8ffb4e260680a5f2b3b7d9f2a7a130 (diff) | |
download | openttd-ae4a1f3675bab50b93e443dcca07fd297fcdc58d.tar.xz |
(svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB
Diffstat (limited to 'town_cmd.c')
-rw-r--r-- | town_cmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/town_cmd.c b/town_cmd.c index d2a14f59b..9749cee8e 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -78,7 +78,7 @@ typedef struct DrawTownTileStruct { static void TownDrawHouseLift(const TileInfo *ti) { - AddChildSpriteScreen(0x5A3, 0xE, 0x3C - (_m[ti->tile].m1 & 0x7F)); + AddChildSpriteScreen(0x5A3, 0xE, 0x3C - GB(_m[ti->tile].m1, 0, 7)); } typedef void TownDrawTileProc(const TileInfo *ti); @@ -183,10 +183,10 @@ static void AnimateTile_Town(TileIndex tile) SB(_m[tile].m5, 0, 6, i); } - a = _m[tile].m1 & 0x7F; - b = (_m[tile].m5&0x3F) * 6; + a = GB(_m[tile].m1, 0, 7); + b = GB(_m[tile].m5, 0, 6) * 6; a += (a < b) ? 1 : -1; - _m[tile].m1 = (_m[tile].m1 & 0x80) | a; + SB(_m[tile].m1, 0, 7, a); if (a == b) { _m[tile].m1 &= 0x7F; @@ -623,7 +623,7 @@ static void GrowTownInTile(TileIndex *tile_ptr, uint mask, int block, Town *t1) // Reached a tunnel? Then continue at the other side of it. if (IsTileType(tile, MP_TUNNELBRIDGE) && (_m[tile].m5& ~3) == 4) { - FindLengthOfTunnelResult flotr = FindLengthOfTunnel(tile, _m[tile].m5&3); + FindLengthOfTunnelResult flotr = FindLengthOfTunnel(tile, GB(_m[tile].m5, 0, 2)); *tile_ptr = flotr.tile; return; } |