This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 160418daeade414c89509ac9c3845d9df4708261
Author: David Capello <[email protected]>
Date:   Fri May 6 09:09:47 2016 -0300

    Fix pasting screenshots/clipboard content in 32bpp on Windows
---
 src/app/util/clipboard_native.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/app/util/clipboard_native.cpp 
b/src/app/util/clipboard_native.cpp
index dcdf6f5..660a1a8 100644
--- a/src/app/util/clipboard_native.cpp
+++ b/src/app/util/clipboard_native.cpp
@@ -233,11 +233,19 @@ bool get_native_clipboard_bitmap(doc::Image** image,
         const uint32_t* src = (const 
uint32_t*)(img.data()+spec.bytes_per_row*y);
         for (unsigned long x=0; x<spec.width; ++x, ++it, ++src) {
           const uint32_t c = *((const uint32_t*)src);
+
+          // On Windows, 32bpp images are used for performance only,
+          // the alpha mask is always zero (which means that the image
+          // is only RGB, without alpha information).
+          int alpha =
+            (spec.alpha_mask ?
+             uint8_t((c & spec.alpha_mask) >> spec.alpha_shift): 255);
+
           *it = doc::rgba(
             uint8_t((c & spec.red_mask  ) >> spec.red_shift  ),
             uint8_t((c & spec.green_mask) >> spec.green_shift),
             uint8_t((c & spec.blue_mask ) >> spec.blue_shift ),
-            uint8_t((c & spec.alpha_mask) >> spec.alpha_shift));
+            alpha);
         }
       }
       break;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/aseprite.git

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to