[Scummvm-cvs-logs] scummvm-tools master -> ac89dd12bb310023afdd3699655994a89fc128db
criezy
criezy at scummvm.org
Thu Nov 24 23:27:30 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .
Summary:
ac89dd12bb TOOLS: Use Filename::exists() instead of fopen() in compress_sword1
Commit: ac89dd12bb310023afdd3699655994a89fc128db
https://github.com/scummvm/scummvm-tools/commit/ac89dd12bb310023afdd3699655994a89fc128db
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2011-11-24T14:27:02-08:00
Commit Message:
TOOLS: Use Filename::exists() instead of fopen() in compress_sword1
The tool is building path by appending uppercase SPEECH or MUSIC
to the input directory and then using fopen() when looking for the
input files. Now it uses Common::Filename::exists() which should
work better on case sensitive systems.
Changed paths:
engines/sword1/compress_sword1.cpp
diff --git a/engines/sword1/compress_sword1.cpp b/engines/sword1/compress_sword1.cpp
index 332927b..e3e54fa 100644
--- a/engines/sword1/compress_sword1.cpp
+++ b/engines/sword1/compress_sword1.cpp
@@ -605,7 +605,6 @@ void CompressSword1::compressMusic(const Common::Filename *inpath, const Common:
void CompressSword1::checkFilesExist(bool checkSpeech, bool checkMusic, const Common::Filename *inpath) {
int i;
- FILE *testFile;
char fileName[256];
bool speechFound = false, musicFound = false;
@@ -613,21 +612,15 @@ void CompressSword1::checkFilesExist(bool checkSpeech, bool checkMusic, const Co
for (i = 1; i <= 2; i++) {
// Try first in SPEECH sub-directory
sprintf(fileName, "%s/SPEECH/SPEECH%d.CLU", inpath->getPath().c_str(), i);
- testFile = fopen(fileName, "rb");
-
- if (testFile){
+ if (Common::Filename(fileName).exists()){
speechFound = true;
- fclose(testFile);
break;
}
// Then try at the root of the input directory
sprintf(fileName, "%s/SPEECH%d.CLU", inpath->getPath().c_str(), i);
- testFile = fopen(fileName, "rb");
-
- if (testFile){
+ if (Common::Filename(fileName).exists()){
speechFound = true;
- fclose(testFile);
break;
}
}
@@ -653,46 +646,34 @@ void CompressSword1::checkFilesExist(bool checkSpeech, bool checkMusic, const Co
// Check WAV file
// Try first in MUSIC sub-directory
sprintf(fileName, "%s/MUSIC/%s.WAV", inpath->getPath().c_str(), musicNames[i].fileName);
- testFile = fopen(fileName, "rb");
-
- if (testFile) {
+ if (Common::Filename(fileName).exists()) {
musicFound = true;
- fclose(testFile);
break;
}
// Then try at root of input directory
sprintf(fileName, "%s/%s.WAV", inpath->getPath().c_str(), musicNames[i].fileName);
- testFile = fopen(fileName, "rb");
-
- if (testFile) {
+ if (Common::Filename(fileName).exists()) {
musicFound = true;
- fclose(testFile);
break;
}
// Check AIF file
// Try first in MUSIC sub-directory
sprintf(fileName, "%s/MUSIC/%s.AIF", inpath->getPath().c_str(), musicNames[i].fileName);
- testFile = fopen(fileName, "rb");
-
- if (testFile) {
+ if (Common::Filename(fileName).exists()) {
musicFound = true;
_macVersion = true;
_speechEndianness = UnknownEndian;
- fclose(testFile);
break;
}
// Then try at root of input directory
sprintf(fileName, "%s/%s.AIF", inpath->getPath().c_str(), musicNames[i].fileName);
- testFile = fopen(fileName, "rb");
-
- if (testFile) {
+ if (Common::Filename(fileName).exists()) {
musicFound = true;
_macVersion = true;
_speechEndianness = UnknownEndian;
- fclose(testFile);
break;
}
More information about the Scummvm-git-logs
mailing list