mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Correctly return the output patch's size in Picture_PatchConvert
This commit is contained in:
parent
394150fca4
commit
53a5e75855
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…
Add table
Reference in a new issue