From a9ee51d6ce79a6510a6f11b090e167e1047dd60d Mon Sep 17 00:00:00 2001 From: Simei Yin Date: Mon, 21 Aug 2017 09:10:41 +0200 Subject: [PATCH] SLUDGE: Some code cleaning --- engines/sludge/main_loop.cpp | 2 -- engines/sludge/moreio.cpp | 1 - engines/sludge/newfatal.cpp | 4 ---- engines/sludge/newfatal.h | 1 - engines/sludge/sludger.cpp | 11 ----------- engines/sludge/variable.cpp | 8 -------- 6 files changed, 27 deletions(-) diff --git a/engines/sludge/main_loop.cpp b/engines/sludge/main_loop.cpp index 4524d023043..d00f6e42c42 100644 --- a/engines/sludge/main_loop.cpp +++ b/engines/sludge/main_loop.cpp @@ -57,8 +57,6 @@ int main_loop(Common::String filename) { g_sludge->_gfxMan->init(); - registerWindowForFatal(); - g_sludge->_gfxMan->blankAllScreen(); if (!initPeople()) return fatal("Couldn't initialise people stuff"); diff --git a/engines/sludge/moreio.cpp b/engines/sludge/moreio.cpp index 4a57000549b..1512574207d 100644 --- a/engines/sludge/moreio.cpp +++ b/engines/sludge/moreio.cpp @@ -46,7 +46,6 @@ Common::String readString(Common::SeekableReadStream *stream) { for (int a = 0; a < len; a++) { res += (char)(stream->readByte() - 1); } - debugC(3, kSludgeDebugDataLoad, "Read string of length %i: %s", len, res.c_str()); return res; } diff --git a/engines/sludge/newfatal.cpp b/engines/sludge/newfatal.cpp index 673fc023c86..70f6bd92099 100644 --- a/engines/sludge/newfatal.cpp +++ b/engines/sludge/newfatal.cpp @@ -53,10 +53,6 @@ bool hasFatal() { return false; } -void registerWindowForFatal() { - g_sludge->fatalInfo = "There's an error with this SLUDGE game! If you're designing this game, please turn on verbose error messages in the project manager and recompile. If not, please contact the author saying where and how this problem occured."; -} - int inFatal(const Common::String &str) { g_sludge->_soundMan->killSoundStuff(); error("%s", str.c_str()); diff --git a/engines/sludge/newfatal.h b/engines/sludge/newfatal.h index eb65db065b0..fc91110758f 100644 --- a/engines/sludge/newfatal.h +++ b/engines/sludge/newfatal.h @@ -33,7 +33,6 @@ bool hasFatal(); int fatal(const Common::String &str); int fatal(const Common::String &str1, const Common::String &str2); int checkNew(const void *mem); -void registerWindowForFatal(); void setFatalInfo(const Common::String &userFunc, const Common::String &BIF); void setResourceForFatal(int n); const Common::String resourceNameFromNum(int i); diff --git a/engines/sludge/sludger.cpp b/engines/sludge/sludger.cpp index a63b8b9923e..91c78b08f08 100644 --- a/engines/sludge/sludger.cpp +++ b/engines/sludge/sludger.cpp @@ -405,27 +405,16 @@ bool continueFunction(LoadedFunction *fun) { return true; } -// if (numBIFNames) newDebug ("*** Function:", allUserFunc[fun->originalNumber]); - - //debugOut ("SLUDGER: continueFunction\n"); - while (keepLooping) { advanceNow = true; debugC(1, 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); -// newDebug ( -// (com < numSludgeCommands) ? sludgeText[com] : "Unknown SLUDGE machine code", -// param); } - //debugOut ("SLUDGER: continueFunction - in da loop: %s\n", sludgeText[com]); - switch (com) { case SLU_RETURN: if (fun->calledBy) { diff --git a/engines/sludge/variable.cpp b/engines/sludge/variable.cpp index fb4f1910253..510c6f46079 100644 --- a/engines/sludge/variable.cpp +++ b/engines/sludge/variable.cpp @@ -430,14 +430,6 @@ bool makeFastArrayFromStack(Variable &to, const StackHandler *stacky) { return true; } -/* - bool moveVariable (Variable & from, Variable & to) { - unlinkVar (to); - memcpy (& to, & from, sizeof (variable)); - from.varType = SVT_NULL; - } - */ - bool addVarToStack(const Variable &va, VariableStack *&thisStack) { VariableStack *newStack = new VariableStack; if (!checkNew(newStack))