mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
ISOFileSystem: Remove the "restrictTree" functionality which is now obsolete with lazy directory loading.
This commit is contained in:
parent
f9ec9d53d0
commit
cef0a6311d
3 changed files with 3 additions and 31 deletions
|
@ -164,19 +164,7 @@ struct VolDescriptor {
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
ISOFileSystem::ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevice, std::string _restrictPath) {
|
ISOFileSystem::ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevice) {
|
||||||
if (!_restrictPath.empty()) {
|
|
||||||
size_t pos = _restrictPath.find_first_not_of('/');
|
|
||||||
while (pos != _restrictPath.npos) {
|
|
||||||
size_t endPos = _restrictPath.find_first_of('/', pos);
|
|
||||||
if (endPos == _restrictPath.npos)
|
|
||||||
endPos = _restrictPath.length();
|
|
||||||
if (pos != endPos)
|
|
||||||
restrictTree.push_back(_restrictPath.substr(pos, endPos - pos));
|
|
||||||
pos = _restrictPath.find_first_not_of('/', endPos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
blockDevice = _blockDevice;
|
blockDevice = _blockDevice;
|
||||||
hAlloc = _hAlloc;
|
hAlloc = _hAlloc;
|
||||||
|
|
||||||
|
@ -205,7 +193,6 @@ ISOFileSystem::ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevic
|
||||||
|
|
||||||
treeroot->startsector = desc.root.firstDataSector();
|
treeroot->startsector = desc.root.firstDataSector();
|
||||||
treeroot->dirsize = desc.root.dataLength();
|
treeroot->dirsize = desc.root.dataLength();
|
||||||
treeroot->level = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ISOFileSystem::~ISOFileSystem() {
|
ISOFileSystem::~ISOFileSystem() {
|
||||||
|
@ -261,23 +248,12 @@ void ISOFileSystem::ReadDirectory(TreeEntry *root) {
|
||||||
entry->parent = root;
|
entry->parent = root;
|
||||||
entry->startsector = dir.firstDataSector();
|
entry->startsector = dir.firstDataSector();
|
||||||
entry->dirsize = dir.dataLength();
|
entry->dirsize = dir.dataLength();
|
||||||
entry->level = root->level + 1;
|
|
||||||
// Let's not excessively spam the log - I commented this line out.
|
// Let's not excessively spam the log - I commented this line out.
|
||||||
//DEBUG_LOG(FILESYS, "%s: %s %08x %08x %i", e->isDirectory?"D":"F", e->name.c_str(), dir.firstDataSectorLE, e->startingPosition, e->startingPosition);
|
//DEBUG_LOG(FILESYS, "%s: %s %08x %08x %i", e->isDirectory?"D":"F", e->name.c_str(), dir.firstDataSectorLE, e->startingPosition, e->startingPosition);
|
||||||
|
|
||||||
if (entry->isDirectory && !relative) {
|
if (entry->isDirectory && !relative) {
|
||||||
if (entry->startsector == root->startsector) {
|
if (entry->startsector == root->startsector) {
|
||||||
ERROR_LOG(FILESYS, "WARNING: Appear to have a recursive file system, breaking recursion. Probably corrupt ISO.");
|
ERROR_LOG(FILESYS, "WARNING: Appear to have a recursive file system, breaking recursion. Probably corrupt ISO.");
|
||||||
} else {
|
|
||||||
bool doRecurse = true;
|
|
||||||
if (!restrictTree.empty())
|
|
||||||
doRecurse = root->level < restrictTree.size() && restrictTree[root->level] == entry->name;
|
|
||||||
|
|
||||||
if (!doRecurse) {
|
|
||||||
// The entry is not kept, must free it.
|
|
||||||
delete entry;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
root->children.push_back(entry);
|
root->children.push_back(entry);
|
||||||
|
|
|
@ -28,7 +28,7 @@ bool parseLBN(std::string filename, u32 *sectorStart, u32 *readSize);
|
||||||
|
|
||||||
class ISOFileSystem : public IFileSystem {
|
class ISOFileSystem : public IFileSystem {
|
||||||
public:
|
public:
|
||||||
ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevice, std::string _restrictPath = "");
|
ISOFileSystem(IHandleAllocator *_hAlloc, BlockDevice *_blockDevice);
|
||||||
~ISOFileSystem();
|
~ISOFileSystem();
|
||||||
|
|
||||||
void DoState(PointerWrap &p) override;
|
void DoState(PointerWrap &p) override;
|
||||||
|
@ -67,7 +67,6 @@ private:
|
||||||
|
|
||||||
u32 startsector;
|
u32 startsector;
|
||||||
u32 dirsize;
|
u32 dirsize;
|
||||||
int level;
|
|
||||||
|
|
||||||
TreeEntry *parent;
|
TreeEntry *parent;
|
||||||
|
|
||||||
|
@ -93,9 +92,6 @@ private:
|
||||||
|
|
||||||
TreeEntry entireISO;
|
TreeEntry entireISO;
|
||||||
|
|
||||||
// Don't use this in the emu, not savestated.
|
|
||||||
std::vector<std::string> restrictTree;
|
|
||||||
|
|
||||||
void ReadDirectory(TreeEntry *root);
|
void ReadDirectory(TreeEntry *root);
|
||||||
TreeEntry *GetFromPath(const std::string &path, bool catchError = true);
|
TreeEntry *GetFromPath(const std::string &path, bool catchError = true);
|
||||||
std::string EntryFullPath(TreeEntry *e);
|
std::string EntryFullPath(TreeEntry *e);
|
||||||
|
|
|
@ -513,7 +513,7 @@ handleELF:
|
||||||
BlockDevice *bd = constructBlockDevice(info_->GetFileLoader());
|
BlockDevice *bd = constructBlockDevice(info_->GetFileLoader());
|
||||||
if (!bd)
|
if (!bd)
|
||||||
return; // nothing to do here..
|
return; // nothing to do here..
|
||||||
ISOFileSystem umd(&handles, bd, "/PSP_GAME");
|
ISOFileSystem umd(&handles, bd);
|
||||||
|
|
||||||
// Alright, let's fetch the PARAM.SFO.
|
// Alright, let's fetch the PARAM.SFO.
|
||||||
std::string paramSFOcontents;
|
std::string paramSFOcontents;
|
||||||
|
|
Loading…
Add table
Reference in a new issue