Show / Hide Table of Contents

Class TextureFile

Connects to a TEXTURE.??? file to enumerate and extract image data. Each texture file may contain one or more images, including animated records with multiple frames. Textures will only be converted from the source binary file when needed. This allows you to extract individual records and frames without the overhead of converting unwanted images. Combine this with a texture caching scheme when loading large 3D scenes to avoid unnecessary load time.

Inheritance
Object
BaseImageFile
TextureFile
Inherited Members
BaseImageFile.myPalette
BaseImageFile.FilePath
BaseImageFile.FileName
BaseImageFile.Palette
BaseImageFile.LoadPalette(String)
BaseImageFile.GetColor32(Int32, Int32, Int32)
BaseImageFile.GetColor32(DFBitmap, Int32)
BaseImageFile.GetColor32(Int32, Int32, Int32, Int32, DFSize)
BaseImageFile.GetColor32(DFBitmap, Int32, Int32, DFSize, Int32, Int32)
BaseImageFile.GetWindowColors32(DFBitmap, Int32)
BaseImageFile.GetSpectralEmissionColors32(DFBitmap, Color32[], Int32, Int32, Color, Color)
BaseImageFile.GetFireWallColors32(Color32[], Int32, Int32, Color, Single)
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class TextureFile : BaseImageFile

Constructors

| Improve this Doc View Source

TextureFile()

Default constructor.

Declaration
public TextureFile()
| Improve this Doc View Source

TextureFile(String, FileUsage, DFPalette, Boolean)

Load constructor with palette assignment.

Declaration
public TextureFile(string filePath, FileUsage usage, DFPalette palette, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to TEXTURE.* file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

DFPalette palette

Palette to use when building images.

Boolean readOnly

File will be read-only if true, read-write if false.

| Improve this Doc View Source

TextureFile(String, FileUsage, Boolean)

Load constructor.

Declaration
public TextureFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to TEXTURE.* 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.

| Improve this Doc View Source

TextureFile(String, FileUsage, String, Boolean)

Load constructor that also loads a palette.

Declaration
public TextureFile(string filePath, FileUsage usage, string paletteFilePath, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to TEXTURE.* file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

String paletteFilePath

Absolute path to Daggerfall palette file.

Boolean readOnly

File will be read-only if true, read-write if false.

Properties

| Improve this Doc View Source

Description

Gets description of texture file.

Declaration
public override string Description { get; }
Property Value
Type Description
String
Overrides
BaseImageFile.Description
| Improve this Doc View Source

PaletteName

Gets correct palette name for this file (always ART_PAL.COL for texture files).

Declaration
public override string PaletteName { get; }
Property Value
Type Description
String
Overrides
BaseImageFile.PaletteName
| Improve this Doc View Source

RecordCount

Number of image records in this file.

Declaration
public override int RecordCount { get; }
Property Value
Type Description
Int32
Overrides
BaseImageFile.RecordCount
| Improve this Doc View Source

SolidType

Gets texture solid type for flat-colour textures.

Declaration
public TextureFile.SolidTypes SolidType { get; }
Property Value
Type Description
TextureFile.SolidTypes
| Improve this Doc View Source

UnsupportedFilenames

Gets unsupported filenames. The three texture filenames returned have no image data or are otherwise invalid.

Declaration
public static string[] UnsupportedFilenames { get; }
Property Value
Type Description
String[]

Array of unsupported filenames.

Methods

| Improve this Doc View Source

GetDFBitmap(Int32, Int32)

Gets bitmap data as indexed 8-bit byte array for specified record and frame.

Declaration
public override DFBitmap GetDFBitmap(int record, int frame)
Parameters
Type Name Description
Int32 record

Index of record.

Int32 frame

Index of frame.

Returns
Type Description
DFBitmap

DFBitmap object.

Overrides
BaseImageFile.GetDFBitmap(Int32, Int32)
| Improve this Doc View Source

GetFrameCount(Int32)

Gets number of frames in specified record.

Declaration
public override int GetFrameCount(int record)
Parameters
Type Name Description
Int32 record

Index of record.

Returns
Type Description
Int32

Number of frames.

Overrides
BaseImageFile.GetFrameCount(Int32)
| Improve this Doc View Source

GetHeight(Int32)

Gets the height of this image.

Declaration
public int GetHeight(int record)
Parameters
Type Name Description
Int32 record

Index of record.

Returns
Type Description
Int32

Height of image in pixels.

| Improve this Doc View Source

GetOffset(Int32)

Gets the offset value of record.

Declaration
public DFPosition GetOffset(int record)
Parameters
Type Name Description
Int32 record

Index of record.

Returns
Type Description
DFPosition

Offset values for X and Y in DFSize object.

| Improve this Doc View Source

GetScale(Int32)

Get the width and height scale to apply to image in scene. These values are divided by 256 to obtain a value between -1.0 - 0.0, and presumably 0.0 - 1.0. This is the scale of pixels for enlarging or shrinking the image.

Declaration
public DFSize GetScale(int record)
Parameters
Type Name Description
Int32 record

Index of record.

Returns
Type Description
DFSize

Scale values for X and Y in DFSize object.

| Improve this Doc View Source

GetSize(Int32)

Gets width and height of specified record. All frames of this record are the same dimensions.

Declaration
public override DFSize GetSize(int record)
Parameters
Type Name Description
Int32 record

Index of record.

Returns
Type Description
DFSize

DFSize object.

Overrides
BaseImageFile.GetSize(Int32)
| Improve this Doc View Source

GetWidth(Int32)

Gets width of this image.

Declaration
public int GetWidth(int record)
Parameters
Type Name Description
Int32 record

Index of record.

Returns
Type Description
Int32

Width of image in pixels.

| Improve this Doc View Source

IndexToFileName(Int32)

Returns a TEXTURE.nnn filename based on index. This is needed when loading textures for 3D objects that reference textures by index rather than filename. If the index is not valid, the returned filename will also be invalid.

Declaration
public static string IndexToFileName(int archiveIndex)
Parameters
Type Name Description
Int32 archiveIndex

Index of texture archive.

Returns
Type Description
String

Texture filename in the format TEXTURE.nnn.

| Improve this Doc View Source

IsFilenameSupported(String)

Tests if a filename is supported.

Declaration
public bool IsFilenameSupported(string filename)
Parameters
Type Name Description
String filename

Name of TEXTURE.* file.

Returns
Type Description
Boolean

True if supported, otherwise false.

| Improve this Doc View Source

IsSpectralArchive(Int32)

Check if archive is of a known spectral texture.

Declaration
public static bool IsSpectralArchive(int archive)
Parameters
Type Name Description
Int32 archive

Archive index.

Returns
Type Description
Boolean

True if archive is a spectral type.

| Improve this Doc View Source

Load(String, FileUsage, Boolean)

Loads a texture file.

Declaration
public override bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to TEXTURE.* 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.

Overrides
BaseImageFile.Load(String, FileUsage, Boolean)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX