private void Parse(Stream contents) { BinaryReader br = new BinaryReader(contents); Header = new BitmapChunk(); Header.EnableTextureAttachments = true; Header.SkipHeader(br); Header.Read(br); br.Close(); }
private void Parse(Stream contents) { BinaryReader br = new BinaryReader(contents); Header = new BitmapChunk(); Header.EnableTextureAttachments = true; Header.SkipHeader(br); Header.Read(br); br.Close(); }
private void ReadChunk(BinaryReader reader, bool readHeaderOnly) { string identifier = new string(reader.ReadChars(4)); if (identifier == "ORIP") { MeshChunk meshChunk = new MeshChunk(); if (readHeaderOnly) { meshChunk.Offset = reader.BaseStream.Position; } else { meshChunk.Read(reader); } _meshChunks.Add(meshChunk); } else if (identifier == "SHPI") { BitmapChunk bitmapChunk = new BitmapChunk(); bitmapChunk.Index = _index++; if (readHeaderOnly) { bitmapChunk.Offset = reader.BaseStream.Position; } else { bitmapChunk.Read(reader); } _bitmapChunks.Add(bitmapChunk); } else if (identifier == "wwww") { HeaderChunk header = new HeaderChunk(); if (readHeaderOnly) { header.Offset = reader.BaseStream.Position; } else { header.Read(reader, false, false); } _headerChunks.Add(header); } else { throw new NotImplementedException(); } }
private void ReadChunk(BinaryReader reader, bool readHeaderOnly) { string identifier = new string(reader.ReadChars(4)); if (identifier == "ORIP") { MeshChunk meshChunk = new MeshChunk(); if (readHeaderOnly) meshChunk.Offset = reader.BaseStream.Position; else { meshChunk.Read(reader); } _meshChunks.Add(meshChunk); } else if (identifier == "SHPI") { BitmapChunk bitmapChunk = new BitmapChunk(); bitmapChunk.Index = _index++; if (readHeaderOnly) bitmapChunk.Offset = reader.BaseStream.Position; else bitmapChunk.Read(reader); _bitmapChunks.Add(bitmapChunk); } else if (identifier == "wwww") { HeaderChunk header = new HeaderChunk(); if (readHeaderOnly) header.Offset = reader.BaseStream.Position; else header.Read(reader, false, false); _headerChunks.Add(header); } else { throw new NotImplementedException(); } }