mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 12:55:24 +00:00
DRACI: Find max speech file using iterator
This commit is contained in:
parent
c52eaf92fc
commit
8713f3b3b3
@ -203,6 +203,16 @@ void ZipSoundArchive::openArchive(const char *path, const char *extension, Sound
|
||||
Common::ArchiveMemberList files;
|
||||
_archive->listMembers(files);
|
||||
_sampleCount = files.size();
|
||||
|
||||
// The sample files are in the form ####.mp3 but not all numbers are used so we need to
|
||||
// iterate the archive and find the last file
|
||||
for (Common::ArchiveMemberList::iterator iter = files.begin(); iter != files.end(); iter++) {
|
||||
Common::String filename = (*iter)->getName();
|
||||
filename.erase(filename.size() - 4); // remove .mp3 extension
|
||||
uint file_number = atoi(filename.c_str());
|
||||
if(file_number > _sampleCount) // finds the last file (numerically)
|
||||
_sampleCount = file_number;
|
||||
}
|
||||
debugC(1, kDraciArchiverDebugLevel, "Capacity %d", _sampleCount);
|
||||
} else {
|
||||
debugC(1, kDraciArchiverDebugLevel, "Failed");
|
||||
|
Loading…
x
Reference in New Issue
Block a user