- uncoupled the decompressors from ZDoom's internal error handling.
This code made it hard to repurpose this code for other tools, so now the error handler must be passed as a callback to OpenDecompressor.
This commit is contained in:
parent
3cfda930ea
commit
0abc66dbff
10 changed files with 115 additions and 68 deletions
|
|
@ -728,13 +728,21 @@ bool MapLoader::LoadExtendedNodes (FileReader &dalump, uint32_t id)
|
|||
if (compressed)
|
||||
{
|
||||
FileReader zip;
|
||||
if (zip.OpenDecompressor(dalump, -1, METHOD_ZLIB, false))
|
||||
try
|
||||
{
|
||||
LoadZNodes(zip, type);
|
||||
if (zip.OpenDecompressor(dalump, -1, METHOD_ZLIB, false, [](const char* err) { I_Error("%s", err); }))
|
||||
{
|
||||
LoadZNodes(zip, type);
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf("Error loading nodes: Corrupt data.\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (const CRecoverableError& err)
|
||||
{
|
||||
Printf("Error loading nodes: Corrupt data.\n");
|
||||
Printf("Error loading nodes: %s.\n", err.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue