mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'non-bss-convert-imgbuf' into 'master'
Allocate imgbuf on-demand in Picture_PatchConvert See merge request kart-krew-dev/ring-racers-internal!2491
This commit is contained in:
commit
ed2c0c85cc
1 changed files with 2 additions and 2 deletions
|
|
@ -52,8 +52,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned char imgbuf[1<<26];
|
|
||||||
|
|
||||||
#ifdef PICTURE_PNG_USELOOKUP
|
#ifdef PICTURE_PNG_USELOOKUP
|
||||||
static colorlookup_t png_colorlookup;
|
static colorlookup_t png_colorlookup;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -119,6 +117,7 @@ void *Picture_PatchConvert(
|
||||||
{
|
{
|
||||||
INT16 x, y;
|
INT16 x, y;
|
||||||
UINT8 *img;
|
UINT8 *img;
|
||||||
|
UINT8 *imgbuf = Z_Malloc(1<<26, PU_STATIC, NULL);
|
||||||
UINT8 *imgptr = imgbuf;
|
UINT8 *imgptr = imgbuf;
|
||||||
UINT8 *colpointers, *startofspan;
|
UINT8 *colpointers, *startofspan;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
|
@ -352,6 +351,7 @@ void *Picture_PatchConvert(
|
||||||
size = imgptr-imgbuf;
|
size = imgptr-imgbuf;
|
||||||
img = Z_Malloc(size, PU_STATIC, NULL);
|
img = Z_Malloc(size, PU_STATIC, NULL);
|
||||||
memcpy(img, imgbuf, size);
|
memcpy(img, imgbuf, size);
|
||||||
|
Z_Free(imgbuf);
|
||||||
|
|
||||||
if (Picture_IsInternalPatchFormat(outformat))
|
if (Picture_IsInternalPatchFormat(outformat))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue