SLUDGE: use Common/debug instead of sludge debug
This commit is contained in:
parent
ed09887e84
commit
08304b848a
18 changed files with 10 additions and 119 deletions
|
@ -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"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "sludge/debug.h"
|
||||
#include "sludge/allfiles.h"
|
||||
#include "sludge/sludger.h"
|
||||
#include "sludge/builtin.h"
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "sludge/debug.h"
|
||||
#include "sludge/allfiles.h"
|
||||
#include "sludge/stringy.h"
|
||||
#include "sludge/sprites.h"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -6,7 +6,6 @@ MODULE_OBJS := \
|
|||
builtin.o \
|
||||
console.o \
|
||||
cursors.o \
|
||||
debug.o \
|
||||
detection.o \
|
||||
fileset.o \
|
||||
floor.o \
|
||||
|
|
|
@ -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.";
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "common/debug.h"
|
||||
|
||||
#include "sludge/debug.h"
|
||||
#include "sludge/allfiles.h"
|
||||
#include "sludge/variable.h"
|
||||
#include "sludge/moreio.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue