=?UTF-8?Q?Rico=20Sch=C3=BCller=20?=: d3dx9: Use all 32 bits as mask.

Alexandre Julliard julliard at winehq.org
Thu Jan 10 13:36:13 CST 2013


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

Author: Rico Schüller <kgbricola at web.de>
Date:   Thu Jan 10 17:57:40 2013 +0100

d3dx9: Use all 32 bits as mask.

---

 dlls/d3dx9_36/texture.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index c93d2df..a6e769b 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -1216,7 +1216,7 @@ static inline void fill_texture(const struct pixel_format_desc *format, BYTE *po
     for (c = 0; c < 4; c++)
     {
         float comp_value;
-        DWORD i, v;
+        DWORD i, v, mask32 = format->bits[c] == 32 ? ~0U : ((1 << format->bits[c]) - 1);
 
         switch (c)
         {
@@ -1242,12 +1242,12 @@ static inline void fill_texture(const struct pixel_format_desc *format, BYTE *po
 
             if (format->shift[c] > i)
             {
-                mask = ((1 << format->bits[c]) - 1) << (format->shift[c] - i);
+                mask = mask32 << (format->shift[c] - i);
                 byte = (v << (format->shift[c] - i)) & mask;
             }
             else
             {
-                mask = ((1 << format->bits[c]) - 1) >> (i - format->shift[c]);
+                mask = mask32 >> (i - format->shift[c]);
                 byte = (v >> (i - format->shift[c])) & mask;
             }
             pos[i / 8] |= byte;




More information about the wine-cvs mailing list