- use the lump cache directly for FileData.
This was the final puzzle piece to allow using memory mapped files. :)
This commit is contained in:
parent
2c2bf0265f
commit
4f8305de5f
2 changed files with 25 additions and 32 deletions
|
|
@ -1518,29 +1518,6 @@ bool FileSystem::CreatePathlessCopy(const char *name, int id, int /*flags*/)
|
|||
return true;
|
||||
}
|
||||
|
||||
// FileData -----------------------------------------------------------------
|
||||
|
||||
FileData::FileData (const FileData ©)
|
||||
{
|
||||
Block = copy.Block;
|
||||
}
|
||||
|
||||
FileData &FileData::operator = (const FileData ©)
|
||||
{
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue