Fixed alpha channel for color formats without.
@@ -250,19 +250,33 @@ static INLINE BOOL writeLine(BYTE** ppRgba, UINT32 DstFormat, UINT32 width, cons
*(*ppRgba)++ = *(*ppB)++;
*(*ppRgba)++ = *(*ppG)++;
*(*ppRgba)++ = *(*ppR)++;
- *(*ppRgba)++ = *(*ppA)++;
+ *(*ppRgba)++ = 0xFF;
}
return TRUE;
default:
+ if (ppA)
+ {
for (x = 0; x < width; x++)
{
- BYTE alpha = (ppA) ? *(*ppA)++ : 0xFF;
+ BYTE alpha = *(*ppA)++;
UINT32 color = GetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
WriteColor(*ppRgba, DstFormat, color);
*ppRgba += GetBytesPerPixel(DstFormat);
}
+ }
+ else
+ {
+ const BYTE alpha = 0xFF;
+
+ for (x = 0; x < width; x++)
+ {
+ UINT32 color = GetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
+ WriteColor(*ppRgba, DstFormat, color);
+ *ppRgba += GetBytesPerPixel(DstFormat);
+ }
+ }
return TRUE;
}
