aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge
diff options
context:
space:
mode:
authoryinsimei2017-07-10 20:39:11 +0200
committerEugene Sandulenko2017-07-13 18:27:45 +0200
commit08304b848ad871e25353bf4fdd9c05182bc83fbf (patch)
tree0cbfbc217b4691828bf8947935c11c05ee03185d /engines/sludge
parented09887e84b7d50fdaed7b87a4c9927620bea6aa (diff)
downloadscummvm-rg350-08304b848ad871e25353bf4fdd9c05182bc83fbf.tar.gz
scummvm-rg350-08304b848ad871e25353bf4fdd9c05182bc83fbf.tar.bz2
scummvm-rg350-08304b848ad871e25353bf4fdd9c05182bc83fbf.zip
SLUDGE: use Common/debug instead of sludge debug
Diffstat (limited to 'engines/sludge')
-rw-r--r--engines/sludge/bg_effects.cpp1
-rw-r--r--engines/sludge/builtin.cpp1
-rw-r--r--engines/sludge/debug.cpp52
-rw-r--r--engines/sludge/debug.h33
-rw-r--r--engines/sludge/fileset.cpp1
-rw-r--r--engines/sludge/fonttext.cpp1
-rw-r--r--engines/sludge/freeze.cpp2
-rw-r--r--engines/sludge/loadsave.cpp3
-rw-r--r--engines/sludge/main_loop.cpp3
-rw-r--r--engines/sludge/module.mk1
-rw-r--r--engines/sludge/newfatal.cpp7
-rw-r--r--engines/sludge/newfatal.h1
-rw-r--r--engines/sludge/people.cpp1
-rw-r--r--engines/sludge/savedata.cpp3
-rw-r--r--engines/sludge/sound.cpp5
-rw-r--r--engines/sludge/sprbanks.cpp10
-rw-r--r--engines/sludge/sprites.cpp3
-rw-r--r--engines/sludge/variable.cpp1
18 files changed, 10 insertions, 119 deletions
diff --git a/engines/sludge/bg_effects.cpp b/engines/sludge/bg_effects.cpp
index 529556ef56..69299158c6 100644
--- a/engines/sludge/bg_effects.cpp
+++ b/engines/sludge/bg_effects.cpp
@@ -25,7 +25,6 @@
#include "sludge/allfiles.h"
#include "sludge/backdrop.h"
-#include "sludge/debug.h"
#include "sludge/graphics.h"
#include "sludge/moreio.h"
#include "sludge/newfatal.h"
diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp
index fc92161e3c..299ef35cf7 100644
--- a/engines/sludge/builtin.cpp
+++ b/engines/sludge/builtin.cpp
@@ -20,7 +20,6 @@
*
*/
-#include "sludge/debug.h"
#include "sludge/allfiles.h"
#include "sludge/sludger.h"
#include "sludge/builtin.h"
diff --git a/engines/sludge/debug.cpp b/engines/sludge/debug.cpp
deleted file mode 100644
index cbeb9967fb..0000000000
--- a/engines/sludge/debug.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "sludge/allfiles.h"
-#include "sludge/debug.h"
-#include "sludge/language.h"
-
-namespace Sludge {
-
-void debugOut(const char *a, ...) {
- if (! gameSettings.debugMode) return;
-
- va_list argptr;
- va_start(argptr, a);
-
-#if 0
-#if defined __unix__ && !(defined __APPLE__)
- vfprintf(stderr, a, argptr);
-#else
- FILE *fp = fopen("debuggy.txt", "at");
- if (fp) {
- vfprintf(fp, a, argptr);
- fclose(fp);
- }
-#endif
-#endif
-}
-
-void debugHeader() {
- debugOut("*** Engine compiled " __DATE__ " at " __TIME__ ".\n");
-}
-
-} // End of namespace Sludge
diff --git a/engines/sludge/debug.h b/engines/sludge/debug.h
deleted file mode 100644
index 9382b77c01..0000000000
--- a/engines/sludge/debug.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SLUDGE_DEBUG_H
-#define SLUDGE_DEBUG_H
-
-namespace Sludge {
-
-void debugOut(const char *a, ...);
-void debugHeader();
-
-} // End of namespace Sludge
-
-#endif
diff --git a/engines/sludge/fileset.cpp b/engines/sludge/fileset.cpp
index deb4a22147..c138bb5a89 100644
--- a/engines/sludge/fileset.cpp
+++ b/engines/sludge/fileset.cpp
@@ -23,7 +23,6 @@
#include "common/file.h"
#include "common/debug.h"
-#include "sludge/debug.h"
#include "sludge/stringy.h"
#include "sludge/allfiles.h"
#include "sludge/moreio.h"
diff --git a/engines/sludge/fonttext.cpp b/engines/sludge/fonttext.cpp
index 2c586e9ebc..b0324d301d 100644
--- a/engines/sludge/fonttext.cpp
+++ b/engines/sludge/fonttext.cpp
@@ -20,7 +20,6 @@
*
*/
-#include "sludge/debug.h"
#include "sludge/allfiles.h"
#include "sludge/stringy.h"
#include "sludge/sprites.h"
diff --git a/engines/sludge/freeze.cpp b/engines/sludge/freeze.cpp
index d3dde17bd5..2f8015787b 100644
--- a/engines/sludge/freeze.cpp
+++ b/engines/sludge/freeze.cpp
@@ -20,7 +20,6 @@
*
*/
#include "sludge/allfiles.h"
-#include "sludge/debug.h"
#include "sludge/graphics.h"
#include "sludge/newfatal.h"
#include "sludge/sprites.h"
@@ -82,7 +81,6 @@ void freezeGraphics() {
}
bool freeze() {
- debugOut("calling freeze()\n");
frozenStuffStruct *newFreezer = new frozenStuffStruct;
if (!checkNew(newFreezer))
return false;
diff --git a/engines/sludge/loadsave.cpp b/engines/sludge/loadsave.cpp
index d397092714..e9daa9b6b0 100644
--- a/engines/sludge/loadsave.cpp
+++ b/engines/sludge/loadsave.cpp
@@ -41,7 +41,6 @@
#include "sludge/statusba.h"
#include "sludge/sound.h"
#include "sludge/fileset.h"
-#include "sludge/debug.h"
#include "sludge/loadsave.h"
#include "sludge/bg_effects.h"
#include "sludge/thumbnail.h"
@@ -555,7 +554,7 @@ bool loadGame(char *fname) {
uint32 bytes_read = fp->read(&savedGameTime, sizeof(FILETIME));
if (bytes_read != sizeof(FILETIME) && fp->err()) {
- debugOut("Reading error in loadGame.\n");
+ warning("Reading error in loadGame.");
}
if (savedGameTime.dwLowDateTime != fileTime.dwLowDateTime || savedGameTime.dwHighDateTime != fileTime.dwHighDateTime) {
diff --git a/engines/sludge/main_loop.cpp b/engines/sludge/main_loop.cpp
index d0ec09855d..4fbdad5366 100644
--- a/engines/sludge/main_loop.cpp
+++ b/engines/sludge/main_loop.cpp
@@ -29,7 +29,6 @@
#include "graphics/surface.h"
#include "sludge/allfiles.h"
-#include "sludge/debug.h"
#include "sludge/language.h"
#include "sludge/stringy.h"
#include "sludge/sludger.h"
@@ -330,8 +329,6 @@ int main_loop(const char *filename)
Wait_Frame();
}
- debugOut("Bye!\n\n");
-
delete[] gamePath;
killSoundStuff();
diff --git a/engines/sludge/module.mk b/engines/sludge/module.mk
index fa1f3136bb..ac5529fb15 100644
--- a/engines/sludge/module.mk
+++ b/engines/sludge/module.mk
@@ -6,7 +6,6 @@ MODULE_OBJS := \
builtin.o \
console.o \
cursors.o \
- debug.o \
detection.o \
fileset.o \
floor.o \
diff --git a/engines/sludge/newfatal.cpp b/engines/sludge/newfatal.cpp
index 4e7519493f..d0e5184ef5 100644
--- a/engines/sludge/newfatal.cpp
+++ b/engines/sludge/newfatal.cpp
@@ -66,13 +66,6 @@ void displayFatal() {
}
}
-void warning(const Common::String &l) {
-#if 0
- setGraphicsWindow(false);
- msgBox("SLUDGE v" TEXT_VERSION " non-fatal indigestion report", l);
-#endif
-}
-
void registerWindowForFatal() {
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.";
}
diff --git a/engines/sludge/newfatal.h b/engines/sludge/newfatal.h
index bb22227f82..47d49e2cc8 100644
--- a/engines/sludge/newfatal.h
+++ b/engines/sludge/newfatal.h
@@ -36,7 +36,6 @@ int checkNew(const void *mem);
void displayFatal();
void registerWindowForFatal();
void setFatalInfo(const Common::String &userFunc, const Common::String &BIF);
-void warning(const Common::String &l);
void setResourceForFatal(int n);
const char *resourceNameFromNum(int i);
diff --git a/engines/sludge/people.cpp b/engines/sludge/people.cpp
index 98b913cbf3..43adbd9d98 100644
--- a/engines/sludge/people.cpp
+++ b/engines/sludge/people.cpp
@@ -35,7 +35,6 @@
#include "sludge/floor.h"
#include "sludge/zbuffer.h"
#include "sludge/sound.h"
-#include "sludge/debug.h"
#include "sludge/CommonCode/version.h"
#define ANGLEFIX (180.0 / 3.14157)
diff --git a/engines/sludge/savedata.cpp b/engines/sludge/savedata.cpp
index d1e3fa5e2d..081798f4d3 100644
--- a/engines/sludge/savedata.cpp
+++ b/engines/sludge/savedata.cpp
@@ -23,7 +23,6 @@
#include "common/file.h"
#include "sludge/allfiles.h"
-#include "sludge/debug.h"
#include "sludge/variable.h"
#include "sludge/newfatal.h"
#include "sludge/moreio.h"
@@ -109,7 +108,7 @@ char *readTextPlain(Common::File *fp) {
return NULL;
size_t bytes_read = fp->read(reply, stringSize);
if (bytes_read != stringSize && fp->err()) {
- debugOut("Reading error in readTextPlain.\n");
+ warning("Reading error in readTextPlain.");
}
fp->readByte(); // Skip the newline character
reply[stringSize] = 0;
diff --git a/engines/sludge/sound.cpp b/engines/sludge/sound.cpp
index 745c3a2a09..a92a51c174 100644
--- a/engines/sludge/sound.cpp
+++ b/engines/sludge/sound.cpp
@@ -32,7 +32,6 @@
#include "audio/mods/protracker.h"
#include "sludge/allfiles.h"
-#include "sludge/debug.h"
#include "sludge/newfatal.h"
#include "sludge/sound.h"
#include "sludge/moreio.h"
@@ -418,7 +417,7 @@ bool startSound(int f, bool loopy) {
Audio::AudioStream *stream = nullptr;
int a = makeSoundAudioStream(f, stream, loopy);
if (a == -1) {
- debugOut("Failed to cache sound!\n");
+ warning("Failed to cache sound!");
return false;
}
@@ -552,7 +551,7 @@ void playSoundList(soundList *s) {
Audio::AudioStream *stream;
int a = makeSoundAudioStream(s->sound, stream, false);
if (a == -1) {
- debugOut("Failed to cache sound!\n");
+ warning("Failed to cache sound!");
return;
}
diff --git a/engines/sludge/sprbanks.cpp b/engines/sludge/sprbanks.cpp
index bc2d0842bd..594ea5661a 100644
--- a/engines/sludge/sprbanks.cpp
+++ b/engines/sludge/sprbanks.cpp
@@ -20,11 +20,13 @@
*
*/
+#include "common/textconsole.h"
+
#include "sludge/allfiles.h"
+#include "sludge/sludge.h"
#include "sludge/sprites.h"
#include "sludge/sprbanks.h"
#include "sludge/newfatal.h"
-#include "sludge/debug.h"
namespace Sludge {
@@ -33,7 +35,6 @@ extern spriteBank theFont;
extern int loadedFontNum, fontTableSize;
loadedSpriteBank *loadBankForAnim(int ID) {
- //debugOut ("loadBankForAnim: Looking for sprite bank with ID %d\n", ID);
loadedSpriteBank *returnMe = allLoadedBanks;
while (returnMe) {
if (returnMe->ID == ID) {
@@ -43,17 +44,16 @@ loadedSpriteBank *loadBankForAnim(int ID) {
returnMe = returnMe->next;
}
returnMe = new loadedSpriteBank;
- //debugOut ("loadBankForAnim: No existing sprite bank with ID %d\n", ID);
if (checkNew(returnMe)) {
returnMe->ID = ID;
if (loadSpriteBank(ID, returnMe->bank, false)) {
returnMe->timesUsed = 0;
returnMe->next = allLoadedBanks;
allLoadedBanks = returnMe;
- debugOut("loadBankForAnim: New sprite bank created OK\n");
+ debug(kSludgeDebugDataLoad, "loadBankForAnim: New sprite bank created OK");
return returnMe;
} else {
- debugOut("loadBankForAnim: I guess I couldn't load the sprites...\n");
+ debug(kSludgeDebugDataLoad, "loadBankForAnim: I guess I couldn't load the sprites...");
return NULL;
}
} else
diff --git a/engines/sludge/sprites.cpp b/engines/sludge/sprites.cpp
index 660e580b28..9790193626 100644
--- a/engines/sludge/sprites.cpp
+++ b/engines/sludge/sprites.cpp
@@ -32,7 +32,6 @@
#include "sludge/backdrop.h"
#include "sludge/sludger.h"
#include "sludge/zbuffer.h"
-#include "sludge/debug.h"
#include "sludge/graphics.h"
#include "sludge/imgloader.h"
#include "sludge/sludge.h"
@@ -225,7 +224,7 @@ bool loadSpriteBank(int fileNum, spriteBank &loadhere, bool isFont) {
} else { // RAW DATA
size_t bytes_read = bigDataFile->read(data, picwidth * picheight);
if (bytes_read != picwidth * picheight && bigDataFile->err()) {
- debugOut("Reading error in loadSpriteBank.\n");
+ warning("Reading error in loadSpriteBank.");
}
}
}
diff --git a/engines/sludge/variable.cpp b/engines/sludge/variable.cpp
index a9f91d581f..9792dbf08c 100644
--- a/engines/sludge/variable.cpp
+++ b/engines/sludge/variable.cpp
@@ -22,7 +22,6 @@
#include "common/debug.h"
-#include "sludge/debug.h"
#include "sludge/allfiles.h"
#include "sludge/variable.h"
#include "sludge/moreio.h"