diff options
author | Eugene Sandulenko | 2016-08-12 08:42:41 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-12 17:45:21 +0200 |
commit | 5fc45bd3401b5348bbd23257662de3d5320a3c48 (patch) | |
tree | fe7363dc486590b12dfd894dfdc2d1ff94c656a5 /engines | |
parent | efaf7f20d66faecd50c3563a64c952e249ec1b60 (diff) | |
download | scummvm-rg350-5fc45bd3401b5348bbd23257662de3d5320a3c48.tar.gz scummvm-rg350-5fc45bd3401b5348bbd23257662de3d5320a3c48.tar.bz2 scummvm-rg350-5fc45bd3401b5348bbd23257662de3d5320a3c48.zip |
DIRECTOR: Lingo: Sort test files before execution
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 7076ac2bc3..f3faf975fe 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -20,6 +20,8 @@ * */ +#include "common/str-array.h" + #include "director/lingo/lingo.h" #include "director/lingo/lingo-gr.h" @@ -360,14 +362,19 @@ Common::String *Lingo::toLowercaseMac(Common::String *s) { void Lingo::runTests() { Common::File inFile; - Common::ArchiveMemberList fileList; - SearchMan.listMatchingMembers(fileList, "*.lingo"); + Common::ArchiveMemberList fsList; + SearchMan.listMatchingMembers(fsList, "*.lingo"); + Common::StringArray fileList; int counter = 1; - for (Common::ArchiveMemberList::iterator it = fileList.begin(); it != fileList.end(); ++it) { - Common::ArchiveMember const &m = **it; - Common::SeekableReadStream *const stream = m.createReadStream(); + for (Common::ArchiveMemberList::iterator it = fsList.begin(); it != fsList.end(); ++it) + fileList.push_back((*it)->getName()); + + Common::sort(fileList.begin(), fileList.end()); + + for (int i = 0; i < fileList.size(); i++) { + Common::SeekableReadStream *const stream = SearchMan.createReadStreamForMember(fileList[i]); if (stream) { uint size = stream->size(); @@ -375,7 +382,7 @@ void Lingo::runTests() { stream->read(script, size); - warning("Compiling file %s of size %d, id: %d", m.getName().c_str(), size, counter); + warning("Compiling file %s of size %d, id: %d", fileList[i].c_str(), size, counter); _hadError = false; addCode(script, kMovieScript, counter); |