[ros-diffs] [jimtabor] 28501: Fix math and add notes.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Fri Aug 24 00:29:37 CEST 2007


Author: jimtabor
Date: Fri Aug 24 02:29:37 2007
New Revision: 28501

URL: http://svn.reactos.org/svn/reactos?rev=28501&view=rev
Log:
Fix math and add notes.

Modified:
    trunk/reactos/dll/win32/gdi32/objects/bitmap.c

Modified: trunk/reactos/dll/win32/gdi32/objects/bitmap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/bitmap.c?rev=28501&r1=28500&r2=28501&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/bitmap.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/bitmap.c Fri Aug 24 02:29:37 2007
@@ -3,7 +3,7 @@
 /*
  * Return the full scan size for a bitmap.
  * 
- * Based on Wine and Windows Graphics Prog pg 595
+ * Based on Wine, Utils.c and Windows Graphics Prog pg 595
  */
 UINT
 FASTCALL
@@ -20,10 +20,10 @@
     {
        if ((Info->bmiHeader.biCompression) && (Info->bmiHeader.biCompression != BI_BITFIELDS))
            return Info->bmiHeader.biSizeImage;
+    // Planes are over looked by Yuan. I guess assumed always 1.    
        MaxBits = Info->bmiHeader.biBitCount * Info->bmiHeader.biPlanes * Info->bmiHeader.biWidth;
     }
-    // Planes are over looked by Yuan. I guess assumed always 1.    
-    MaxBits = (MaxBits + 31) / 32; // ScanLineSize = (Width * bitcount + 31)/32
+    MaxBits = ((MaxBits + 31) & ~31 ) / 8; // From Yuan, ScanLineSize = (Width * bitcount + 31)/32
     return (MaxBits * ScanLines);  // ret the full Size.
 }
 




More information about the Ros-diffs mailing list