Skip to content

Commit

Permalink
SLUDGE: remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
yinsimei authored and sev- committed Jul 13, 2017
1 parent 800987a commit 1cd6de2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 81 deletions.
15 changes: 0 additions & 15 deletions engines/sludge/loadsave.cpp
Expand Up @@ -227,14 +227,6 @@ stackHandler *loadStackRef(Common::SeekableReadStream *stream) {
// For saving and loading variables...
//----------------------------------------------------------------------
bool saveVariable(variable *from, Common::WriteStream *stream) {
#if DEBUG_STACKINESS
{
char *str = getTextFromAnyVar(*from);
stackDebug((stackfp, "in saveVariable, type %d, %s\n", from->varType, str));
delete str;
}
#endif

stream->writeByte(from->varType);
switch (from->varType) {
case SVT_INT:
Expand Down Expand Up @@ -286,13 +278,6 @@ bool loadVariable(variable *to, Common::SeekableReadStream *stream) {

case SVT_STACK:
to->varData.theStack = loadStackRef(stream);
#if DEBUG_STACKINESS
{
char *str = getTextFromAnyVar(*to);
stackDebug((stackfp, "just loaded %s\n", str));
delete str;
}
#endif
return true;

case SVT_COSTUME:
Expand Down
16 changes: 1 addition & 15 deletions engines/sludge/people.cpp
Expand Up @@ -1001,21 +1001,7 @@ bool loadAnim(personaAnimation *p, Common::SeekableReadStream *stream) {
}
return true;
}
/*
void debugCostume (char * message, persona * cossy) {
FILE * db = fopen ("debuTURN.txt", "at");
fprintf (db, " %s costume with %i directions...\n", message, cossy->numDirections);
for (int a = 0; a < cossy->numDirections * 3; a++) {
fprintf (db, " %i frames:", cossy->animation[a]->numFrames);
for (int b = 0; b < cossy->animation[a]->numFrames; b ++) {
fprintf (db, " %i", cossy->animation[a]->frames[b]);
}
fprintf (db, "\n");
}
fclose (db);
}
*/

bool saveCostume(persona *cossy, Common::WriteStream *stream) {
int a;
stream->writeUint16BE(cossy->numDirections);
Expand Down
19 changes: 0 additions & 19 deletions engines/sludge/savedata.cpp
Expand Up @@ -37,25 +37,6 @@ char encode2 = 0;

extern Common::String gamePath;

/*
void loadSaveDebug (char * com) {
FILE * ffpp = fopen ("debuggy.txt", "at");
fprintf (ffpp, "%s\n", com);
fclose (ffpp);
}
void loadSaveDebug (char com) {
FILE * ffpp = fopen ("debuggy.txt", "at");
fprintf (ffpp, "%c\n", com);
fclose (ffpp);
}
void loadSaveDebug (int com) {
FILE * ffpp = fopen ("debuggy.txt", "at");
fprintf (ffpp, "%d\n", com);
fclose (ffpp);
}
*/
void writeStringEncoded(const Common::String &s, Common::WriteStream *stream) {
int len = s.size();

Expand Down
32 changes: 0 additions & 32 deletions engines/sludge/variable.cpp
Expand Up @@ -37,8 +37,6 @@ const char *typeName[] = { "undefined", "number", "user function", "string",
"built-in function", "file", "stack", "object type", "animation",
"costume" };

extern char *outputDir;

void unlinkVar(variable &thisVar) {
switch (thisVar.varType) {
case SVT_STRING:
Expand Down Expand Up @@ -184,43 +182,14 @@ bool copyStack(const variable &from, variable &to) {
to.varData.theStack->timesUsed = 1;
variableStack *a = from.varData.theStack->first;

#if DEBUG_STACKINESS
{
char *str = getTextFromAnyVar(from);
stackDebug((stackfp, "in copyStack, copying %s\n", str));
delete[] str;
}
#endif

while (a) {
addVarToStack(a->thisVar, to.varData.theStack->first);
if (to.varData.theStack->last == NULL) {
#if DEBUG_STACKINESS
stackDebug((stackfp, "LAST"));
#endif
to.varData.theStack->last = to.varData.theStack->first;
}

#if DEBUG_STACKINESS
{
char *str = getTextFromAnyVar(a->thisVar);
stackDebug((stackfp, "\ta->thisVar = %s (%p)\n", str, to.varData.theStack->first));
delete[] str;
}
#endif

a = a->next;
}

#if DEBUG_STACKINESS
{
char *str = getTextFromAnyVar(to);
stackDebug((stackfp, "finished copy, got %s\n", str));
delete[] str;
stackDebug((stackfp, "first = %p\n", to.varData.theStack->first));
stackDebug((stackfp, "last = %p\n", to.varData.theStack->last));
}
#endif
return true;
}

Expand Down Expand Up @@ -260,7 +229,6 @@ int compareVars(const variable &var1, const variable &var2) {
break;

case SVT_STRING:

re = (strcmp(var1.varData.theString, var2.varData.theString) == 0);
break;

Expand Down

0 comments on commit 1cd6de2

Please sign in to comment.