changeset 69333:d42b2aec70a4

[MAC_OS] (XPutPixel): Set alpha channel bits if pixmap depth is 32. [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap depth is 32.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Wed, 08 Mar 2006 03:25:04 +0000
parents e1685cc1a657
children f6d157f96950
files src/image.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/image.c	Wed Mar 08 02:24:47 2006 +0000
+++ b/src/image.c	Wed Mar 08 03:25:04 2006 +0000
@@ -194,7 +194,7 @@
       char *base_addr = GetPixBaseAddr (pixmap);
       short row_bytes = GetPixRowBytes (pixmap);
 
-      ((unsigned long *) (base_addr + y * row_bytes))[x] = pixel;
+      ((unsigned long *) (base_addr + y * row_bytes))[x] = 0xff000000 | pixel;
     }
   else if (depth == 1)
     {
@@ -238,7 +238,7 @@
       char *base_addr = GetPixBaseAddr (pixmap);
       short row_bytes = GetPixRowBytes (pixmap);
 
-      return ((unsigned long *) (base_addr + y * row_bytes))[x];
+      return ((unsigned long *) (base_addr + y * row_bytes))[x] & 0x00ffffff;
     }
   else if (depth == 1)
     {