summaryrefslogtreecommitdiff
path: root/src/tree_map.h
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-04 18:33:43 +0000
committeryexo <yexo@openttd.org>2010-01-04 18:33:43 +0000
commitb378e82676b299dc8d579cd2ac020758fbf52f84 (patch)
tree044688328cdbf84c799fd452f4c38c3132943db1 /src/tree_map.h
parent3e131e2fece740591d9187e19789a34b36c763fa (diff)
downloadopenttd-b378e82676b299dc8d579cd2ac020758fbf52f84.tar.xz
(svn r18719) -Feature: don't delete the rough/rocky status of a tile when it's covered by snow, this allows rocky tiles under snow if you have a variable snowline
Diffstat (limited to 'src/tree_map.h')
-rw-r--r--src/tree_map.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tree_map.h b/src/tree_map.h
index 39cbe9e1f..35bab6177 100644
--- a/src/tree_map.h
+++ b/src/tree_map.h
@@ -58,6 +58,7 @@ enum TreeGround {
TREE_GROUND_ROUGH = 1, ///< some rough tile
TREE_GROUND_SNOW_DESERT = 2, ///< a desert or snow tile, depend on landscape
TREE_GROUND_SHORE = 3, ///< shore
+ TREE_GROUND_ROUGH_SNOW = 4, ///< a snow tile that is rough underneed
};
@@ -91,7 +92,7 @@ static inline TreeType GetTreeType(TileIndex t)
static inline TreeGround GetTreeGround(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
- return (TreeGround)GB(_m[t].m2, 4, 2);
+ return (TreeGround)GB(_m[t].m2, 6, 3);
}
/**
@@ -116,7 +117,7 @@ static inline TreeGround GetTreeGround(TileIndex t)
static inline uint GetTreeDensity(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
- return GB(_m[t].m2, 6, 2);
+ return GB(_m[t].m2, 4, 2);
}
/**
@@ -133,8 +134,8 @@ static inline uint GetTreeDensity(TileIndex t)
static inline void SetTreeGroundDensity(TileIndex t, TreeGround g, uint d)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
- SB(_m[t].m2, 4, 2, g);
- SB(_m[t].m2, 6, 2, d);
+ SB(_m[t].m2, 4, 2, d);
+ SB(_m[t].m2, 6, 3, g);
}
/**
@@ -277,7 +278,7 @@ static inline void MakeTree(TileIndex t, TreeType type, uint count, uint growth,
{
SetTileType(t, MP_TREES);
SetTileOwner(t, OWNER_NONE);
- _m[t].m2 = density << 6 | ground << 4 | 0;
+ _m[t].m2 = ground << 6 | density << 4 | 0;
_m[t].m3 = type;
_m[t].m4 = 0 << 5 | 0 << 2;
_m[t].m5 = count << 6 | growth;