cleaned up some redundant file reads and fixed file opening in the movie player.

As a streaming action this cannot borrow the one from the archive.
This commit is contained in:
Christoph Oelckers 2023-12-13 16:56:47 +01:00
commit df3e82d94c
10 changed files with 31 additions and 17 deletions

View file

@ -200,10 +200,10 @@ void FScanner :: OpenLumpNum (int lump)
{
Close ();
{
auto mem = fileSystem.OpenFileReader(lump);
auto buff = ScriptBuffer.LockNewBuffer(mem.GetLength());
mem.Read(buff, mem.GetLength());
buff[mem.GetLength()] = 0;
auto len = fileSystem.FileLength(lump);
auto buff = ScriptBuffer.LockNewBuffer(len);
fileSystem.ReadFile(lump, buff);
buff[len] = 0;
ScriptBuffer.UnlockBuffer();
}
ScriptName = fileSystem.GetFileFullPath(lump).c_str();