diff options
author | tron <tron@openttd.org> | 2005-07-21 06:31:02 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-21 06:31:02 +0000 |
commit | d71788c40206fa35b792d34769fde7768b4456c1 (patch) | |
tree | dc5c9c74cec9bfa29f94932a20193cd902a80f15 /industry_cmd.c | |
parent | 5c5840417e2f03514c51098f4786c6c1d6030b59 (diff) | |
download | openttd-d71788c40206fa35b792d34769fde7768b4456c1.tar.xz |
(svn r2660) Get rid of some more shifting/anding/casting
Diffstat (limited to 'industry_cmd.c')
-rw-r--r-- | industry_cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/industry_cmd.c b/industry_cmd.c index b24922025..8c03d6341 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -960,8 +960,8 @@ static void PlantFarmField(TileIndex tile) /* determine field size */ r = (Random() & 0x303) + 0x404; if (_opt.landscape == LT_HILLY) r += 0x404; - size_x = (byte)r; - size_y = r >> 8; + size_x = GB(r, 0, 8); + size_y = GB(r, 8, 8); /* offset tile to match size */ tile -= TileDiffXY(size_x / 2, size_y / 2); @@ -977,7 +977,7 @@ static void PlantFarmField(TileIndex tile) /* determine type of field */ r = Random(); type = ((r & 0xE0) | 0xF); - type2 = ((byte)(r >> 8) * 9) >> 8; + type2 = GB(r, 8, 8) * 9 >> 8; /* make field */ BEGIN_TILE_LOOP(cur_tile, size_x, size_y, tile) |