mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Correctly return the output patch's size in Picture_PatchConvert
This commit is contained in:
parent
0e62cb2ada
commit
63e471d902
1 changed files with 9 additions and 3 deletions
|
@ -352,20 +352,26 @@ void *Picture_PatchConvert(
|
||||||
img = Z_Malloc(size, PU_STATIC, NULL);
|
img = Z_Malloc(size, PU_STATIC, NULL);
|
||||||
memcpy(img, imgbuf, size);
|
memcpy(img, imgbuf, size);
|
||||||
|
|
||||||
if (outsize != NULL)
|
|
||||||
*outsize = size;
|
|
||||||
|
|
||||||
if (Picture_IsInternalPatchFormat(outformat))
|
if (Picture_IsInternalPatchFormat(outformat))
|
||||||
{
|
{
|
||||||
patch_t *converted = Patch_Create((softwarepatch_t *)img, size, NULL);
|
patch_t *converted = Patch_Create((softwarepatch_t *)img, size, NULL);
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
Patch_CreateGL(converted);
|
Patch_CreateGL(converted);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Z_Free(img);
|
Z_Free(img);
|
||||||
|
|
||||||
|
if (outsize != NULL)
|
||||||
|
*outsize = sizeof(patch_t);
|
||||||
return converted;
|
return converted;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (outsize != NULL)
|
||||||
|
*outsize = size;
|
||||||
return img;
|
return img;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Converts a picture to a flat.
|
/** Converts a picture to a flat.
|
||||||
|
|
Loading…
Reference in a new issue