Same has been done for REJECT now

This commit is contained in:
Monster Iestyn 2018-01-09 21:33:10 +00:00
parent 2d98da3bcb
commit db23cfc916

View file

@ -2162,6 +2162,30 @@ static void P_LoadReject(lumpnum_t lumpnum)
rejectmatrix = W_CacheLumpNum(lumpnum, PU_LEVEL); rejectmatrix = W_CacheLumpNum(lumpnum, PU_LEVEL);
} }
// PK3 version
// -- Monster Iestyn 09/01/18
static void P_LoadRawReject(UINT8 *data, size_t count, const char *lumpname)
{
// Check if the lump is named "REJECT"
if (!lumpname || memcmp(lumpname, "REJECT\0\0", 8) != 0)
{
rejectmatrix = NULL;
CONS_Debug(DBG_SETUP, "P_LoadRawReject: No valid REJECT lump found\n");
return;
}
if (!count) // zero length, someone probably used ZDBSP
{
rejectmatrix = NULL;
CONS_Debug(DBG_SETUP, "P_LoadRawReject: REJECT lump has size 0, will not be loaded\n");
}
else
{
rejectmatrix = Z_Malloc(count, PU_LEVEL, NULL); // allocate memory for the reject matrix
M_Memcpy(rejectmatrix, data, count); // copy the data into it
}
}
#if 0 #if 0
static char *levellumps[] = static char *levellumps[] =
{ {
@ -2848,7 +2872,10 @@ boolean P_SetupLevel(boolean skipprecip)
P_LoadRawSegs(wadData + (fileinfo + ML_SEGS)->filepos, (fileinfo + ML_SEGS)->size); P_LoadRawSegs(wadData + (fileinfo + ML_SEGS)->filepos, (fileinfo + ML_SEGS)->size);
if (numlumps > ML_REJECT) // enough room for a REJECT lump at least if (numlumps > ML_REJECT) // enough room for a REJECT lump at least
{ {
// placeholder P_LoadRawReject(
wadData + (fileinfo + ML_REJECT)->filepos,
(fileinfo + ML_REJECT)->size,
(fileinfo + ML_REJECT)->name);
} }
// Important: take care of the ordering of the next functions. // Important: take care of the ordering of the next functions.