aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2006-03-08 11:37:25 +0000
committerMax Horn2006-03-08 11:37:25 +0000
commitd9a9fac93761a06e78fe7e7091ae5a888c1260f2 (patch)
tree62da9040abb98b0b49c0ba8a14777f32c6452c4f /engines/scumm
parent14f1337c602a1823d2be26fe5b48bc4722aca681 (diff)
downloadscummvm-rg350-d9a9fac93761a06e78fe7e7091ae5a888c1260f2.tar.gz
scummvm-rg350-d9a9fac93761a06e78fe7e7091ae5a888c1260f2.tar.bz2
scummvm-rg350-d9a9fac93761a06e78fe7e7091ae5a888c1260f2.zip
Fixed tons of format string warnings for debug/error calls (including several errors where the format string didn't match the number of arguments to the call)
svn-id: r21141
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/akos.cpp6
-rw-r--r--engines/scumm/he/resource_he.cpp1
-rw-r--r--engines/scumm/he/script_v72he.cpp2
-rw-r--r--engines/scumm/he/script_v90he.cpp2
-rw-r--r--engines/scumm/resource.cpp42
-rw-r--r--engines/scumm/scumm.cpp4
6 files changed, 50 insertions, 7 deletions
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index 6694892682..915965608c 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -220,7 +220,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
akst += 8;
}
if (!found) {
- error("Sequence not found in actor %p costume %d", a, a->_costume);
+ error("Sequence not found in actor %p costume %d", (void *)a, a->_costume);
}
}
}
@@ -251,7 +251,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
aksf += 6;
}
if (!found) {
- error("Sequence not found in actor %p costume %d", a, a->_costume);
+ error("Sequence not found in actor %p costume %d", (void *)a, a->_costume);
}
}
}
@@ -275,7 +275,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
akst += 8;
}
if (!found) {
- error("Sequence not found in actor %p costume %d", a, a->_costume);
+ error("Sequence not found in actor %p costume %d", (void *)a, a->_costume);
}
}
}
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index 3d99325db9..931c946965 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -164,7 +164,6 @@ int Win32ResExtractor::extractResource_(const char *resType, char *resName, byte
if (_vm->_substResFileName.almostGameID != 0) {
char buf1[128];
-
_vm->generateSubstResFileName(_fileName, buf1, sizeof(buf1));
strcpy(_fileName, buf1);
}
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 9c1dcf7c0b..2948b0fdfa 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -2128,7 +2128,7 @@ void ScummEngine_v72he::copyArrayHelper(ArrayHeader *ah, int idx2, int idx1, int
*data = ah->data + offset * 4;
break;
default:
- error("Invalid array type", FROM_LE_32(ah->type));
+ error("Invalid array type %d", FROM_LE_32(ah->type));
}
}
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index 2f6d0569c2..a77373790e 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -2303,7 +2303,7 @@ void ScummEngine_v90he::sortArray(int array, int dim2start, int dim2end, int dim
}
break;
default:
- error("Invalid array type", FROM_LE_32(ah->type));
+ error("Invalid array type %d", FROM_LE_32(ah->type));
}
}
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 2acd6ae233..60b04f18ae 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -62,6 +62,48 @@ static bool checkTryMedia(BaseScummFile *handle);
#endif
+#if 0
+Common::String generateFilename(int room, int diskNumber) {
+ char buf[128];
+
+ if (_game.version == 4) {
+ if (room == 0 || room >= 900) {
+ sprintf(buf, "%.3d.lfl", room);
+ } else {
+ sprintf(buf, "disk%.2d.lec", diskNumber);
+ }
+ } else if (_game.heversion >= 98) {
+ char c;
+ int disk = 0;
+ if (_heV7DiskOffsets)
+ disk = _heV7DiskOffsets[room];
+
+ switch(disk) {
+ case 2:
+ c = 'b';
+ break;
+ case 1:
+ c = 'a';
+ break;
+ default:
+ c = '0';
+ }
+ sprintf(buf, _substEntry.formatStr, c);
+
+ } else if (_substEntry.method == kGenDiskNum) {
+ sprintf(buf, _substEntry.formatStr, diskNumber);
+
+ } else if (_substEntry.method == kGenRoomNum) {
+ sprintf(buf, _substEntry.formatStr, room);
+
+ } else {
+ error("FOO");
+ }
+
+ return buf;
+}
+#endif
+
/* Open a room */
void ScummEngine::openRoom(const int room) {
bool result;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index f077149fee..b28b3a1cb6 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1606,7 +1606,9 @@ void ScummEngine_v99he::scummInit() {
memset(_hePalettes, 0, (_numPalettes + 1) * 1024);
// Array 129 is set to base name
- int len = resStrLen((const byte *)_baseName.c_str()) + 1;
+ // FIXME: Of course, we probably would want to insert the value
+ // *after* applying the filename substitution here... ?
+ int len = _baseName.size() + 1;
ArrayHeader *ah = defineArray(129, kStringArray, 0, 0, 0, len);
memcpy(ah->data, _baseName.c_str(), len);