Hello Roxlu, I wrote a patch that should fix your gradient problem. I still noticed a bug while using it, but I think it was caused by the new svg code, I'll have to look into this later.
This patch also replaces a old patch I wrote some time ago, called filters.patch, so make sure this isn't applied when you or someone else wants to try it. Ralf PS: I've asked Dan for SVN access, so I hope there will be an updated SVN version soon. > Hello Roxlu, > I noticed that there is a error in the handling of gradients while I was > writing my svg patch. But I didn't have time to fix it yet and I wasn't > sure if the error is inside the swf read or write code (or both). > Which type of gradient did you use? I only experienced a error while > using a stroke with a gradient and not a fill gradient. > Did you create the gradient in the original Flash IDE? If you did, it > would be good if you can send me this file, because I need a correct > reference swf to locate the error and I'm not sure if my swfs containing > gradients made with swfmill are 100% correct. > > Ralf > > > Hi everyone! > > > > I'm using FlashDevelop which uses swfmill to create the swf files. > > Though when I create a gradient in > > Flash I get an error like: > > > > swfmill WARNING: end of tag DefineShape is @, should be @ > > > > > > Does someone knows if there is a fix for this? If not where in the code > > of swfmill do I need to look to fix it myself? > > > > Gr. Roxlu
Index: src/codegen/source.xml =================================================================== --- src/codegen/source.xml (Revision 218) +++ src/codegen/source.xml (Arbeitskopie) @@ -96,7 +96,7 @@ </if> <if expression="hasFill"> - <list name="fillStyles" type="Style" end-condition="true" prop="true"/> + <list name="fillStyles" type="Style" length="1" constant-length="true" prop="true"/> </if> <if expression="!hasFill"> <object type="Color" name="fillColor" prop="true"/> @@ -541,7 +541,7 @@ <byte name="matrixY" prop="true"/> <float name="divizor" prop="true"/> <float name="bias" prop="true"/> - <list type="Float" name="matrix" prop="true" end-condition="matrix.size() == matrixX * matrixY"/> + <list type="Float" name="matrix" prop="true" length="(matrixX * matrixY)" constant-length="true"/> <object type="Color" name="defaultColor" prop="true"/> <integer name="reserved" size="5" constant-size="true"/> <bit name="clamp" prop="true"/> @@ -549,7 +549,7 @@ </filter> <filter name="ColorMatrix" id="0x06"> - <list type="Float" name="matrix" prop="true" end-condition="(matrix.size()==20)"/> + <list type="Float" name="matrix" prop="true" length="20" constant-length="true"/> </filter> <filter name="GradientBevel" id="0x07"> @@ -578,19 +578,40 @@ <style name="LinearGradient" id="0x10"> <object type="Transform" name="matrix" prop="true"/> - <byte name="count"/> + <if expression="ctx->tagVersion < 4"> + <integer name="reserved" size="4" constant-size="true" prop="true"/> + </if> + <if expression="ctx->tagVersion >= 4"> + <integer name="spreadMode" size="2" constant-size="true" prop="true"/> + <integer name="interpolationMode" size="2" constant-size="true" prop="true"/> + </if> + <integer name="count" size="4" constant-size="true"/> <list type="GradientItem" name="gradientColors" length="count" prop="true"/> </style> <style name="RadialGradient" id="0x12"> <object type="Transform" name="matrix" prop="true"/> - <byte name="count"/> + <if expression="ctx->tagVersion < 4"> + <integer name="reserved" size="4" constant-size="true" prop="true"/> + </if> + <if expression="ctx->tagVersion >= 4"> + <integer name="spreadMode" size="2" constant-size="true" prop="true"/> + <integer name="interpolationMode" size="2" constant-size="true" prop="true"/> + </if> + <integer name="count" size="4" constant-size="true"/> <list type="GradientItem" name="gradientColors" length="count" prop="true"/> </style> <style name="ShiftedRadialGradient" id="0x13"> <object type="Transform" name="matrix" prop="true"/> - <byte name="count"/> + <if expression="ctx->tagVersion < 4"> + <integer name="reserved" size="4" constant-size="true" prop="true"/> + </if> + <if expression="ctx->tagVersion >= 4"> + <integer name="spreadMode" size="2" constant-size="true" prop="true"/> + <integer name="interpolationMode" size="2" constant-size="true" prop="true"/> + </if> + <integer name="count" size="4" constant-size="true"/> <list type="GradientItem" name="gradientColors" length="count" prop="true"/> <word name="shift" prop="true"/> </style> Index: src/codegen/parsexml.xsl =================================================================== --- src/codegen/parsexml.xsl (Revision 218) +++ src/codegen/parsexml.xsl (Arbeitskopie) @@ -200,7 +200,7 @@ node2 = node->children; while( node2 ) { if( !strcmp( (const char *)node2->name, "<xsl:value-of select="@name"/>" ) ) { - <xsl:if test="@length"> + <xsl:if test="@length and not(@constant-length)"> <xsl:value-of select="@length"/>=0; </xsl:if> @@ -211,7 +211,7 @@ if( item ) { item->parseXML( child, ctx ); <xsl:value-of select="@name"/>.append( item ); - <xsl:if test="@length"> + <xsl:if test="@length and not(@constant-length)"> <xsl:value-of select="@length"/>++; </xsl:if> } Index: src/codegen/dumper.xsl =================================================================== --- src/codegen/dumper.xsl (Revision 218) +++ src/codegen/dumper.xsl (Arbeitskopie) @@ -102,4 +102,8 @@ <xsl:template match="bytealign|context" mode="dump"/> +<xsl:template match="context" mode="dump-wrap"> + ctx-><xsl:value-of select="@param"/> = <xsl:value-of select="@value"/>; +</xsl:template> + </xsl:stylesheet>
_______________________________________________ swfmill mailing list swfmill@osflash.org http://osflash.org/mailman/listinfo/swfmill_osflash.org