Re: [swfmill] Bitmap filter effects on buttons

2007-04-11 Thread Ralf Fuest
Hello,
there was an error in the parsing code for color filters, it should work
after the attached patch is applied. And your decision to send in the
file is right, because nobody can fix a bug that isn't known.

More technical stuff:
The end-condition for reading the ColorMatrix was wrong, so 21 instead
of 20 floats were read and that screwed up everything after the matrix.
I decided to add a size attribute to the list tag to make the source.xml
file look less confusing. size==19 for an list with 20 elements doesn't
look right ;). The Convolution filter also uses such a matrix and had a
similar end-condition, so i changed this attribute to an size attribute.
I couldn't check if this works because i don't have flash or an swf file
that contains this filter, but i think so.

Ralf

 Thanks!  I tried out 0.2.12.4 and it works for many of my buttons, but
 I found one which it doesn't like.  I've attached a sample swf and
 fla, and the output from the parsing.  The difference is that this
 button has an adjust color filter on it.  
 
 I can probably work around this, but I thought I'd send it along.
 Maybe it's another quick fix.
 
 Thanks again.
 
 --Brian
Index: src/codegen/source.xml
===
--- src/codegen/source.xml	(revision 216)
+++ src/codegen/source.xml	(working copy)
@@ -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 size=matrixX * matrixY/
 	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 size=20/
 /filter
 
 filter name=GradientBevel id=0x07
Index: src/codegen/parser.xsl
===
--- src/codegen/parser.xsl	(revision 216)
+++ src/codegen/parser.xsl	(working copy)
@@ -149,6 +149,12 @@
 		item = NULL;
 	}
 /xsl:if
+xsl:if test=@size
+	if(item amp;amp; (xsl:value-of select=@name/.size() == xsl:value-of select=@size/ - 1)) {
+		xsl:value-of select=@name/.append( item );
+		item = NULL;
+	}
+/xsl:if
 			}
 		}
 	}
___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Bitmap filter effects on buttons

2007-04-10 Thread Ralf Fuest
Hello Brian,
the current swfmill version doesn't support filters and blend modes for
buttons. I've written a patch to add support for this features.
Converting your sample swf to xml and back again worked.

When you want to compile it yourself you'll need an SVN version of the
source code, to get the codegen directory.

Ralf
Index: src/codegen/source.xml
===
--- src/codegen/source.xml	(revision 209)
+++ src/codegen/source.xml	(working copy)
@@ -358,7 +358,14 @@
 
 
 type name=Button
-	integer name=reserved size=4 constant-size=true/
+	integer name=reserved1 size=2 constant-size=true/
+	if expression=ctx-swfVersion lt; 8
+		integer name=reserved2 size=2 constant-size=true/
+	/if
+	if expression=ctx-swfVersion = 8
+		bit name=hasBlendMode/
+		bit name=hasFilterList/
+	/if
 	bit name=hitTest prop=true/
 	bit name=down prop=true/
 	bit name=over prop=true/
@@ -370,6 +377,13 @@
 		if expression=ctx-tagVersion gt;= 2
 			object type=ColorTransform2 name=colorTransform prop=true/
 		/if
+		flagged flag=hasFilterList
+byte name=numFilters/
+list type=Filter name=filters length=numFilters prop=true/
+		/flagged
+		flagged flag=hasBlendMode
+			byte name=blendMode prop=true default=0/
+		/flagged
 	/if
 /type
 
___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Bitmap filter effects on buttons

2007-04-10 Thread daniel fischer
Ralf Fuest [EMAIL PROTECTED] (on Tue, 10 Apr 2007 22:31:27 +0200):

   the current swfmill version doesn't support filters and blend modes for
   buttons. I've written a patch to add support for this features.

great, thanks! it's in 0.2.12.4.

got any more of these up your sleeve?

-dan


-- 
http://0xDF.com/
http://iterative.org/

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org