SanAndreasUnity/Assets/Scripts/Importing/RenderWareStream/TextureDictionary.cs
2020-05-31 19:07:22 +02:00

28 lines
No EOL
757 B
C#

using System;
using System.IO;
namespace SanAndreasUnity.Importing.RenderWareStream
{
[SectionType(22)]
public class TextureDictionary : SectionData
{
public UInt16 TextureCount;
public TextureNative[] Textures;
public TextureDictionary(SectionHeader header, Stream stream)
: base(header, stream)
{
SectionHeader.Read(stream);
var reader = new BinaryReader(stream);
TextureCount = reader.ReadUInt16();
Textures = new TextureNative[TextureCount];
reader.ReadUInt16(); // Unknown
for (var i = 0; i < TextureCount; ++i)
{
Textures[i] = ReadSection<TextureNative>();
}
}
}
}