Before aliasing empty palookups to #0, check existing ones if they are identical to #0, and if so, also alias them. This saves memory in Polymost with tileshades enabled.

git-svn-id: https://svn.eduke32.com/eduke32@5368 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-10-03 11:52:56 +00:00
parent cac05f8305
commit 8437d22bf2

View file

@ -8524,8 +8524,14 @@ void fillemptylookups(void)
{
// Alias remaining unused pal numbers to the base shade table.
for (int32_t j=1; j<MAXPALOOKUPS; j++)
{
// If an existing lookup is identical to #0, free it.
if (palookup[j] && palookup[j] != palookup[0] && !Bmemcmp(palookup[0], palookup[j], 256*numshades))
removepalookup(j);
if (!palookup[j])
makepalookup(j, NULL, 0,0,0, 1);
}
}