Class WoodsFile
Reads data from WOODS.WLD.
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class WoodsFile
Constructors
| Improve this Doc View SourceWoodsFile()
Default constructor.
Declaration
public WoodsFile()
WoodsFile(String, FileUsage, Boolean)
Load constructor.
Declaration
public WoodsFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to WOODS.WLD. |
FileUsage | usage | Specify if file will be accessed from disk, or loaded into RAM. |
Boolean | readOnly | File will be read-only if true, read-write if false. |
Fields
| Improve this Doc View SourcemapHeightValue
Height of heightmap in bytes.
Declaration
public const int mapHeightValue = 500
Field Value
Type | Description |
---|---|
Int32 |
mapWidthValue
Width of heightmap in bytes.
Declaration
public const int mapWidthValue = 1000
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceBuffer
Gets or sets extracted heightmap data.
Declaration
public byte[] Buffer { get; set; }
Property Value
Type | Description |
---|---|
Byte[] |
Filename
Gets default WOODS.WLD filename.
Declaration
public static string Filename { get; }
Property Value
Type | Description |
---|---|
String |
MapHeight
Height of heightmap data (always 500).
Declaration
public static int MapHeight { get; }
Property Value
Type | Description |
---|---|
Int32 |
MapWidth
Width of heightmap data (always 1000).
Declaration
public static int MapWidth { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceGetHeightMapDFBitmap()
Get extracted heightmap data as an indexed image.
Declaration
public DFBitmap GetHeightMapDFBitmap()
Returns
Type | Description |
---|---|
DFBitmap | DFBitmap object. |
GetHeightMapValue(Int32, Int32)
Gets value for specified position in heightmap. Clamps range to ensure not outside array bounds.
Declaration
public byte GetHeightMapValue(int mapPixelX, int mapPixelY)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mapPixelX | X position in heightmap. 0 to MapWidth-1. |
Int32 | mapPixelY | Y position in heightmap. 0 to MapHeight-1. |
Returns
Type | Description |
---|---|
Byte | Value of heightmap data. |
GetHeightMapValuesRange(Int32, Int32, Int32)
Gets range of small height map data.
Declaration
public byte[, ] GetHeightMapValuesRange(int mapPixelX, int mapPixelY, int dim)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mapPixelX | X position in heightmap. 0 to MapWidth-1. |
Int32 | mapPixelY | Y position in heightmap. 0 to MapHeight-1. |
Int32 | dim | Dimension of heightmap samples to read. |
Returns
Type | Description |
---|---|
Byte[,] | Byte array dim,dim in size. |
GetHeightMapValuesRange1Dim(Int32, Int32, Int32)
Gets range of small height map data.
Declaration
public byte[] GetHeightMapValuesRange1Dim(int mapPixelX, int mapPixelY, int dim)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mapPixelX | X position in heightmap. 0 to MapWidth-1. |
Int32 | mapPixelY | Y position in heightmap. 0 to MapHeight-1. |
Int32 | dim | Dimension of heightmap samples to read. |
Returns
Type | Description |
---|---|
Byte[] | Byte 1D array dim * dim in size. |
GetLargeHeightMapValuesRange(Int32, Int32, Int32)
Gets a range of large height map values with unknown grid stripped away. Also inverts Y order of height samples.
Declaration
public byte[, ] GetLargeHeightMapValuesRange(int mapPixelX, int mapPixelY, int dim)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mapPixelX | Start X position in heightmap. 0 to MapWidth-1. |
Int32 | mapPixelY | Start Y position in heightmap. 0 to MapHeight-1. |
Int32 | dim | Dimension of heightmap cells to read. |
Returns
Type | Description |
---|---|
Byte[,] | Byte array dim3,dim3 in size. |
GetLargeMapData(Int32, Int32)
Gets 5x5 large map data for given map pixel. Read exactly as found in files.
Declaration
public byte[, ] GetLargeMapData(int mapPixelX, int mapPixelY)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mapPixelX | X position in heightmap. 0 to MapWidth-1. |
Int32 | mapPixelY | Y position in heightmap. 0 to MapHeight-1. |
Returns
Type | Description |
---|---|
Byte[,] | 5x5 grid of map data. |
Load(String, FileUsage, Boolean)
Load WOODS.WLD file.
Declaration
public bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to WOODS.WLD file. |
FileUsage | usage | Specify if file will be accessed from disk, or loaded into RAM. |
Boolean | readOnly | File will be read-only if true, read-write if false. |
Returns
Type | Description |
---|---|
Boolean | True if successful, otherwise false. |