Instead of copying the whole formula, it could be done as ULONG Height; if (lpbmi->bmiHeader.biHeight >=0 ) Height = lpbmi->bmiHeader.biHeight; else Height = -lpbmi->bmiHeader.biHeight;
retSize = Height * ((lpbmi->bmiHeader.biWidth * lpbmi->bmiHeader.biPlanes * lpbmi-
bmiHeader.biBitCount + 31) & -32) / 8;
Also comments contain typos /* Make height postiive if it negitve then calc the bits Size and align it*/ postiive, negitive
WBR, Aleksey.
On Nov 30, 2008, at 4:17 PM, jimtabor@svn.reactos.org wrote:
Author: jimtabor Date: Sun Nov 30 07:17:19 2008 New Revision: 37766
if (lpbmi->bmiHeader.biHeight >=0 ){/* Calc the bits Size and align it*/retSize = lpbmi->bmiHeader.biHeight * ((lpbmi-bmiHeader.biWidth *
lpbmi->bmiHeader.biPlanes * lpbmi-bmiHeader.biBitCount + 31) & -32) / 8;
}else{/* Make height postiive if it negitve then calcthe bits Size and align it*/
retSize = (-lpbmi->bmiHeader.biHeight) * ((lpbmi-bmiHeader.biWidth *
lpbmi->bmiHeader.biPlanes * lpbmi-bmiHeader.biBitCount + 31) & -32) / 8;
}
Hi!
Or just use abs(x).
On Sun, Nov 30, 2008 at 8:43 AM, Aleksey Bragin aleksey@reactos.org wrote:
Instead of copying the whole formula, it could be done as ULONG Height; if (lpbmi->bmiHeader.biHeight >=0 ) Height = lpbmi->bmiHeader.biHeight; else Height = -lpbmi->bmiHeader.biHeight;
retSize = Height * ((lpbmi->bmiHeader.biWidth * lpbmi->bmiHeader.biPlanes * lpbmi-
bmiHeader.biBitCount + 31) & -32) / 8;
My Greatlordish editor was broken, James