2005-03-11 00:32:24 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
< html >
< head >
< meta content = "text/html; charset=UTF-8" http-equiv = "content-type" >
2005-03-11 18:31:56 +00:00
< meta name = "Description" content = "Structure of OpenTTD (OTTD) landscape arrays #2" >
< title > OpenTTD Landscape Internals - #2< / title >
< style type = "text/css" >
.freebits { background-color: rgb(30, 178, 54);}
.abuse { background-color: rgb(255, 58, 31);}
< / style >
2005-03-11 00:32:24 +00:00
< / head >
< body style = "direction: ltr;" >
< h3 style = "font-weight: bold;" > Landscape< / h3 >
2005-03-11 18:31:56 +00:00
< span style = "font-weight: bold;" > < / span > Five arrays are used to encode the information of the contents of the tile.
This can be seen in the < a href = "landscape.html" > Landscape< / a > document. This page tries to give an overview of used and free bits of
the array so you can quickly see what is used and what is not.
2005-03-11 00:32:24 +00:00
< ul >
2005-03-11 18:31:56 +00:00
< li > < span style = "font-weight: bold;" > < span class = "freebits" > O< / span > < / span > - bit is free< / li >
< li > < span style = "font-weight: bold;" > X< / span > - bit is used< / li >
< li > < span style = "font-weight: bold;" > < span class = "abuse" > < / span > < / span > - bit of _map_* is abused for different purposes< / li >
2005-03-11 00:32:24 +00:00
< / ul >
2005-03-11 18:31:56 +00:00
< p >
< ul >
< li > < span style = "font-weight: bold;" > _map_owner[]< / span > - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.).< / li >
< li > < span style = "font-weight: bold;" > _map2[]< / span > - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array.< / li >
< li > < span style = "font-weight: bold;" > _map3[]< / span > - 16 bits in size, which is split up into _map3lo[] and _map3hi[] is used for general storage.< / li >
< li > < span style = "font-weight: bold;" > _map_type_and_height[]< / span > - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits).< / li >
< li > < span style = "font-weight: bold;" > _map5[]< / span > - 8 bits in size, is used for general storage.< / li >
< / ul >
2005-03-11 00:32:24 +00:00
< table style = "text-align: left;" border = "1" cellpadding = "2"
cellspacing="2" width="100%">
< tbody >
< tr >
2005-03-11 18:31:56 +00:00
< th style = "white-space: nowrap; text-align: left;" > class< / th >
< th style = "white-space: nowrap; text-align: center;" > _map_owner[L1] (8)< / th >
< th style = "white-space: nowrap; text-align: center;" > _map2[L2] (16)< / th >
< th style = "white-space: nowrap; text-align: center;" > _map3[lo& hi,L3] (16)< / th >
< th style = "white-space: nowrap; text-align: center;" > _map_type_and_height[L4] (8)< / th >
< th style = "white-space: nowrap; text-align: center;" > _map5[L5] (8)< / th >
2005-03-11 00:32:24 +00:00
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (0) ground< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX < span class = "freebits" > OOOO OO< / span > XX XXXX< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX X< span class = "freebits" > O< / span > XX< / td >
2005-03-11 00:32:24 +00:00
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (1) rail< / td >
< td style = "white-space: nowrap; text-align: center;" > < span class = "abuse" > XXXX XXXX< / span > < / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX < span class = "freebits" > OOOO OOOO< / span > < br >
2005-03-11 00:32:24 +00:00
< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX XXX< span class = "freebits" > O OOOO< / span > < br >
2005-03-11 00:32:24 +00:00
< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< br >
< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > depot/checkpoint< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
< td style = "text-align: center;" > -inherit-< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
< td style = "text-align: center;" > XXXX X< span class = "freebits" > OOO< / span > XXXX XXXX< / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > -inherit-< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXX< span class = "freebits" > O OO< / span > XX< / td >
2005-03-11 00:32:24 +00:00
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (2) road< / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > < span class = "abuse" > XXXX XXXX XXXX XXXX< / span > < / td >
< td style = "text-align: center;" > < span class = "freebits" > OOOO OOOO< / span > XXXX XXXX< / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > XXXX XXXX< / td >
< td style = "text-align: center;" > XXXX XXXX< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > level crossing< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
< td style = "text-align: center;" > -inherit-< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > < span class = "abuse" > XXXX XXXX XXXX XXXX< / span > < / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > XXXX XXXX XXXX XXXX< / td >
< td style = "text-align: center;" > -inherit-< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > < span class = "freebits" > OO< / span > XX XXXX< / td >
2005-03-11 00:32:24 +00:00
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > road depot< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
< td style = "text-align: center;" > -inherit-< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
< td style = "text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOO< / span > X< / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > XXXX XXXX< / td >
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (3) town< / td >
< td style = "white-space: nowrap; text-align: center;" > < span class = "abuse" > XXXX XXXX< / span > < / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX XXXX XXXX< br >
< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX XXXX XXXX< br >
< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XX< span class = "freebits" > O< / span > X< / td >
2005-03-11 00:32:24 +00:00
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (4) trees< / td >
< td style = "white-space: nowrap; text-align: center;" > < span class = "abuse" > XXXX XXXX< / span > < / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XX< span class = "freebits" > OO OOOO OOOO< / span > < / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX < span class = "freebits" > OO< / span > XX XXXX< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXX< span class = "freebits" > O OO< / span > XX< / td >
2005-03-11 00:32:24 +00:00
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (5) station< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX X< span class = "freebits" > OOO< / span > XXXX XXXX< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (6) water< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
< td style = "white-space: nowrap; text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (8) industry< / td >
< td style = "white-space: nowrap; text-align: center;" > < span class = "abuse" > XXXX X< / span > < span class = "freebits" > OO< / span > < span class = "abuse" > X< / span > < / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > bubble/sugar/toffee< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > XXXX XXXX < span class = "freebits" > OOOO OOOO< / span > < / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > toy factory< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > XXXX XXXX XXXX XXXX< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > gold/copper/coal< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > XXXX XXXX< / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > oil wells< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > power station< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > XXXX XX< span class = "freebits" > O< / span > X< / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< td style = "text-align: center;" > -inherit-< / td >
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (9) tunnel< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX < span class = "freebits" > OOOO OOOO OOO< / span > X< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< / tr >
< tr >
< td >
< ul >
2005-03-11 18:31:56 +00:00
< li style = "white-space: nowrap; text-align: left;" > bridge< / li >
2005-03-11 00:32:24 +00:00
< / ul >
< / td >
< td style = "text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "text-align: center;" > < span class = "abuse" > XXXX XXXX< / span > < span class = "freebits" > OOOO OOOO< / span > < / td >
< td style = "text-align: center;" > XXXX XXXX < span class = "freebits" > OOOO OOO< / span > X< / td >
2005-03-11 00:32:24 +00:00
< td style = "text-align: center;" > XXXX XXXX< / td >
< td style = "text-align: center;" > XXXX XXXX< / td >
< / tr >
< tr >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: left;" > (10) various (HQ)< / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
2005-03-11 18:31:56 +00:00
< td style = "white-space: nowrap; text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
< td style = "white-space: nowrap; text-align: center;" > < span class = "freebits" > OOOO OOOO OOOO OOOO< / span > < / td >
2005-03-11 00:32:24 +00:00
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< td style = "white-space: nowrap; text-align: center;" > XXXX XXXX< / td >
< / tr >
< / tbody >
< / table >
2005-03-11 18:31:56 +00:00
2005-03-11 00:32:24 +00:00
< / body >
< / html >