diff options
author | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-20 15:29:28 +0000 |
commit | ac66e3e28f35c6939d3af68d1f0e26eb9b34e377 (patch) | |
tree | a82679a91beaee405777f0f3c5e3c45814f1ea5d /industry_cmd.c | |
parent | f432314fa907d4f3ee63537d399bad64a35033bd (diff) | |
download | openttd-ac66e3e28f35c6939d3af68d1f0e26eb9b34e377.tar.xz |
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
Diffstat (limited to 'industry_cmd.c')
-rw-r--r-- | industry_cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/industry_cmd.c b/industry_cmd.c index d421617e6..d7eaf5840 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -315,7 +315,7 @@ static void DrawCoalPlantSparkles(TileInfo *ti) { int image = _m[ti->tile].owner; if (image & 0x80) { - image = (image >> 2) & 0x1F; + image = GB(image, 2, 5); if (image != 0 && image < 7) { AddChildSpriteScreen(image + 0x806, _coal_plant_sparkles_x[image-1], @@ -1802,7 +1802,7 @@ static void MaybeNewIndustry(uint32 r) int j; Industry *i; - type = _new_industry_rand[_opt.landscape][(r >> 16) & 0x1F]; + type = _new_industry_rand[_opt.landscape][GB(r, 16, 5)]; if (type == IT_OIL_WELL && _date > 10958) return; |