[Top][All Lists]
[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:34:15 +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 just tried to_int() and indeed works fine. No idea why, but I'm happy
with that.
--strk;
Free GIS & Flash consultant/developer () ASCII Ribbon Campaign
http://foo.keybit.net/~strk/services.html /\ Keep it simple!