diff options
Diffstat (limited to 'sword2')
-rw-r--r-- | sword2/driver/d_sound.cpp | 3 | ||||
-rw-r--r-- | sword2/function.cpp | 7 | ||||
-rw-r--r-- | sword2/resman.cpp | 7 |
3 files changed, 5 insertions, 12 deletions
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp index 5dbf75d49f..dc1666d673 100644 --- a/sword2/driver/d_sound.cpp +++ b/sword2/driver/d_sound.cpp @@ -699,8 +699,7 @@ uint32 Sound::preFetchCompSpeech(const char *filename, uint32 speechid, uint16 * *buf = NULL; // Open the speech cluster and find the data offset & size - fp.open(filename); - if (!fp.isOpen()) + if (!fp.open(filename)) return 0; fp.seek((speechid + 1) * 8, SEEK_SET); diff --git a/sword2/function.cpp b/sword2/function.cpp index fbde8e44d3..ea4a89b584 100644 --- a/sword2/function.cpp +++ b/sword2/function.cpp @@ -446,14 +446,12 @@ int32 Logic::fnPlayCredits(int32 *params) { // Read the "Smacker" logo - f.open("credits.bmp"); - uint16 logoWidth = 0; uint16 logoHeight = 0; uint8 *logoData = NULL; uint8 palette[1024]; - if (f.isOpen()) { + if (f.open("credits.bmp")) { logoWidth = f.readUint16LE(); logoHeight = f.readUint16LE(); @@ -491,8 +489,7 @@ int32 Logic::fnPlayCredits(int32 *params) { char textLine[80]; - f.open("credits.clu"); - if (!f.isOpen()) { + if (!f.open("credits.clu")) { warning("Can't find credits.clu"); return IR_CONT; } diff --git a/sword2/resman.cpp b/sword2/resman.cpp index 7718f9426e..ee0162aa98 100644 --- a/sword2/resman.cpp +++ b/sword2/resman.cpp @@ -521,11 +521,8 @@ uint8 *ResourceManager::openResource(uint32 res, bool dump) { sprintf(buf, "dumps/%s-%d.dmp", tag, res); #endif - out.open(buf, ""); - - if (!out.isOpen()) { - out.open(buf, "", File::kFileWriteMode); - if (out.isOpen()) + if (!out.open(buf, "")) { + if (out.open(buf, "", File::kFileWriteMode)) out.write(_resList[res]->ad, len); } |