diff options
author | tron <tron@openttd.org> | 2005-07-30 09:29:20 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-30 09:29:20 +0000 |
commit | 9b676d2cd992726223c39fd46db97994685df13f (patch) | |
tree | 4e9f7fae006fcf7f0433f1e421bad805c1c2013f /tree_cmd.c | |
parent | 79620db9be3e0cf8e773558ccd8b0fa399fe90d7 (diff) | |
download | openttd-9b676d2cd992726223c39fd46db97994685df13f.tar.xz |
(svn r2758) Add the AB() macro to add a value to a bit range and use it in a few places, also make use of GB and SB nearby
Diffstat (limited to 'tree_cmd.c')
-rw-r--r-- | tree_cmd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tree_cmd.c b/tree_cmd.c index d9cf5e2ad..c5d340cbf 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -485,11 +485,8 @@ static void TileLoop_Trees(TileIndex tile) TileLoopClearHelper(tile); /* increase counter */ - { - uint16 m2 = _m[tile].m2; - _m[tile].m2 = m2 = (m2 & 0xF0) | ((m2 + 1) & 0xF); - if ((m2 & 0xF) != 0) return; - } + AB(_m[tile].m2, 0, 4, 1); + if (GB(_m[tile].m2, 0, 4) != 0) return; m5 = _m[tile].m5; if (GB(m5, 0, 3) == 3) { |