using System.Runtime.InteropServices;
namespace SabreTools.Data.Models.BSP
{
///
/// Each of this structs describes a texture. The name of the
/// texture is a string and may be 16 characters long (including
/// the null-character at the end, char equals a 8bit signed
/// integer). The name of the texture is needed, if the texture
/// has to be found and loaded from an external WAD file.
/// Furthermore, the struct contains the width and height of
/// the texture. The 4 offsets at the end can either be zero,
/// if the texture is stored in an external WAD file, or point
/// to the beginnings of the binary texture data within the
/// texture lump relative to the beginning of it's BSPMIPTEX struct.
///
///
///
[StructLayout(LayoutKind.Sequential)]
public sealed class MipTexture
{
///
/// Name of texture
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.MAXTEXTURENAME)]
public string Name = string.Empty;
///
/// Extends of the texture
///
public uint Width;
///
/// Extends of the texture
///
public uint Height;
///
/// Offsets to texture mipmaps BSPMIPTEX
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.MIPLEVELS)]
public uint[] Offsets = new uint[Constants.MIPLEVELS];
}
}