private ESOHeader(Stream stream) { using (var br = new BinaryReader(stream, Encoding.Unicode, true)) { m_V01 = br.ReadInt32(); m_V02 = br.ReadInt32(); m_NodeChild = AssetHash.FromStream(stream); m_NodeSibling = AssetHash.FromStream(stream); m_V07 = br.ReadInt32(); m_V08 = br.ReadInt32(); m_V09 = br.ReadInt32(); m_ScaleXYZ = br.ReadSingle(); m_Translate = Vec3.FromStream(stream); m_Rotate = Vec3.FromStream(stream); m_Scale = Vec3.FromStream(stream); m_V20 = br.ReadSingle(); m_V21 = br.ReadInt32(); m_NumModels = br.ReadInt32(); if (m_NumModels > 0) { m_BoundingMin = Vec3.FromStream(stream); m_BoundingMax = Vec3.FromStream(stream); } else { m_BoundingMin = new Vec3(); m_BoundingMax = new Vec3(); } } }
private EMATexture(Stream stream) { using (var br = new BinaryReader(stream, Encoding.Unicode, true)) { m_Asset = AssetHash.FromStream(stream); m_IntArray1 = new int[INT_ARRAY_1_LENGTH]; for (int i = 0; i < INT_ARRAY_1_LENGTH; i++) { m_IntArray1[i] = br.ReadInt32(); } m_IntArray2 = new int[INT_ARRAY_2_LENGTH]; for (int i = 0; i < INT_ARRAY_2_LENGTH; i++) { m_IntArray2[i] = br.ReadInt32(); } } }
private EANHeader(Stream stream) { using (var br = new BinaryReader(stream, Encoding.Unicode, true)) { m_Unknown1 = br.ReadSingle(); m_Duration = br.ReadSingle(); m_Zero1 = br.ReadUInt32(); if (m_Zero1 != 0) { Warning.WriteLine("ean_file_t::zero1 not 0!"); } m_Zero2 = br.ReadUInt32(); if (m_Zero2 != 0) { Warning.WriteLine("ean_file_t::zero2 not 0!"); } m_NodeChild = AssetHash.FromStream(stream); m_NodeSibling = AssetHash.FromStream(stream); } }
public EMATexture() { m_Asset = AssetHash.Zero; m_IntArray1 = new int[INT_ARRAY_1_LENGTH]; m_IntArray2 = new int[INT_ARRAY_2_LENGTH]; }
private ESOModel(Stream stream) { using (var br = new BinaryReader(stream, Encoding.Unicode, true)) { m_MaterialAsset = AssetHash.FromStream(stream); m_TypeFlags = (Flags)br.ReadUInt32(); int numVerts = br.ReadInt32(); Initialize(m_TypeFlags, numVerts); if (br.ReadInt32() * 3 != numVerts) { Warning.WriteLine("Polygon count is not correct! It will be ignored."); } int unknown = br.ReadInt32(); // not a clue. seems to be always zero. if (unknown != 0) { Warning.WriteLine("eso_model_t::unknown1 != 0"); } for (var i = 0; i < numVerts; i++) { m_Vertices.Add(Vec3.FromStream(stream)); } if (HasNormals) { for (var i = 0; i < numVerts; i++) { m_Normals.Add(Vec3.FromStream(stream)); } } if (HasColors) { for (int i = 0; i < numVerts; i++) { m_Colors.Add(Color.FromArgb(br.ReadInt32())); } } if (HasTexCoords) { for (int i = 0; i < numVerts; i++) { m_TexCoords.Add(Vec2.FromStream(stream)); } } if (HasTexCoords2) { for (int i = 0; i < numVerts; i++) { mTexCoords2.Add(Vec2.FromStream(stream)); } } // m_Indices = new ushort[m_NumPolys * 3]; for (int i = 0; i < numVerts; i++) { if (br.ReadUInt16() != i) { Warning.WriteLine("eso_model_t::indices not supported!"); } } } }