- use the lump cache directly for FileData.

This was the final puzzle piece to allow using memory mapped files. :)
This commit is contained in:
Christoph Oelckers 2023-08-20 02:04:19 +02:00
commit 4f8305de5f
2 changed files with 25 additions and 32 deletions

View file

@ -1518,29 +1518,6 @@ bool FileSystem::CreatePathlessCopy(const char *name, int id, int /*flags*/)
return true;
}
// FileData -----------------------------------------------------------------
FileData::FileData (const FileData &copy)
{
Block = copy.Block;
}
FileData &FileData::operator = (const FileData &copy)
{
Block = copy.Block;
return *this;
}
FileData::FileData (FResourceLump* lump)
{
auto size = lump->LumpSize;
Block.resize(1 + size);
memcpy(Block.data(), lump->Lock(), size);
Block[size] = 0;
lump->Unlock();
}
//==========================================================================
//
// PrintLastError