mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Switch palookup memory allocation to Xalligned_alloc and fix what looks like a botched preprocessor condition
git-svn-id: https://svn.eduke32.com/eduke32@6438 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c7d2f0b869
commit
29fc836bb1
2 changed files with 5 additions and 8 deletions
|
@ -7806,7 +7806,7 @@ void uninitengine(void)
|
|||
if (i==0 || palookup[i] != palookup[0])
|
||||
{
|
||||
// Take care of handling aliased ^^^ cases!
|
||||
Bfree(palookup[i]);
|
||||
Baligned_free(palookup[i]);
|
||||
}
|
||||
Bmemset(palookup, 0, sizeof(palookup));
|
||||
|
||||
|
|
|
@ -87,14 +87,11 @@ void setup_blend(int32_t blend, int32_t doreverse)
|
|||
|
||||
static void alloc_palookup(int32_t pal)
|
||||
{
|
||||
#if defined ENGINE_USING_A_C || (defined CLASSIC_NONPOW2_YSIZE_WALLS && defined CLASSIC_NONPOW2_YSIZE_SPRITES)
|
||||
palookup[pal] = (char *) Xmalloc(numshades*256);
|
||||
#else
|
||||
// The asm functions vlineasm1, mvlineasm1 (maybe others?) access the next
|
||||
// palookup[...] shade entry for tilesizy==512 tiles.
|
||||
// See DEBUG_TILESIZY_512 and the comment in a.nasm: vlineasm1.
|
||||
palookup[pal] = (char *) Xcalloc(numshades+1, 256);
|
||||
#endif
|
||||
palookup[pal] = (char *) Xaligned_alloc(16, (numshades + 1) * 256);
|
||||
memset(palookup[pal], 0, (numshades + 1) * 256);
|
||||
}
|
||||
|
||||
static void maybe_alloc_palookup(int32_t palnum);
|
||||
|
@ -518,12 +515,12 @@ void removepalookup(int32_t const palnum)
|
|||
if (palookup[i] == palookup[palnum])
|
||||
palookup[i] = NULL;
|
||||
|
||||
DO_FREE_AND_NULL(palookup[palnum]);
|
||||
ALIGNED_FREE_AND_NULL(palookup[palnum]);
|
||||
}
|
||||
else if (palookup[palnum] == palookup[0])
|
||||
palookup[palnum] = NULL;
|
||||
else
|
||||
DO_FREE_AND_NULL(palookup[palnum]);
|
||||
ALIGNED_FREE_AND_NULL(palookup[palnum]);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue