- 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
|
|
@ -656,32 +656,3 @@ UNSAFE_CCMD (screenshot)
|
|||
G_ScreenShot (argv[1]);
|
||||
}
|
||||
|
||||
//
|
||||
// M_ZlibError
|
||||
//
|
||||
FString M_ZLibError(int zerr)
|
||||
{
|
||||
if (zerr >= 0)
|
||||
{
|
||||
return "OK";
|
||||
}
|
||||
else if (zerr < -6)
|
||||
{
|
||||
FString out;
|
||||
out.Format("%d", zerr);
|
||||
return out;
|
||||
}
|
||||
else
|
||||
{
|
||||
static const char *errs[6] =
|
||||
{
|
||||
"Errno",
|
||||
"Stream Error",
|
||||
"Data Error",
|
||||
"Memory Error",
|
||||
"Buffer Error",
|
||||
"Version Error"
|
||||
};
|
||||
return errs[-zerr - 1];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue