Class Arch3dFile
Connects to ARCH3D.BSA to enumerate and extract 3D mesh data.
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class Arch3dFile
Constructors
| Improve this Doc View SourceArch3dFile()
Default constructor.
Declaration
public Arch3dFile()
Arch3dFile(String, FileUsage, Boolean)
Load constructor.
Declaration
public Arch3dFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to ARCH3D.BSA file. |
FileUsage | usage | Determines if the BSA file will read from disk or memory. |
Boolean | readOnly | File will be read-only if true, read-write if false. |
Properties
| Improve this Doc View SourceAutoDiscard
If true then decomposed mesh records will be destroyed every time a different record is fetched. If false then decomposed mesh records will be maintained until discardRecord() or discardAllRecords() is called. Turning off auto-discard will speed up mesh retrieval times at the expense of RAM. For best results, disable auto-discard and impose your own caching scheme using LoadRecord() and DiscardRecord() based on your application's needs.
Declaration
public bool AutoDiscard { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Count
Number of BSA records in ARCH3D.BSA.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Filename
Gets default ARCH3D.BSA filename.
Declaration
public static string Filename { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceBenchmark()
Benchmark mesh decomposition time. Forces on auto-discard behaviour and discards all existing records before starting.
Declaration
public int Benchmark()
Returns
Type | Description |
---|---|
Int32 | Time to decompose Count meshes in milliseconds. |
DiscardAllRecords()
Discard all mesh records.
Declaration
public void DiscardAllRecords()
DiscardRecord(Int32)
Discard a mesh record from memory.
Declaration
public void DiscardRecord(int record)
Parameters
Type | Name | Description |
---|---|---|
Int32 | record | Index of record to discard. |
GetMesh(Int32)
Get a DFMesh representation of a record.
Declaration
public DFMesh GetMesh(int record)
Parameters
Type | Name | Description |
---|---|---|
Int32 | record | Index of record to load. |
Returns
Type | Description |
---|---|
DFMesh | DFMesh object. |
GetRecordId(Int32)
Gets ID of record from index.
Declaration
public uint GetRecordId(int record)
Parameters
Type | Name | Description |
---|---|---|
Int32 | record | Index of record. |
Returns
Type | Description |
---|---|
UInt32 | ID of mesh. |
GetRecordIndex(UInt32)
Gets index of mesh record with specified id. Does not change the currently loaded record. Uses a dictionary to map ID to index so this method will be faster on subsequent calls.
Declaration
public int GetRecordIndex(uint id)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | id | ID of mesh. |
Returns
Type | Description |
---|---|
Int32 | Index of found mesh, or -1 if not found. |
Load(String, FileUsage, Boolean)
Load ARCH3D.BSA file.
Declaration
public bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to ARCH3D.BSA 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. |
LoadRecord(Int32)
Load a mesh record into memory and decompose it for use.
Declaration
public bool LoadRecord(int record)
Parameters
Type | Name | Description |
---|---|---|
Int32 | record | Index of record to load. |
Returns
Type | Description |
---|---|
Boolean | True if successful, otherwise false. |