@@ -756,12 +756,13 @@
<td><strong>Trees </strong></td>
</tr>
<tr>
<td valign=top nowrap> </td>
<td>
<ul>
<li>m1 bits 6..5: water class (sea or land)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
<li>m2 bits 8..6: ground
<table>
<td align=left><tt>0</tt> </td>
@@ -191,13 +191,13 @@ the array so you can quickly see what is
<td>4</td>
<td class="caption">trees</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
<td class="bits"><span class="free">O</span>XX<span class="option">~ ~~~~</span></td>
<td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td>
<td class="bits"><span class="option">~~</span>XX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XX<span class="free">OO O</span>XXX</td>
@@ -10,12 +10,13 @@
/** @file tree_map.h Map accessors for tree tiles. */
#ifndef TREE_MAP_H
#define TREE_MAP_H
#include "tile_map.h"
#include "water_map.h"
/**
* List of tree types along all landscape types.
*
* This enumeration contains a list of the different tree types along
* all landscape types. The values for the enumerations may be used for
@@ -130,12 +131,13 @@ static inline uint GetTreeDensity(TileIn
*/
static inline void SetTreeGroundDensity(TileIndex t, TreeGround g, uint d)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
SB(_m[t].m2, 4, 2, d);
SB(_m[t].m2, 6, 3, g);
SetWaterClass(t, g == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID);
}
* Returns the number of trees on a tile.
* This function returns the number of trees of a tile (1-4).
@@ -91,13 +91,13 @@ static inline WaterTileType GetWaterTile
* You can then subsequently call GetWaterClass().
* @param t Tile to query.
* @return True if the tiletype has a waterclass.
static inline bool HasTileWaterClass(TileIndex t)
return IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT);
return IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT) || IsTileType(t, MP_TREES);
* Get the water class at a tile.
* @param t Water tile to query.
* @pre IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_INDUSTRY) || IsTileType(t, MP_OBJECT)
@@ -201,13 +201,13 @@ static inline bool IsCoast(TileIndex t)
* Is it a coast tile
* @return \c true if it is a coast.
static inline bool IsCoastTile(TileIndex t)
return IsTileType(t, MP_WATER) && IsCoast(t);
return (IsTileType(t, MP_WATER) && IsCoast(t)) || (IsTileType(t, MP_TREES) && GetWaterClass(t) != WATER_CLASS_INVALID);
* Is it a water tile with a ship depot on it?
* @return \c true if it is a ship depot tile.
Status change: