mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 19:22:30 +00:00
feat(util): convert names of asset files to lowercase before attempting to read
This commit is contained in:
parent
efd37e3050
commit
97bbe2ea66
1 changed files with 10 additions and 1 deletions
|
|
@ -145,6 +145,13 @@ int32_t SFile::OpenEx(SArchive* archive, const char* filename, uint32_t flags, S
|
||||||
}
|
}
|
||||||
|
|
||||||
SStrCopy(path, filename, STORM_MAX_PATH);
|
SStrCopy(path, filename, STORM_MAX_PATH);
|
||||||
|
for (int32_t i = 0; i < STORM_MAX_PATH; i++) {
|
||||||
|
if (!path[i]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
path[i] = static_cast<char>(tolower(path[i]));
|
||||||
|
}
|
||||||
|
|
||||||
SFILE_TYPE filetype = SFILE_PLAIN;
|
SFILE_TYPE filetype = SFILE_PLAIN;
|
||||||
void* filehandle;
|
void* filehandle;
|
||||||
|
|
@ -216,7 +223,9 @@ int32_t SFile::Read(SFile* file, void* buffer, size_t bytestoread, size_t* bytes
|
||||||
auto stream = reinterpret_cast<Blizzard::File::StreamRecord*>(file->m_handle);
|
auto stream = reinterpret_cast<Blizzard::File::StreamRecord*>(file->m_handle);
|
||||||
auto count = static_cast<int32_t>(bytestoread);
|
auto count = static_cast<int32_t>(bytestoread);
|
||||||
Blizzard::File::Read(stream, buffer, &count);
|
Blizzard::File::Read(stream, buffer, &count);
|
||||||
*bytesread = static_cast<size_t>(count);
|
if (bytesread) {
|
||||||
|
*bytesread = static_cast<size_t>(count);
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
case SFILE_PAQ: {
|
case SFILE_PAQ: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue