(svn r2660) Get rid of some more shifting/anding/casting

This commit is contained in:
tron
2005-07-21 06:31:02 +00:00
parent 5c5840417e
commit d71788c402
16 changed files with 74 additions and 75 deletions

View File

@@ -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)