aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryinsimei2017-06-28 16:30:05 +0200
committerEugene Sandulenko2017-07-13 18:27:45 +0200
commite7a22b59f86f40241a29ec24019ea27811deb1ab (patch)
tree8ff06d1ecc91854563af409b71a1b15222a39c98
parent279a53302ad27902c2e90b9ae73a42fbfe414c24 (diff)
downloadscummvm-rg350-e7a22b59f86f40241a29ec24019ea27811deb1ab.tar.gz
scummvm-rg350-e7a22b59f86f40241a29ec24019ea27811deb1ab.tar.bz2
scummvm-rg350-e7a22b59f86f40241a29ec24019ea27811deb1ab.zip
SLUDGE: add several debug infos and exit when error
-rw-r--r--engines/sludge/fileset.cpp6
-rw-r--r--engines/sludge/newfatal.cpp5
-rw-r--r--engines/sludge/sludger.cpp8
3 files changed, 8 insertions, 11 deletions
diff --git a/engines/sludge/fileset.cpp b/engines/sludge/fileset.cpp
index 0a68f7a5b2..deb4a22147 100644
--- a/engines/sludge/fileset.cpp
+++ b/engines/sludge/fileset.cpp
@@ -226,15 +226,15 @@ void setFileIndices(Common::File *fp, int numLanguages, unsigned int skipBefore)
startOfSubIndex = fp->pos() + 4;
fp->seek(fp->readUint32LE(), SEEK_CUR);
- debug(kSludgeDebugDataLoad, "startOfSubIndex: %i", startOfTextIndex);
+ debug(kSludgeDebugDataLoad, "startOfSubIndex: %i", startOfSubIndex);
startOfObjectIndex = fp->pos() + 4;
fp->seek(fp->readUint32LE(), SEEK_CUR);
- debug(kSludgeDebugDataLoad, "startOfObjectIndex: %i", startOfTextIndex);
+ debug(kSludgeDebugDataLoad, "startOfObjectIndex: %i", startOfObjectIndex);
// Remember that the data section starts here
startOfDataIndex = fp->pos();
- debug(kSludgeDebugDataLoad, "startOfDataIndex: %i", startOfTextIndex);
+ debug(kSludgeDebugDataLoad, "startOfDataIndex: %i", startOfDataIndex);
}
} // End of namespace Sludge
diff --git a/engines/sludge/newfatal.cpp b/engines/sludge/newfatal.cpp
index a44290ab36..8bafd1fcf2 100644
--- a/engines/sludge/newfatal.cpp
+++ b/engines/sludge/newfatal.cpp
@@ -91,13 +91,15 @@ extern SDL_Event quit_event;
#endif
int inFatal(const char *str) {
+ error(str);
+ delete []str;
#if 0
FILE *fatFile = fopen("fatal.txt", "wt");
if (fatFile) {
fprintf(fatFile, "FATAL:\n%s\n", str);
fclose(fatFile);
}
-#endif
+
fatalMessage = copyString(str);
if (fatalMessage == NULL)
fatalMessage = copyString("Out of memory");
@@ -108,7 +110,6 @@ int inFatal(const char *str) {
EGL_Close();
#endif
-#if 0
SDL_Quit();
atexit(displayFatal);
diff --git a/engines/sludge/sludger.cpp b/engines/sludge/sludger.cpp
index cf2a0539a1..cc30de2031 100644
--- a/engines/sludge/sludger.cpp
+++ b/engines/sludge/sludger.cpp
@@ -850,18 +850,14 @@ bool continueFunction(loadedFunction *fun) {
while (keepLooping) {
advanceNow = true;
+ debug(kSludgeDebugStackMachine, "Executing command line %i : ", fun->runThisLine);
param = fun->compiledLines[fun->runThisLine].param;
com = fun->compiledLines[fun->runThisLine].theCommand;
// fprintf (stderr, "com: %d param: %d (%s)\n", com, param,
// (com < numSludgeCommands) ? sludgeText[com] : ERROR_UNKNOWN_MCODE); fflush(stderr);
if (numBIFNames) {
- setFatalInfo(
- (fun->originalNumber < numUserFunc) ?
- allUserFunc[fun->originalNumber] :
- "Unknown user function",
- (com < numSludgeCommands) ?
- sludgeText[com] : ERROR_UNKNOWN_MCODE);
+ setFatalInfo((fun->originalNumber < numUserFunc) ? allUserFunc[fun->originalNumber] : "Unknown user function", (com < numSludgeCommands) ? sludgeText[com] : ERROR_UNKNOWN_MCODE);
// newDebug (
// (com < numSludgeCommands) ? sludgeText[com] : "Unknown SLUDGE machine code",
// param);