void SWFShape_setLineStyle(SWFShape shape, unsigned short width, byte r, byte g, byte b, byte a) { ShapeRecord record; int line; if ( shape->isEnded ) return; for ( line=0; line<*shape->nLines; ++line ) { if ( SWFLineStyle_equals((*shape->lines)[line], width, r, g, b, a) ) break; } if ( line == *shape->nLines ) line = SWFShape_addLineStyle(shape, width, r, g, b, a); else ++line; if ( width == 0 ) shape->lineWidth = 0; else shape->lineWidth = (SWFLineStyle_getWidth((*shape->lines)[line-1]) + 1) / 2; if ( shape->isMorph ) return; record = addStyleRecord(shape); record.record.stateChange->line = line; record.record.stateChange->flags |= SWF_SHAPE_LINESTYLEFLAG; }
static void finishSetLine(SWFShape shape, int line, unsigned short width) { ShapeRecord record; if ( width == 0 ) shape->lineWidth = 0; else shape->lineWidth = (SWFLineStyle_getWidth(shape->lines[line-1]) + 1) / 2; if ( shape->isMorph ) return; record = addStyleRecord(shape); record.record.stateChange->line = line; record.record.stateChange->flags |= SWF_SHAPE_LINESTYLEFLAG; }