Palremap extras 2 (#16)

Kartchar support, initialize compatmode
This commit is contained in:
GenericHeroGuy 2025-01-25 22:49:38 +01:00
parent 43d38194fe
commit 7a6de57a99
2 changed files with 11 additions and 0 deletions

View file

@ -300,9 +300,19 @@ void R_DoPaletteRemapPatch(softwarepatch_t *patch, size_t size)
if (!Picture_CheckIfDoomPatch(patch, size))
return;
// thanks to my very own ingenious patch-compression technology,
// i now have to make sure i don't accidentally remap a column twice. cool!
// yes, it assumes all columns are sequential in the patch,
// but it's efficient so who cares
UINT8 *last = 0;
for (INT16 i = 0; i < patch->width; i++)
{
UINT8 *p = (UINT8 *)patch + patch->columnofs[i];
if (p <= last)
continue;
else
last = p;
while (*p++ != 0xff) // topdelta
{
int length = *p++;

View file

@ -891,6 +891,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup, wadco
wadfile->compatmode = CheckCompatZip(numwadfiles - 1);
break;
default:
wadfile->compatmode = false;
break;
}