mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 22:47:28 +00:00
[MSRLE32] Sync with Wine Staging 1.7.55. CORE-10536
svn path=/trunk/; revision=69986
This commit is contained in:
parent
659bed7ef9
commit
6140544f7a
|
@ -1596,7 +1596,7 @@ static LRESULT DecompressQuery(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
|
||||||
|
|
||||||
/* check input format if given */
|
/* check input format if given */
|
||||||
if (lpbiIn != NULL) {
|
if (lpbiIn != NULL) {
|
||||||
if (!isSupportedMRLE(lpbiIn))
|
if (!isSupportedMRLE(lpbiIn) && !isSupportedDIB(lpbiIn))
|
||||||
return ICERR_BADFORMAT;
|
return ICERR_BADFORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1607,11 +1607,11 @@ static LRESULT DecompressQuery(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
|
||||||
|
|
||||||
if (lpbiIn != NULL) {
|
if (lpbiIn != NULL) {
|
||||||
if (lpbiIn->biWidth != lpbiOut->biWidth)
|
if (lpbiIn->biWidth != lpbiOut->biWidth)
|
||||||
hr = ICERR_UNSUPPORTED;
|
hr = ICERR_UNSUPPORTED;
|
||||||
if (lpbiIn->biHeight != lpbiOut->biHeight)
|
if (lpbiIn->biHeight != lpbiOut->biHeight)
|
||||||
hr = ICERR_UNSUPPORTED;
|
hr = ICERR_UNSUPPORTED;
|
||||||
if (lpbiIn->biBitCount > lpbiOut->biBitCount)
|
if (lpbiIn->biBitCount > lpbiOut->biBitCount)
|
||||||
hr = ICERR_UNSUPPORTED;
|
hr = ICERR_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1645,49 +1645,51 @@ static LRESULT DecompressBegin(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
|
||||||
if (pi->bDecompress)
|
if (pi->bDecompress)
|
||||||
DecompressEnd(pi);
|
DecompressEnd(pi);
|
||||||
|
|
||||||
rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize);
|
if (lpbiIn->biCompression != BI_RGB)
|
||||||
rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize);
|
{
|
||||||
|
rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize);
|
||||||
|
rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize);
|
||||||
|
|
||||||
switch (lpbiOut->biBitCount) {
|
switch (lpbiOut->biBitCount) {
|
||||||
case 4:
|
case 4:
|
||||||
case 8:
|
case 8:
|
||||||
pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed);
|
pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed);
|
||||||
if (pi->palette_map == NULL)
|
if (pi->palette_map == NULL)
|
||||||
return ICERR_MEMORY;
|
return ICERR_MEMORY;
|
||||||
|
|
||||||
for (i = 0; i < lpbiIn->biClrUsed; i++) {
|
for (i = 0; i < lpbiIn->biClrUsed; i++) {
|
||||||
pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed, rgbOut, rgbIn[i]);
|
pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed, rgbOut, rgbIn[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
case 16:
|
case 16:
|
||||||
pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2);
|
pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2);
|
||||||
if (pi->palette_map == NULL)
|
if (pi->palette_map == NULL)
|
||||||
return ICERR_MEMORY;
|
return ICERR_MEMORY;
|
||||||
|
|
||||||
for (i = 0; i < lpbiIn->biClrUsed; i++) {
|
for (i = 0; i < lpbiIn->biClrUsed; i++) {
|
||||||
WORD color;
|
WORD color;
|
||||||
|
|
||||||
if (lpbiOut->biBitCount == 15)
|
if (lpbiOut->biBitCount == 15)
|
||||||
color = ((rgbIn[i].rgbRed >> 3) << 10)
|
color = ((rgbIn[i].rgbRed >> 3) << 10)
|
||||||
| ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3);
|
| ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3);
|
||||||
else
|
else
|
||||||
color = ((rgbIn[i].rgbRed >> 3) << 11)
|
color = ((rgbIn[i].rgbRed >> 3) << 11)
|
||||||
| ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3);
|
| ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3);
|
||||||
|
|
||||||
pi->palette_map[i * 2 + 1] = color >> 8;
|
pi->palette_map[i * 2 + 1] = color >> 8;
|
||||||
pi->palette_map[i * 2 + 0] = color & 0xFF;
|
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;
|
pi->bDecompress = TRUE;
|
||||||
|
|
||||||
return ICERR_OK;
|
return ICERR_OK;
|
||||||
|
@ -1718,6 +1720,14 @@ static LRESULT Decompress(CodecInfo *pi, ICDECOMPRESS *pic, DWORD dwSize)
|
||||||
assert(pic->lpbiInput->biWidth == pic->lpbiOutput->biWidth);
|
assert(pic->lpbiInput->biWidth == pic->lpbiOutput->biWidth);
|
||||||
assert(pic->lpbiInput->biHeight == pic->lpbiOutput->biHeight);
|
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;
|
pic->lpbiOutput->biSizeImage = DIBWIDTHBYTES(*pic->lpbiOutput) * pic->lpbiOutput->biHeight;
|
||||||
if (pic->lpbiInput->biBitCount == 4)
|
if (pic->lpbiInput->biBitCount == 4)
|
||||||
return MSRLE32_DecompressRLE4(pi, pic->lpbiOutput, pic->lpInput, pic->lpOutput);
|
return MSRLE32_DecompressRLE4(pi, pic->lpbiOutput, pic->lpInput, pic->lpOutput);
|
||||||
|
|
|
@ -122,7 +122,7 @@ reactos/dll/win32/msisip # Synced to WineStaging-1.7.47
|
||||||
reactos/dll/win32/msisys.ocx # Synced to WineStaging-1.7.47
|
reactos/dll/win32/msisys.ocx # Synced to WineStaging-1.7.47
|
||||||
reactos/dll/win32/msnet32 # 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/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/mssign32 # Synced to WineStaging-1.7.47
|
||||||
reactos/dll/win32/mssip32 # 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
|
reactos/dll/win32/mstask # Synced to WineStaging-1.7.47
|
||||||
|
|
Loading…
Reference in a new issue