aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2005-09-02 11:24:16 +0000
committerGregory Montoir2005-09-02 11:24:16 +0000
commit14ac8d9d215dc3edbb4ca2084787a9281da355fd (patch)
tree816426825972812b1e8cec938e09919abf196dba
parent443cf756be85cce937c92b5051fe13b6a2ef189d (diff)
downloadscummvm-rg350-14ac8d9d215dc3edbb4ca2084787a9281da355fd.tar.gz
scummvm-rg350-14ac8d9d215dc3edbb4ca2084787a9281da355fd.tar.bz2
scummvm-rg350-14ac8d9d215dc3edbb4ca2084787a9281da355fd.zip
cleanup
svn-id: r18734
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/saveload.cpp2
-rw-r--r--scumm/script_v6.cpp2
-rw-r--r--scumm/script_v72he.cpp17
-rw-r--r--scumm/vars.cpp27
5 files changed, 22 insertions, 28 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 3c01f39ef5..c2e2e99add 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -958,7 +958,7 @@ protected:
virtual void decodeParseString(int a, int b);
void decodeScriptString(byte *dst, bool scriptString = false);
void copyScriptString(byte *dst, int dstSize);
- int convertFilePath(byte *dst, bool setFilePath = 0);
+ int convertFilePath(byte *dst, bool setFilePath = false);
int findObject(int x, int y, int num, int *args);
int getSoundResourceSize(int id);
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index e380423908..349fe5fd87 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -1088,7 +1088,7 @@ void ScummEngine_v90he::saveOrLoad(Serializer *s, uint32 savegameVersion) {
MKEND()
};
- _sprite->saveOrLoadSpriteData(&*s, savegameVersion);
+ _sprite->saveOrLoadSpriteData(s, savegameVersion);
s->saveLoadArrayOf(&_floodStateParams, 1, sizeof(_floodStateParams), floodStateEntries);
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 0ad4d32ded..2b57e971b9 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -1083,7 +1083,7 @@ void ScummEngine_v6::o6_startSound() {
// In Fatty Bear's Birthday Surprise the piano uses offsets 1 - 23 to
// indicate which note to play, but only when using the standard piano
- // sound. See also o6_soundOps()
+ // sound. See also o60_soundOps()
if (_heversion >= 61)
offset = pop();
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index db75697492..d400fb97a8 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -538,20 +538,13 @@ int ScummEngine_v72he::convertFilePath(byte *dst, bool setFilePath) {
}
if (setFilePath) {
- Common::File f;
- char filePath[256], newFilePath[256];
-
+ char filePath[256];
sprintf(filePath, "%s%s", _gameDataPath.c_str(), dst + r);
- if (f.exists(filePath)) {
- sprintf(newFilePath, "%s%s", _gameDataPath.c_str(), dst + r);
- } else {
- sprintf(newFilePath, "%s%s", _saveFileMan->getSavePath(), dst + r);
+ if (!Common::File::exists(filePath)) {
+ sprintf(filePath, "%s%s", _saveFileMan->getSavePath(), dst + r);
}
-
- len = resStrLen((const byte *)newFilePath);
- memcpy(dst, newFilePath, len);
- dst[len] = 0;
- debug(0, "convertFilePath: newFilePath is %s", newFilePath);
+ strcpy((char *)dst, filePath);
+ debug(0, "convertFilePath: filePath is %s", dst);
}
return r;
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 82d114d779..756eb6f340 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -600,13 +600,18 @@ void ScummEngine_v99he::initScummVars() {
#endif
void ScummEngine::initScummVars() {
-
if (_heversion < 70 && _version <= 6) {
switch (_midiDriver) {
- case MD_NULL: VAR(VAR_SOUNDCARD) = 0; break;
+ case MD_NULL:
+ VAR(VAR_SOUNDCARD) = 0;
+ break;
case MD_PCSPK:
- case MD_PCJR: VAR(VAR_SOUNDCARD) = 1; break;
- case MD_ADLIB: VAR(VAR_SOUNDCARD) = 3; break;
+ case MD_PCJR:
+ VAR(VAR_SOUNDCARD) = 1;
+ break;
+ case MD_ADLIB:
+ VAR(VAR_SOUNDCARD) = 3;
+ break;
default:
if ((_gameId == GID_MONKEY_EGA || _gameId == GID_MONKEY_VGA || _gameId == GID_LOOM)
&& (_platform == Common::kPlatformPC)) {
@@ -615,16 +620,12 @@ void ScummEngine::initScummVars() {
Common::File f;
for (int i = 82; i < 86; i++) {
sprintf(buf, "%d.LFL", i);
- f.open(buf);
- if (f.isOpen() == false)
+ if (!Common::File::exists(buf))
error("Native MIDI support requires Roland patch from LucasArts");
- f.close();
}
} else if (_gameId == GID_MONKEY_EGA) {
- Common::File f;
- f.open("DISK09.LEC");
- if (f.isOpen() == false)
- error("Native MIDI support requires Roland patch from LucasArts");
+ if (!Common::File::exists("DISK09.LEC"))
+ error("Native MIDI support requires Roland patch from LucasArts");
}
VAR(VAR_SOUNDCARD) = 4;
} else {
@@ -670,10 +671,10 @@ void ScummEngine::initScummVars() {
}
if (_version >= 4) {
VAR(VAR_HEAPSPACE) = 1400;
- VAR(VAR_FIXEDDISK) = true;
+ VAR(VAR_FIXEDDISK) = 1;
}
if (_version >= 5)
- VAR(VAR_MOUSEPRESENT) = true;
+ VAR(VAR_MOUSEPRESENT) = 1;
if (_version == 6)
VAR(VAR_V6_EMSSPACE) = 10000;
}