- got rid of M_ReadFile(Malloc) which werew each used only once in the entire code. These were still using the low level POSIX-style file interface which shouldn't really be used anymore.
- let FScanner::OpenFile return an error instead of throwing an exception. The exception was never used anyway aside from being caught right away to be ignored.
This commit is contained in:
parent
e15b23f132
commit
838e52001c
8 changed files with 39 additions and 81 deletions
|
|
@ -2798,7 +2798,17 @@ void G_DoPlayDemo (void)
|
|||
{
|
||||
FixPathSeperator (defdemoname);
|
||||
DefaultExtension (defdemoname, ".lmp");
|
||||
M_ReadFileMalloc (defdemoname, &demobuffer);
|
||||
FileReader fr;
|
||||
if (!fr.Open(defdemoname))
|
||||
{
|
||||
I_Error("Unable to open demo '%s'", defdemoname.GetChars());
|
||||
}
|
||||
auto len = fr.GetLength();
|
||||
demobuffer = (uint8_t*)M_Malloc(len);
|
||||
if (fr.Read(demobuffer, len) != len)
|
||||
{
|
||||
I_Error("Unable to read demo '%s'", defdemoname.GetChars());
|
||||
}
|
||||
}
|
||||
demo_p = demobuffer;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue