HGHT: Difference between revisions

Jump to navigation Jump to search
m
Added link to tscb
imported>Zephenryus
(Added file specification for hght files)
 
imported>Zephenryus
m (Added link to tscb)
Line 2: Line 2:
<code>hght</code> files describe the heightmap of the main field and add-on content field.
<code>hght</code> files describe the heightmap of the main field and add-on content field.
</onlyinclude>
</onlyinclude>
== HGHT File Specification ==
== HGHT File Specification ==


Line 10: Line 11:
<code>hght</code> files only contain a table of height data. There are 65,536 (256×256) unsigned short entries in the table.
<code>hght</code> files only contain a table of height data. There are 65,536 (256×256) unsigned short entries in the table.


Each file describes a 256×256 mesh tile. Each tile has placement data found in <code>MainField.tscb</code>.
Each file describes a 256×256 mesh tile. Each tile has placement data found in <code>[[TSCB|MainField.tscb]]</code>.


=== Height Map Data ===
=== Height Map Data ===
Line 30: Line 31:
<code>x</code> and <code>z</code><ref>`z` is expected to be an integer quotient. The `floor` function can be used if integer division is not supported.</ref> can be calculated, while iterating through the data table:
<code>x</code> and <code>z</code><ref>`z` is expected to be an integer quotient. The `floor` function can be used if integer division is not supported.</ref> can be calculated, while iterating through the data table:


<syntaxhighlight lang="c" line='line'>
<syntaxhighlight lang="c" line="line">
for (int index = 0; index < 256 * 256; index++) {
for (int index = 0; index < 256 * 256; index++) {
     uint x = index % 256;
     uint x = index % 256;
Anonymous user

Navigation menu