mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-24 04:29:34 -04:00
detect unsupported nodes formats more reliably
This commit is contained in:
parent
cc079ce043
commit
a43ced2c98
@ -112,7 +112,13 @@ mapformat_t P_CheckMapFormat(int lumpnum)
|
||||
if (!M_CheckParm("-force_old_zdoom_nodes"))
|
||||
{
|
||||
if ((b = lumpnum + ML_SSECTORS) < numlumps &&
|
||||
(nodes = W_CacheLumpNum(b, PU_STATIC)) && W_LumpLength(b) > 4)
|
||||
(nodes = W_CacheLumpNum(b, PU_STATIC)))
|
||||
{
|
||||
if (W_LumpLength(b) < sizeof(mapsubsector_t))
|
||||
{
|
||||
format = MFMT_UNSUPPORTED;
|
||||
}
|
||||
if (W_LumpLength(b) > 4)
|
||||
{
|
||||
if (!memcmp(nodes, "XGLN", 4))
|
||||
format = MFMT_XGLN;
|
||||
@ -128,6 +134,7 @@ mapformat_t P_CheckMapFormat(int lumpnum)
|
||||
format = MFMT_ZGL3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nodes)
|
||||
{
|
||||
@ -138,7 +145,13 @@ mapformat_t P_CheckMapFormat(int lumpnum)
|
||||
if (format == MFMT_DOOM || format >= MFMT_UNSUPPORTED)
|
||||
{
|
||||
if ((b = lumpnum + ML_NODES) < numlumps &&
|
||||
(nodes = W_CacheLumpNum(b, PU_STATIC)) && W_LumpLength(b) > 8)
|
||||
(nodes = W_CacheLumpNum(b, PU_STATIC)))
|
||||
{
|
||||
if (W_LumpLength(b) < sizeof(mapnode_t))
|
||||
{
|
||||
format = MFMT_UNSUPPORTED;
|
||||
}
|
||||
if (W_LumpLength(b) > 8)
|
||||
{
|
||||
if (!memcmp(nodes, "xNd4\0\0\0\0", 8))
|
||||
format = MFMT_DEEP;
|
||||
@ -148,6 +161,7 @@ mapformat_t P_CheckMapFormat(int lumpnum)
|
||||
format = MFMT_ZNOD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nodes)
|
||||
Z_Free(nodes);
|
||||
@ -536,7 +550,8 @@ void P_LoadNodes_XNOD(int lump, boolean compressed, boolean glnodes)
|
||||
if (err != Z_STREAM_END)
|
||||
I_Error("P_LoadNodes_XNOD: Error during ZNOD nodes decompression!");
|
||||
|
||||
I_Printf(VB_DEBUG, "P_LoadNodes_XNOD: ZNOD nodes compression ratio %.3f",
|
||||
I_Printf(VB_DEBUG,
|
||||
"P_LoadNodes_XNOD: ZNOD nodes compression ratio %.3f",
|
||||
(float) zstream->total_out / zstream->total_in);
|
||||
|
||||
data = output;
|
||||
|
Loading…
x
Reference in New Issue
Block a user