Add new landscape variable for ground density and snow presence

pull/461/head
Jonathan G Rennison 1 year ago
parent 0d4f196451
commit 39277404a2

@ -81,6 +81,8 @@
<tr><td>tile_height</td><td>0..255</td><td>Height of the lowest corner of the tile</td></tr> <tr><td>tile_height</td><td>0..255</td><td>Height of the lowest corner of the tile</td></tr>
<tr><td>tile_hash</td><td>0..4294967295</td><td>Hash value derived from the coordinates of the tile, suitable for pseudo-randomising graphics</td></tr> <tr><td>tile_hash</td><td>0..4294967295</td><td>Hash value derived from the coordinates of the tile, suitable for pseudo-randomising graphics</td></tr>
<tr><td>landscape_type</td><td>NEW_LANDSCAPE_TYPE_XXX</td><td>Landscape type<br />XXX = ROCKS</td></tr> <tr><td>landscape_type</td><td>NEW_LANDSCAPE_TYPE_XXX</td><td>Landscape type<br />XXX = ROCKS</td></tr>
<tr><td>snow_present</td><td>0 or 1</td><td>Snow is present on this tile, at any density.</br>This requires <font face="monospace">new_landscape</font>, version 2.</td></tr>
<tr><td>ground_density</td><td>0..3</td><td>Ground density (if snow_present is 1, this is the snow density).</br>This requires <font face="monospace">new_landscape</font>, version 2.</td></tr>
</table> </table>
<br /> <br />
Variables that require one or more parameters: Variables that require one or more parameters:

@ -84,6 +84,7 @@
<tr><td><a href="#newlandscape_tile_height">42</a></td><td><a href="#newlandscape_tile_height">newlandscape_tile_height</a></td><td>Tile Height</td></tr> <tr><td><a href="#newlandscape_tile_height">42</a></td><td><a href="#newlandscape_tile_height">newlandscape_tile_height</a></td><td>Tile Height</td></tr>
<tr><td><a href="#newlandscape_tile_hash">43</a></td><td><a href="#newlandscape_tile_hash">newlandscape_tile_hash</a></td><td>Tile Hash</td></tr> <tr><td><a href="#newlandscape_tile_hash">43</a></td><td><a href="#newlandscape_tile_hash">newlandscape_tile_hash</a></td><td>Tile Hash</td></tr>
<tr><td><a href="#newlandscape_landscape_type">44</a></td><td><a href="#newlandscape_landscape_type">newlandscape_landscape_type</a></td><td>Landscape Type</td></tr> <tr><td><a href="#newlandscape_landscape_type">44</a></td><td><a href="#newlandscape_landscape_type">newlandscape_landscape_type</a></td><td>Landscape Type</td></tr>
<tr><td><a href="#newlandscape_ground_info">45</a></td><td><a href="#newlandscape_ground_info">newlandscape_ground_info</a></td><td>Ground info</td></tr>
<tr><td><a href="#newlandscape_land_info_nearby_tiles">60</a></td><td><a href="#newlandscape_land_info_nearby_tiles">newlandscape_land_info_nearby_tiles</a></td><td>Land info of nearby tiles</td></tr> <tr><td><a href="#newlandscape_land_info_nearby_tiles">60</a></td><td><a href="#newlandscape_land_info_nearby_tiles">newlandscape_land_info_nearby_tiles</a></td><td>Land info of nearby tiles</td></tr>
</table> </table>
@ -110,6 +111,18 @@
<h4 id="newlandscape_landscape_type">Landscape type (44, or mappable variable: newlandscape_landscape_type)</h4> <h4 id="newlandscape_landscape_type">Landscape type (44, or mappable variable: newlandscape_landscape_type)</h4>
<p>The landscape type, this currently only has the value 0: rocky tiles.</p> <p>The landscape type, this currently only has the value 0: rocky tiles.</p>
<h4 id="newlandscape_ground_info">Ground info (45, or mappable variable: newlandscape_ground_info)</h4>
<p>Miscellaneous ground info
<table>
<tr><th>Bits</th><th>Values</th><th>Meaning</th></tr>
<tr><td>0 - 3</td><td>0..3</td><td>Ground density (if snow is present, this is the snow density)</td></tr>
<tr><td>4</td><td>0 or 1</td><td>Snow is present on this tile, at any density</td></tr>
</table>
<br />
The remaining bits are reserved for future use and should be masked.<br />
This requires <font face="monospace">new_landscape</font>, version 2.</p>
</p>
<h4 id="roadstop_land_info_nearby_tiles">Land info of nearby tile (60, or mappable variable: newlandscape_land_info_nearby_tiles)</h4> <h4 id="roadstop_land_info_nearby_tiles">Land info of nearby tile (60, or mappable variable: newlandscape_land_info_nearby_tiles)</h4>
<p>This has the same value as <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Industry_Tiles#Land_info_of_nearby_tiles_.2860.29">industry tile (feature 9) variable 60</a>.</p> <p>This has the same value as <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Industry_Tiles#Land_info_of_nearby_tiles_.2860.29">industry tile (feature 9) variable 60</a>.</p>

@ -157,6 +157,7 @@ extern const GRFVariableMapDefinition _grf_action2_remappable_variables[] = {
GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x42, "newlandscape_tile_height"), GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x42, "newlandscape_tile_height"),
GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x43, "newlandscape_tile_hash"), GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x43, "newlandscape_tile_hash"),
GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x44, "newlandscape_landscape_type"), GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x44, "newlandscape_landscape_type"),
GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x45, "newlandscape_ground_info"),
GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x60, "newlandscape_land_info_nearby_tiles"), GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x60, "newlandscape_land_info_nearby_tiles"),
GRFVariableMapDefinition(), GRFVariableMapDefinition(),
}; };

@ -49,6 +49,9 @@ std::vector<const GRFFile *> _new_landscape_rocks_grfs;
case 0x44: case 0x44:
return this->landscape_type; return this->landscape_type;
case 0x45:
return GetClearDensity(this->ti->tile) | (IsSnowTile(this->ti->tile) ? 0x10 : 0);
case 0x60: { case 0x60: {
TileIndex tile = this->ti->tile; TileIndex tile = this->ti->tile;
if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required

@ -1762,6 +1762,7 @@ static const NIVariable _niv_newlandscape[] = {
NIV(0x42, "tile height"), NIV(0x42, "tile height"),
NIV(0x43, "tile hash"), NIV(0x43, "tile hash"),
NIV(0x44, "landscape type"), NIV(0x44, "landscape type"),
NIV(0x45, "ground info"),
NIV(0x60, "land info of nearby tiles"), NIV(0x60, "land info of nearby tiles"),
NIV_END(), NIV_END(),
}; };

Loading…
Cancel
Save