Palremap extras (#16)
Fix demos, fix compiler warnings, at least TRY to validate patches instead of allowing palette remaps in the entire address space
This commit is contained in:
parent
577c0ac4b4
commit
43d38194fe
3 changed files with 6 additions and 4 deletions
|
|
@ -2361,6 +2361,7 @@ static void G_SkipDemoExtraFiles(UINT8 **pp)
|
|||
{
|
||||
SKIPSTRING((*pp));// file name
|
||||
(*pp) += 16;// md5
|
||||
(*pp) += 1; // compatmode
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -297,11 +297,12 @@ static boolean R_CheckTextureLumpLength(texture_t *texture, size_t patch)
|
|||
|
||||
void R_DoPaletteRemapPatch(softwarepatch_t *patch, size_t size)
|
||||
{
|
||||
(void)size;
|
||||
UINT32 *columns = patch->columnofs;
|
||||
if (!Picture_CheckIfDoomPatch(patch, size))
|
||||
return;
|
||||
|
||||
for (INT16 i = 0; i < patch->width; i++)
|
||||
{
|
||||
UINT8 *p = (UINT8 *)patch + columns[i];
|
||||
UINT8 *p = (UINT8 *)patch + patch->columnofs[i];
|
||||
while (*p++ != 0xff) // topdelta
|
||||
{
|
||||
int length = *p++;
|
||||
|
|
|
|||
|
|
@ -1839,7 +1839,7 @@ void *W_CacheSoftwarePatchNumPwad(UINT16 wad, UINT16 lump, INT32 tag)
|
|||
|
||||
// we already know this is a patch, do palette remapping here
|
||||
if (wadfiles[wad]->compatmode)
|
||||
R_DoPaletteRemapPatch(ptr, wadfiles[wad]->lumpinfo[lump].size);
|
||||
R_DoPaletteRemapPatch(ptr, len);
|
||||
|
||||
dest = Z_Calloc(sizeof(patch_t), tag, &lumpcache[lump]);
|
||||
Patch_Create(ptr, len, dest);
|
||||
|
|
|
|||
Loading…
Reference in a new issue