Stefan Dösinger : wined3d: Fix data types in RxGx snorm-unorm conversion.

Alexandre Julliard julliard at winehq.org
Mon May 16 11:36:49 CDT 2011


Module: wine
Branch: master
Commit: 1d7a05cb80462ebd818613fb7aa983d4a9f4d557
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1d7a05cb80462ebd818613fb7aa983d4a9f4d557

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu May 12 21:17:31 2011 +0200

wined3d: Fix data types in RxGx snorm-unorm conversion.

---

 dlls/wined3d/utils.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 0df2c9e..20b6001 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -346,10 +346,10 @@ static void convert_r8g8_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT widt
         Dest = dst + y * outpitch;
         for (x = 0; x < width; x++ )
         {
-            LONG color = (*Source++);
+            const short color = (*Source++);
             /* B */ Dest[0] = 0xff;
             /* G */ Dest[1] = (color >> 8) + 128; /* V */
-            /* R */ Dest[2] = (color) + 128;      /* U */
+            /* R */ Dest[2] = (color & 0xff) + 128;      /* U */
             Dest += 3;
         }
     }
@@ -440,10 +440,10 @@ static void convert_r16g16_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT wi
         Dest = (unsigned short *) (dst + y * outpitch);
         for (x = 0; x < width; x++ )
         {
-            DWORD color = (*Source++);
+            const DWORD color = (*Source++);
             /* B */ Dest[0] = 0xffff;
             /* G */ Dest[1] = (color >> 16) + 32768; /* V */
-            /* R */ Dest[2] = (color      ) + 32768; /* U */
+            /* R */ Dest[2] = (color & 0xffff) + 32768; /* U */
             Dest += 3;
         }
     }




More information about the wine-cvs mailing list