Author: akhaldi Date: Sat Nov 21 09:59:56 2015 New Revision: 69986
URL: http://svn.reactos.org/svn/reactos?rev=69986&view=rev Log: [MSRLE32] Sync with Wine Staging 1.7.55. CORE-10536
Modified: trunk/reactos/dll/win32/msrle32/msrle32.c trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/msrle32/msrle32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msrle32/msrle32.c... ============================================================================== --- trunk/reactos/dll/win32/msrle32/msrle32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msrle32/msrle32.c [iso-8859-1] Sat Nov 21 09:59:56 2015 @@ -1596,7 +1596,7 @@
/* check input format if given */ if (lpbiIn != NULL) { - if (!isSupportedMRLE(lpbiIn)) + if (!isSupportedMRLE(lpbiIn) && !isSupportedDIB(lpbiIn)) return ICERR_BADFORMAT; }
@@ -1607,11 +1607,11 @@
if (lpbiIn != NULL) { if (lpbiIn->biWidth != lpbiOut->biWidth) - hr = ICERR_UNSUPPORTED; + hr = ICERR_UNSUPPORTED; if (lpbiIn->biHeight != lpbiOut->biHeight) - hr = ICERR_UNSUPPORTED; + hr = ICERR_UNSUPPORTED; if (lpbiIn->biBitCount > lpbiOut->biBitCount) - hr = ICERR_UNSUPPORTED; + hr = ICERR_UNSUPPORTED; } }
@@ -1645,49 +1645,51 @@ if (pi->bDecompress) DecompressEnd(pi);
- rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize); - rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize); - - switch (lpbiOut->biBitCount) { - case 4: - case 8: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed); - if (pi->palette_map == NULL) - return ICERR_MEMORY; - - for (i = 0; i < lpbiIn->biClrUsed; i++) { - pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed, rgbOut, rgbIn[i]); - } - break; - case 15: - case 16: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2); - if (pi->palette_map == NULL) - return ICERR_MEMORY; - - for (i = 0; i < lpbiIn->biClrUsed; i++) { - WORD color; - - if (lpbiOut->biBitCount == 15) - color = ((rgbIn[i].rgbRed >> 3) << 10) - | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); - else - color = ((rgbIn[i].rgbRed >> 3) << 11) - | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); - - pi->palette_map[i * 2 + 1] = color >> 8; - pi->palette_map[i * 2 + 0] = color & 0xFF; + if (lpbiIn->biCompression != BI_RGB) + { + rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize); + rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize); + + switch (lpbiOut->biBitCount) { + case 4: + case 8: + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed); + if (pi->palette_map == NULL) + return ICERR_MEMORY; + + for (i = 0; i < lpbiIn->biClrUsed; i++) { + pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed, rgbOut, rgbIn[i]); + } + break; + case 15: + case 16: + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2); + if (pi->palette_map == NULL) + return ICERR_MEMORY; + + for (i = 0; i < lpbiIn->biClrUsed; i++) { + WORD color; + + if (lpbiOut->biBitCount == 15) + color = ((rgbIn[i].rgbRed >> 3) << 10) + | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); + else + color = ((rgbIn[i].rgbRed >> 3) << 11) + | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); + + pi->palette_map[i * 2 + 1] = color >> 8; + pi->palette_map[i * 2 + 0] = color & 0xFF; + }; + break; + case 24: + case 32: + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD)); + if (pi->palette_map == NULL) + return ICERR_MEMORY; + memcpy(pi->palette_map, rgbIn, lpbiIn->biClrUsed * sizeof(RGBQUAD)); + break; }; - break; - case 24: - case 32: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD)); - if (pi->palette_map == NULL) - return ICERR_MEMORY; - memcpy(pi->palette_map, rgbIn, lpbiIn->biClrUsed * sizeof(RGBQUAD)); - break; - }; - + } pi->bDecompress = TRUE;
return ICERR_OK; @@ -1717,6 +1719,14 @@
assert(pic->lpbiInput->biWidth == pic->lpbiOutput->biWidth); assert(pic->lpbiInput->biHeight == pic->lpbiOutput->biHeight); + + /* Uncompressed frame? */ + if (pic->lpbiInput->biCompression == BI_RGB) + { + pic->lpbiOutput->biSizeImage = pic->lpbiInput->biSizeImage; + memcpy(pic->lpOutput, pic->lpInput, pic->lpbiOutput->biSizeImage); + return ICERR_OK; + }
pic->lpbiOutput->biSizeImage = DIBWIDTHBYTES(*pic->lpbiOutput) * pic->lpbiOutput->biHeight; if (pic->lpbiInput->biBitCount == 4)
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=6... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Nov 21 09:59:56 2015 @@ -122,7 +122,7 @@ reactos/dll/win32/msisys.ocx # Synced to WineStaging-1.7.47 reactos/dll/win32/msnet32 # Synced to WineStaging-1.7.47 reactos/dll/win32/mspatcha # Synced to WineStaging-1.7.47 -reactos/dll/win32/msrle32 # Synced to WineStaging-1.7.47 +reactos/dll/win32/msrle32 # Synced to WineStaging-1.7.55 reactos/dll/win32/mssign32 # Synced to WineStaging-1.7.47 reactos/dll/win32/mssip32 # Synced to WineStaging-1.7.47 reactos/dll/win32/mstask # Synced to WineStaging-1.7.47