mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 02:21:47 +00:00
Same has been done for REJECT now
This commit is contained in:
parent
2d98da3bcb
commit
db23cfc916
1 changed files with 28 additions and 1 deletions
|
@ -2162,6 +2162,30 @@ static void P_LoadReject(lumpnum_t lumpnum)
|
|||
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
|
||||
static char *levellumps[] =
|
||||
{
|
||||
|
@ -2848,7 +2872,10 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
P_LoadRawSegs(wadData + (fileinfo + ML_SEGS)->filepos, (fileinfo + ML_SEGS)->size);
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue