mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-26 14:21:03 +00:00
Don't force 16bpp if the bit depth was already higher!
This commit is contained in:
parent
42895b2c5f
commit
db8735129a
1 changed files with 10 additions and 5 deletions
|
@ -925,16 +925,21 @@ void *Picture_PNGConvert(
|
||||||
png_bytep *row_pointers = PNG_Read(png, w, h, topoffset, leftoffset, insize);
|
png_bytep *row_pointers = PNG_Read(png, w, h, topoffset, leftoffset, insize);
|
||||||
png_uint_32 width = *w, height = *h;
|
png_uint_32 width = *w, height = *h;
|
||||||
|
|
||||||
|
// Find the output format's bits per pixel amount
|
||||||
|
outbpp = Picture_FormatBPP(outformat);
|
||||||
|
|
||||||
// Hack for patches because you'll want to preserve transparency.
|
// Hack for patches because you'll want to preserve transparency.
|
||||||
if (Picture_IsPatchFormat(outformat))
|
if (Picture_IsPatchFormat(outformat))
|
||||||
outbpp = 16;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
outbpp = Picture_FormatBPP(outformat);
|
// Force a higher bit depth
|
||||||
if (!outbpp)
|
if (outbpp == 8)
|
||||||
I_Error("Picture_PNGConvert: unknown output bits per pixel?!");
|
outbpp = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shouldn't happen.
|
||||||
|
if (!outbpp)
|
||||||
|
I_Error("Picture_PNGConvert: unknown output bits per pixel?!");
|
||||||
|
|
||||||
// Figure out the size
|
// Figure out the size
|
||||||
flatsize = (width * height) * (outbpp / 8);
|
flatsize = (width * height) * (outbpp / 8);
|
||||||
if (outsize)
|
if (outsize)
|
||||||
|
|
Loading…
Reference in a new issue