private ShapeDef ReadShapeDef(SWFDataTypeReader shapeReader, Tag format, bool withStyle, IFillStyle[] fillStyles, ILineStyle[] lineStyles)
{
ShapeDef shapeDef = new ShapeDef();
/* Shapes either don't have fill styles (Font glyphs), they come with a bunch of fill styles
* (Regular shapes) or are preceeded by fill styles which are passed into this method
* (Morph shapes). Could probably be tidier... */
if (fillStyles != null)
{
shapeDef.FillStyles.AddRange(fillStyles);
}
if (lineStyles != null)
{
shapeDef.LineStyles.AddRange(lineStyles);
}
if (withStyle)
{
shapeDef.FillStyles.AddRange(this.ReadFillStyleArray(shapeReader, format));
shapeReader.Align8();
shapeDef.LineStyles.AddRange(this.ReadLineStyleArray(shapeReader, format));
shapeReader.Align8();
}
/* Read the shape stuff... */
int fillBits = (int)shapeReader.ReadUBits(4);
int lineBits = (int)shapeReader.ReadUBits(4);
this.ReadShapeRecordsInto(shapeDef, shapeReader, ref fillBits, ref lineBits, format);
return shapeDef;
}