mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-13 01:33:11 +00:00
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
45 lines
1.6 KiB
C#
45 lines
1.6 KiB
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace SabreTools.Data.Models.BSP
|
|
{
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
|
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public sealed class MipTexture
|
|
{
|
|
/// <summary>
|
|
/// Name of texture
|
|
/// </summary>
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.MAXTEXTURENAME)]
|
|
public string Name = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Extends of the texture
|
|
/// </summary>
|
|
public uint Width;
|
|
|
|
/// <summary>
|
|
/// Extends of the texture
|
|
/// </summary>
|
|
public uint Height;
|
|
|
|
/// <summary>
|
|
/// Offsets to texture mipmaps BSPMIPTEX
|
|
/// </summary>
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.MIPLEVELS)]
|
|
public uint[] Offsets = new uint[Constants.MIPLEVELS];
|
|
}
|
|
}
|