mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Add FileMonitor support for VolumeDirectory
This commit is contained in:
parent
339383b8dd
commit
7f04a23e23
@ -92,7 +92,7 @@ void ReadFileSystem(const std::string& filename)
|
||||
FileAccess = true;
|
||||
}
|
||||
|
||||
// Check if we should play this file
|
||||
// Logs a file if it passes a few checks
|
||||
void CheckFile(const std::string& file, u64 size)
|
||||
{
|
||||
// Don't do anything if the log is unselected
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/MathUtil.h"
|
||||
#include "DiscIO/FileBlob.h"
|
||||
#include "DiscIO/FileMonitor.h"
|
||||
#include "DiscIO/Volume.h"
|
||||
#include "DiscIO/VolumeDirectory.h"
|
||||
|
||||
@ -111,13 +112,16 @@ bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
|
||||
{
|
||||
_dbg_assert_(DVDINTERFACE, fileIter->first <= _Offset);
|
||||
u64 fileOffset = _Offset - fileIter->first;
|
||||
const std::string fileName = fileIter->second;
|
||||
|
||||
std::unique_ptr<PlainFileReader> reader(PlainFileReader::Create(fileIter->second));
|
||||
std::unique_ptr<PlainFileReader> reader(PlainFileReader::Create(fileName));
|
||||
if (reader == nullptr)
|
||||
return false;
|
||||
|
||||
u64 fileSize = reader->GetDataSize();
|
||||
|
||||
FileMon::CheckFile(fileName, fileSize);
|
||||
|
||||
if (fileOffset < fileSize)
|
||||
{
|
||||
u64 fileBytes = fileSize - fileOffset;
|
||||
|
Loading…
Reference in New Issue
Block a user