mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
When requesting a non-fogged identity lookup from makepalookup(), alias to palookup[0].
(That is, the base shade table.) Before, we allocated each palookup buffer. For a vanilla setup, this means that we're now saving 224*32*256 ~= 1.8 megs, which might be interesting for low-memory gadgets. git-svn-id: https://svn.eduke32.com/eduke32@2571 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
98935fe7a9
commit
258c19f411
1 changed files with 11 additions and 2 deletions
|
@ -8022,7 +8022,10 @@ void uninitengine(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<MAXPALOOKUPS; i++)
|
for (i=0; i<MAXPALOOKUPS; i++)
|
||||||
if (palookup[i] != NULL) { Bfree(palookup[i]); palookup[i] = NULL; }
|
if (palookup[i] != NULL && (i==0 || palookup[i] != palookup[0]))
|
||||||
|
{
|
||||||
|
Bfree(palookup[i]);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DYNALLOC_ARRAYS
|
#ifdef DYNALLOC_ARRAYS
|
||||||
if (blockptr != NULL)
|
if (blockptr != NULL)
|
||||||
|
@ -13424,6 +13427,12 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
|
||||||
|
|
||||||
if (remapbuf==NULL)
|
if (remapbuf==NULL)
|
||||||
{
|
{
|
||||||
|
if ((r|g|b) == 0)
|
||||||
|
{
|
||||||
|
palookup[palnum] = palookup[0]; // Alias to base shade table!
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (idmap[0]==1) // init identity map
|
if (idmap[0]==1) // init identity map
|
||||||
for (i=0; i<256; i++)
|
for (i=0; i<256; i++)
|
||||||
idmap[i] = i;
|
idmap[i] = i;
|
||||||
|
@ -13431,7 +13440,7 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
|
||||||
remapbuf = idmap;
|
remapbuf = idmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (palookup[palnum] == NULL)
|
if (palookup[palnum] == NULL || palookup[palnum] == palookup[0])
|
||||||
{
|
{
|
||||||
//Allocate palookup buffer
|
//Allocate palookup buffer
|
||||||
palookup[palnum] = Bmalloc(numshades<<8);
|
palookup[palnum] = Bmalloc(numshades<<8);
|
||||||
|
|
Loading…
Reference in a new issue