Table of Contents
Water map fileThe current file format for L3DT water maps is WMF v1.0. This file format is largely based on the HFF v1.0 format, but also supports multiple data layers (water level, water type, water ID#). The header structure is as follows: Header structureThe water data in the WMF v1.0 file is preceded by a header containing the following information:
Header length & reserved sectionTypically the data offset is set to 64, meaning the reserved section is 64 - 45 = 19 bytes long. The reserved section contains no information, but may be used in later versions to store additional parameters, flags, etc. Pixel orderPlease consult the Pixel order section for the HFF format, from which WMF is derived. Pixel structureEach pixel in the water map file consists of a water level section followed by a auxiliary data section. Water level data typesDepending on the water level data size and floating point flag values in the file header, WMF water level data may be either:
To convert the file values to real-world water levels (in metres), the WMF format uses the same vertical scaling system as the HFF format. For more information, please refer to the 'reading/writing a HFF' section of the HFF specification (link here). Auxiliary pixel dataThe contents of the auxiliary pixel data section depends on the value of the Aux. data type section in the header. Auxiliary data type 0If the value of Aux. data type is 0, there is no auxiliary data. Auxiliary data type 1 (default)If the value of Aux. data type is 1, then each pixel has three additional bytes following the water level data. These bytes are:
Source code for reading/writing WMFThe source code for L3DT's WMF plugin is available here. This code is written in C++, using MSVC 7.0 and L3DT's Zeolite plugin API. Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|