gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/trunk r10784: Don't clamp color value


From: Sandro Santilli
Subject: Re: [Gnash-commit] /srv/bzr/gnash/trunk r10784: Don't clamp color value in MovieClip.lineStyle. Fixes pollock.swf.
Date: Tue, 14 Apr 2009 10:28:53 +0200

On Mon, Apr 13, 2009 at 12:47:45PM +0200, Benjamin Wolsey wrote:
> Am Montag, den 13.04.2009, 12:22 +0200 schrieb Benjamin Wolsey:
> > >          case 2:
> > >          {
> > >              boost::uint32_t rgbval = boost::uint32_t(
> > > -                clamp<float>(fn.arg(1).to_number(), 0, 16777216));
> > > +                // See pollock.swf:
> > > +                // it gets too many black colors with the clamp;
> > > +                // it sets color to a random number from
> > > +                // 0 to 160000000 (about 10 times more then the max).
> > > +                // I guess the correct behaviour is a different
> > > handling
> > > +                // of the overflow. Letting the compiler decide on
> > > that
> > > +                // gives better results.
> 
> In fact, to_int() instead of to_number() might work here, as it also
> truncates; probably depends what's supposed to happen with the alpha
> byte.

I don't think we want to truncate, or we'd mostly get white values.
Here's the movie: http://foo.keybit.net/~strk/tmp/pollock.swf
Click to change color (random between 0 to 160000000, where the max
would be 1/10 of that upper bound).

Could be the interpretation fo that number depends on SWF version,
anyway DrawingApiTest never uses overflowing values, it should for
a closer test.

--strk; 

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]