gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10784: Don't clamp color value in MovieClip.lineStyle. Fixes pollock.swf.
Date: Mon, 13 Apr 2009 11:30:55 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10784
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Mon 2009-04-13 11:30:55 +0200
message:
  Don't clamp color value in MovieClip.lineStyle. Fixes pollock.swf.
modified:
  libcore/MovieClip.cpp
=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp     2009-04-09 11:39:48 +0000
+++ b/libcore/MovieClip.cpp     2009-04-13 09:30:55 +0000
@@ -4517,7 +4517,19 @@
         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. None of the existing testcases
+                // change results based on this, which calls to adding
+                // a new test. Probably DrawingApiTest.as would be a good
+                // place for that.
+                fn.arg(1).to_number()
+                //clamp<float>(fn.arg(1).to_number(), 0, 16777216)
+            );
             r = boost::uint8_t((rgbval & 0xFF0000) >> 16);
             g = boost::uint8_t((rgbval & 0x00FF00) >> 8);
             b = boost::uint8_t((rgbval & 0x0000FF) );


reply via email to

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