(svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB

This commit is contained in:
tron
2005-10-05 07:20:26 +00:00
parent 102cf2615f
commit ae4a1f3675
17 changed files with 126 additions and 127 deletions

View File

@@ -1430,11 +1430,11 @@ int32 DoConvertStationRail(TileIndex tile, uint totype, bool exec)
if (_m[tile].m5 >= 8) return CMD_ERROR;
// tile is already of requested type?
if ((_m[tile].m3 & 0xFU) == totype) return CMD_ERROR;
if (GB(_m[tile].m3, 0, 4) == totype) return CMD_ERROR;
if (exec) {
// change type.
_m[tile].m3 = (_m[tile].m3 & 0xF0) + totype;
SB(_m[tile].m3, 0, 4, totype);
MarkTileDirtyByTile(tile);
}
@@ -2131,7 +2131,7 @@ static void DrawTile_Station(TileInfo *ti)
uint32 image;
const DrawTileSeqStruct *dtss;
const DrawTileSprites *t = NULL;
byte railtype = _m[ti->tile].m3 & 0xF;
byte railtype = GB(_m[ti->tile].m3, 0, 4);
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
SpriteID offset;
uint32 relocation = 0;