private void FromFile_Textures(Kn5Reader reader, [NotNull] IKn5TextureLoader textureLoader)
{
try {
var count = reader.ReadInt32();
Textures = new Dictionary <string, Kn5Texture>(count);
TexturesData = new Dictionary <string, byte[]>(count);
for (var i = 0; i < count; i++)
{
var texture = reader.ReadTexture();
if (texture.Length > 0)
{
Textures[texture.Name] = texture;
TexturesData[texture.Name] = textureLoader.LoadTexture(texture.Name, reader.BaseStream, texture.Length) ?? new byte[0];
}
}
} catch (NotImplementedException) {
Textures = null;
TexturesData = null;
}
}