Log Message:
-----------
Fixed bitmap file loading, to account for line padding.
Modified Files:
--------------
/cvsroot/decaldev/source/Inject:
Image.cpp
Revision Data
-------------
Index: Image.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/Inject/Image.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Image.cpp 17 Jun 2002 07:12:30 -0000 1.6
+++ Image.cpp 21 Dec 2003 22:40:42 -0000 1.7
@@ -60,12 +60,13 @@
*pDest = 0x07FF;
+ // Mekle: Added the (bih.biWidth % 4) sections below, as BMP rows MUST end on a 32bit boundry
BYTE *pbSurf = reinterpret_cast< BYTE * >( desc.lpSurface ) + ( desc.dwHeight - 1 ) * desc.lPitch;
- BYTE *pbRow = new BYTE[ bih.biWidth ];
+ BYTE *pbRow = new BYTE[ bih.biWidth + (bih.biWidth % 4) ];
for( int nRow = 0; nRow < bih.biHeight; ++ nRow )
{
- ::ReadFile( hBitmap, pbRow, bih.biWidth, &dwRead, NULL );
+ ::ReadFile( hBitmap, pbRow, bih.biWidth + (bih.biWidth % 4), &dwRead, NULL );
WORD *pwDest = reinterpret_cast< WORD * >( pbSurf );
for( BYTE *pbSrc = pbRow; pbSrc != pbRow + bih.biWidth; ++ pbSrc, ++ pwDest )
|