// LWOB static IEnumerable<Polygon> ReadPolygons5(ChunkReader reader, uint vertex_offset) { // fill in the new polygons while (reader.BytesLeft > 0) { var vertex_count = reader.ReadUInt16(); var newPolygon = new Polygon(PolygonType.ID_FACE); for (var j = 0; j < vertex_count; j++) newPolygon.Vertices.Add( new PolygonVertex(reader.ReadUInt16() + vertex_offset) ); var index = (int)reader.ReadSInt16(); if (index < 0) { index = (int)-index; reader.ReadSInt16(); // skip 2 bytes - Q: why?? } newPolygon.surf_index = (uint)(index - 1); yield return newPolygon; } }