mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-10 16:23:05 +00:00
Optimize ReadPSPFile (which should probably be replaced with ReadEntireFile anyway)
This commit is contained in:
parent
464af0723e
commit
5d53e59c1d
@ -66,9 +66,12 @@ namespace
|
||||
if (handle < 0)
|
||||
return false;
|
||||
|
||||
if(dataSize == -1)
|
||||
{
|
||||
dataSize = pspFileSystem.GetFileInfo(filename).size;
|
||||
if (dataSize == -1) {
|
||||
// Determine the size through seeking instead of querying.
|
||||
pspFileSystem.SeekFile(handle, 0, FILEMOVE_END);
|
||||
dataSize = pspFileSystem.GetSeekPos(handle);
|
||||
pspFileSystem.SeekFile(handle, 0, FILEMOVE_BEGIN);
|
||||
|
||||
*data = new u8[(size_t)dataSize];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user