mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Return false from unPackBinary if no tracks are valid
This commit is contained in:
committed by
Misa Elizabeth Kai
parent
f86a67456b
commit
668c3d91d6
@@ -770,7 +770,7 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename)
|
||||
{
|
||||
PHYSFS_sint64 size;
|
||||
PHYSFS_File* handle;
|
||||
int offset;
|
||||
int valid, offset;
|
||||
size_t i;
|
||||
char path[MAX_PATH];
|
||||
|
||||
@@ -796,6 +796,7 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename)
|
||||
sizeof(blob->m_headers)
|
||||
);
|
||||
|
||||
valid = 0;
|
||||
offset = sizeof(blob->m_headers);
|
||||
|
||||
for (i = 0; i < SDL_arraysize(blob->m_headers); ++i)
|
||||
@@ -828,15 +829,20 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename)
|
||||
}
|
||||
PHYSFS_readBytes(handle, *memblock, header->size);
|
||||
offset += header->size;
|
||||
valid += 1;
|
||||
|
||||
continue;
|
||||
|
||||
fail:
|
||||
header->valid = false;
|
||||
}
|
||||
|
||||
PHYSFS_close(handle);
|
||||
|
||||
if (valid == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
printf("The complete reloaded file size: %lli\n", size);
|
||||
|
||||
for (i = 0; i < SDL_arraysize(blob->m_headers); ++i)
|
||||
|
||||
Reference in New Issue
Block a user