aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-01-11 16:53:33 +0000
committerTorbjörn Andersson2004-01-11 16:53:33 +0000
commit7309705db5e6994563d348f67e79f4b42bdff13f (patch)
treefb3b9cc394214e0efac36e83d7bfc04d4580fa60
parentefb03e002407a452577c7838ca3074abe1b07b24 (diff)
downloadscummvm-rg350-7309705db5e6994563d348f67e79f4b42bdff13f.tar.gz
scummvm-rg350-7309705db5e6994563d348f67e79f4b42bdff13f.tar.bz2
scummvm-rg350-7309705db5e6994563d348f67e79f4b42bdff13f.zip
cleanup
svn-id: r12322
-rw-r--r--sword1/music.cpp3
-rw-r--r--sword2/driver/d_sound.cpp3
-rw-r--r--sword2/function.cpp7
-rw-r--r--sword2/resman.cpp7
4 files changed, 6 insertions, 14 deletions
diff --git a/sword1/music.cpp b/sword1/music.cpp
index c002aed40d..911cfceb1d 100644
--- a/sword1/music.cpp
+++ b/sword1/music.cpp
@@ -85,8 +85,7 @@ int MusicHandle::readBuffer(int16 *buffer, const int numSamples) {
bool MusicHandle::play(const char *filename, bool loop) {
uint8 wavHeader[WAVEHEADERSIZE];
stop();
- _file.open(filename);
- if (!_file.isOpen()) {
+ if (!_file.open(filename)) {
warning("Music file %s could not be opened", filename);
return false;
}
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);
}