aboutsummaryrefslogtreecommitdiff
path: root/gob
diff options
context:
space:
mode:
authorMax Horn2005-04-09 19:32:29 +0000
committerMax Horn2005-04-09 19:32:29 +0000
commit2efa0d17f29f015a176669d4ec4615e469b802fb (patch)
treef3d6c84194fa892d445abd38a97816652914bc7c /gob
parent9aaff636aad78681650909f5a08decba2cd40283 (diff)
downloadscummvm-rg350-2efa0d17f29f015a176669d4ec4615e469b802fb.tar.gz
scummvm-rg350-2efa0d17f29f015a176669d4ec4615e469b802fb.tar.bz2
scummvm-rg350-2efa0d17f29f015a176669d4ec4615e469b802fb.zip
Get rid of debug.cpp/.h -- it wasn't used anyway, and contained bad code (open/write/close to access a log file? yuck)
svn-id: r17486
Diffstat (limited to 'gob')
-rw-r--r--gob/dataio.cpp1
-rw-r--r--gob/debug.cpp184
-rw-r--r--gob/debug.h41
-rw-r--r--gob/draw.cpp2
-rw-r--r--gob/game.cpp2
-rw-r--r--gob/goblin.cpp1
-rw-r--r--gob/init.cpp1
-rw-r--r--gob/inter.cpp2
-rw-r--r--gob/map.cpp2
-rw-r--r--gob/module.mk1
-rw-r--r--gob/mult.cpp1
-rw-r--r--gob/pack.cpp1
-rw-r--r--gob/palanim.cpp1
-rw-r--r--gob/parse.cpp1
-rw-r--r--gob/resource.cpp1
-rw-r--r--gob/scenery.cpp3
-rw-r--r--gob/sound.cpp1
-rw-r--r--gob/timer.cpp1
-rw-r--r--gob/util.cpp11
-rw-r--r--gob/video.cpp5
20 files changed, 12 insertions, 251 deletions
diff --git a/gob/dataio.cpp b/gob/dataio.cpp
index 4163b6ab15..84a09c97e7 100644
--- a/gob/dataio.cpp
+++ b/gob/dataio.cpp
@@ -22,7 +22,6 @@
#include "gob/gob.h"
#include "gob/global.h"
#include "gob/dataio.h"
-#include "gob/debug.h"
#include "gob/pack.h"
namespace Gob {
diff --git a/gob/debug.cpp b/gob/debug.cpp
deleted file mode 100644
index 7ad49bb1c0..0000000000
--- a/gob/debug.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2004 Ivan Dubrov
- * Copyright (C) 2004-2005 The ScummVM project
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Header$
- *
- */
-#include "gob/gob.h"
-#include "gob/debug.h"
-#include "gob/scenery.h"
-
-namespace Gob {
-
-static int16 logFile = -2;
-static char buf[STRINGBUFLEN];
-
-extern uint32 always0_dword_23EC_560;
-
-static void log_close(void) {
- if (logFile != -2)
- close(logFile);
- logFile = -2;
-}
-
-static void log_init(void) {
- if (logFile == -2) {
- logFile = open(LOG_NAME, O_WRONLY | O_CREAT);
- if (logFile != -1)
- atexit(&log_close);
- }
-}
-
-void log_write(const char *format, ...) {
- va_list lst;
- va_start(lst, format);
-
- log_init();
- if (logFile >= 0) {
- vsnprintf(buf, STRINGBUFLEN, format, lst);
- write(logFile, buf, strlen(buf));
- }
-
- va_end(lst);
-}
-
-void dbg_printInt(int16 val) {
- log_write("dbg_printInt: %d\n", val);
-}
-
-void dbg_printPtr(void *ptr) {
- log_write("dbg_printPtr: %p\n", ptr);
-}
-
-void dbg_printStr(char *str) {
- log_write("dbg_printStr: ");
- log_write(str);
- log_write("\n");
-}
-
-void dbg_dumpMem(char *ptr, int16 size) {
- int16 i;
- log_write("dbg_dumpMem %p %d:", ptr, size);
- for (i = 0; i < size; i++)
- log_write("%02x ", (uint16)(byte)ptr[i]);
- log_write("\n");
-}
-
-void dbg_dumpMemChars(char *ptr, int16 size) {
- int16 i;
- log_write("dbg_dumpMem %p %ld:", ptr, size);
- for (i = 0; i < size; i++)
- log_write("%c ", ptr[i]);
- log_write("\n");
-}
-
-void dbg_printDelim() {
- log_write("-------------------\n");
-}
-
-void dbg_printHexInt(int16 val) {
- log_write("%02x\n", val);
-}
-
-void dbg_dumpStaticScenery(Scen_Static * st) {
- int16 i, j;
- Scen_StaticPlane *ptr;
-
- log_write("dbg_dumpStaticScenery\n");
- log_write("----------\n");
- log_write("Layers count = %d\n", st->layersCount);
-
- for (i = 0; i < st->layersCount; i++) {
- log_write("Layer %d:\n", i);
- log_write("Back sprite resource id = %d\n",
- st->layers[i]->backResId);
- log_write("Plane count = %d\n", st->layers[i]->planeCount);
-
- for (j = 0; j < st->layers[i]->planeCount; j++) {
- ptr = &st->layers[i]->planes[j];
- log_write
- ("Plane %d: pictIndex = %d, pieceIndex = %d, drawOrder = %d\n",
- j, (int16)ptr->pictIndex, (int16)ptr->pieceIndex,
- (int16)ptr->drawOrder);
-
- log_write
- ("destX = %d, destY = %d, transparency = %d\n",
- ptr->destX, ptr->destY, ptr->transp);
- }
- }
- log_write("----------\n\n");
-}
-
-int16 calcDest(char dest, byte add) {
- if (dest >= 0)
- return dest + ((uint16)add << 7);
- else
- return dest - ((uint16)add << 7);
-}
-
-/*
-void dbg_dumpFramePiece(Scen_AnimFramePiece* piece, int16 j, Scen_AnimLayer* layer) {
- log_write("Piece for %d anim, %p: ", j, piece);
- log_write("pictIndex = %x, pieceIndex = %d, destX = %d, destY = %d, not final = %d\n",
- (uint16)piece->pictIndex,
- (uint16)piece->pieceIndex,
- layer->deltaX+calcDest(piece->destX, (char)((piece->pictIndex & 0xc0)>>6)),
- layer->deltaY+calcDest(piece->destY, (char)((piece->pictIndex & 0x30)>>4)),
- (int16)piece->notFinal);
-}
-
-void dbg_dumpAnimation(Scen_Animation* anim) {
- int16 i, j;
- Scen_AnimLayer* layer;
- Scen_AnimFramePiece* piece;
-
- log_write("dbg_dumpAnimation\n");
- log_write("----------\n");
- log_write("Layers count = %d\n", anim->layersCount);
-
- for(i = 0; i < anim->layersCount; i++)
- {
- layer = anim->layers[i];
-
- log_write("Layer %d:\n", i);
-
- log_write("unknown0 = %d\n", layer->unknown0);
- log_write("deltaX = %d\n", layer->deltaX);
- log_write("deltaY = %d\n", layer->deltaY);
- log_write("unknown1 = %d\n", layer->unknown1);
- log_write("unknown2 = %d\n", layer->unknown2);
- log_write("transparency = %d\n", (int16)layer->transp);
- log_write("animsCount %d\n", layer->framesCount);
-
- piece = layer->frames;
- j = 0;
- while(j < layer->framesCount)
- {
- dbg_dumpFramePiece(piece, j, layer);
- if(piece->notFinal != 1)
- j++;
- piece++;
- }
- }
-
- log_write("----------\n\n");
-}
-
-*/
-
-} // End of namespace Gob
diff --git a/gob/debug.h b/gob/debug.h
deleted file mode 100644
index a26c00f3bc..0000000000
--- a/gob/debug.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2004 Ivan Dubrov
- * Copyright (C) 2004-2005 The ScummVM project
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Header$
- *
- */
-#ifndef GOB_DEBUG_H
-#define GOB_DEBUG_H
-
-#define LOG_NAME "log.txt"
-
-#include "scenery.h"
-
-namespace Gob {
-
-void log_write(const char *format, ...);
-
-void dbg_dumpMem(char *ptr, int16 size);
-
-void dbg_dumpAnimation(Scen_Animation *anim);
-void dbg_dumpFramePiece(Scen_AnimFramePiece *piece, int16 j,
- Scen_AnimLayer *layer);
-
-} // End of namespace Gob
-
-#endif
diff --git a/gob/draw.cpp b/gob/draw.cpp
index e3e8447bbb..01565245fe 100644
--- a/gob/draw.cpp
+++ b/gob/draw.cpp
@@ -25,7 +25,7 @@
#include "gob/video.h"
#include "gob/game.h"
#include "gob/util.h"
-#include "gob/debug.h"
+#include "gob/scenery.h"
#include "gob/inter.h"
#include "gob/video.h"
#include "gob/palanim.h"
diff --git a/gob/game.cpp b/gob/game.cpp
index adcc67d4f5..4efac9c9d9 100644
--- a/gob/game.cpp
+++ b/gob/game.cpp
@@ -25,7 +25,7 @@
#include "gob/video.h"
#include "gob/dataio.h"
#include "gob/pack.h"
-#include "gob/debug.h"
+#include "gob/scenery.h"
#include "gob/inter.h"
#include "gob/parse.h"
#include "gob/draw.h"
diff --git a/gob/goblin.cpp b/gob/goblin.cpp
index a42a5f7923..9f2863dc2c 100644
--- a/gob/goblin.cpp
+++ b/gob/goblin.cpp
@@ -21,7 +21,6 @@
*/
#include "gob/gob.h"
#include "gob/goblin.h"
-#include "gob/debug.h"
#include "gob/inter.h"
#include "gob/global.h"
#include "gob/draw.h"
diff --git a/gob/init.cpp b/gob/init.cpp
index 4e53409221..cf41be4d01 100644
--- a/gob/init.cpp
+++ b/gob/init.cpp
@@ -25,7 +25,6 @@
#include "gob/global.h"
#include "gob/init.h"
#include "gob/video.h"
-#include "gob/debug.h"
#include "gob/sound.h"
#include "gob/timer.h"
#include "gob/sound.h"
diff --git a/gob/inter.cpp b/gob/inter.cpp
index b2a00274ca..424b1312e5 100644
--- a/gob/inter.cpp
+++ b/gob/inter.cpp
@@ -23,7 +23,7 @@
#include "gob/global.h"
#include "gob/inter.h"
#include "gob/util.h"
-#include "gob/debug.h"
+#include "gob/scenery.h"
#include "gob/parse.h"
#include "gob/game.h"
#include "gob/draw.h"
diff --git a/gob/map.cpp b/gob/map.cpp
index 692f097edb..84d4cdf236 100644
--- a/gob/map.cpp
+++ b/gob/map.cpp
@@ -27,7 +27,7 @@
#include "gob/inter.h"
#include "gob/goblin.h"
#include "gob/sound.h"
-#include "gob/debug.h"
+#include "gob/scenery.h"
namespace Gob {
diff --git a/gob/module.mk b/gob/module.mk
index 4c45beb67c..fc3d1a43b6 100644
--- a/gob/module.mk
+++ b/gob/module.mk
@@ -3,7 +3,6 @@ MODULE := gob
MODULE_OBJS := \
gob/anim.o \
gob/dataio.o \
- gob/debug.o \
gob/draw.o \
gob/driver_vga.o \
gob/game.o \
diff --git a/gob/mult.cpp b/gob/mult.cpp
index 734ab37841..f7d17fb72b 100644
--- a/gob/mult.cpp
+++ b/gob/mult.cpp
@@ -29,7 +29,6 @@
#include "gob/inter.h"
#include "gob/parse.h"
#include "gob/global.h"
-#include "gob/debug.h"
#include "gob/sound.h"
#include "gob/palanim.h"
#include "gob/game.h"
diff --git a/gob/pack.cpp b/gob/pack.cpp
index 53d6ae0366..17601fbec5 100644
--- a/gob/pack.cpp
+++ b/gob/pack.cpp
@@ -21,7 +21,6 @@
*/
#include "gob/gob.h"
#include "gob/pack.h"
-#include "gob/debug.h"
namespace Gob {
diff --git a/gob/palanim.cpp b/gob/palanim.cpp
index 7841473673..8fb9c9094d 100644
--- a/gob/palanim.cpp
+++ b/gob/palanim.cpp
@@ -24,7 +24,6 @@
#include "gob/util.h"
#include "gob/global.h"
#include "gob/palanim.h"
-#include "gob/debug.h"
namespace Gob {
diff --git a/gob/parse.cpp b/gob/parse.cpp
index 9e3ac335a9..7e3b054a7c 100644
--- a/gob/parse.cpp
+++ b/gob/parse.cpp
@@ -23,7 +23,6 @@
#include "gob/global.h"
#include "gob/parse.h"
#include "gob/util.h"
-#include "gob/debug.h"
#include "gob/inter.h"
namespace Gob {
diff --git a/gob/resource.cpp b/gob/resource.cpp
index 6eb8f84b32..7b759577b0 100644
--- a/gob/resource.cpp
+++ b/gob/resource.cpp
@@ -23,7 +23,6 @@
#include "gob/global.h"
#include "gob/video.h"
#include "gob/resource.h"
-#include "gob/debug.h"
namespace Gob {
diff --git a/gob/scenery.cpp b/gob/scenery.cpp
index a3c907e36c..101c4bfd30 100644
--- a/gob/scenery.cpp
+++ b/gob/scenery.cpp
@@ -21,7 +21,6 @@
*/
#include "gob/gob.h"
#include "gob/scenery.h"
-#include "gob/debug.h"
#include "gob/inter.h"
#include "gob/video.h"
#include "gob/draw.h"
@@ -729,7 +728,7 @@ void scen_interStoreParams(void) {
int16 layer;
int16 var;
- log_write("scen_interStoreParams: Storing...\n");
+ warning("scen_interStoreParams: Storing...");
inter_evalExpr(&animation);
inter_evalExpr(&layer);
diff --git a/gob/sound.cpp b/gob/sound.cpp
index 4882b7bb0f..b724bb3c0e 100644
--- a/gob/sound.cpp
+++ b/gob/sound.cpp
@@ -21,7 +21,6 @@
*/
#include "gob/gob.h"
#include "gob/global.h"
-#include "gob/debug.h"
#include "gob/sound.h"
namespace Gob {
int16 snd_checkProAudio(void) {return 0;}
diff --git a/gob/timer.cpp b/gob/timer.cpp
index db8a725a0a..b75e9db3ed 100644
--- a/gob/timer.cpp
+++ b/gob/timer.cpp
@@ -21,7 +21,6 @@
*/
#include "gob/gob.h"
#include "gob/global.h"
-#include "gob/debug.h"
#include "gob/sound.h"
namespace Gob {
diff --git a/gob/util.cpp b/gob/util.cpp
index 3c3dc2de7e..be69882977 100644
--- a/gob/util.cpp
+++ b/gob/util.cpp
@@ -23,7 +23,6 @@
#include "gob/global.h"
#include "gob/timer.h"
#include "gob/util.h"
-#include "gob/debug.h"
#include "gob/draw.h"
#include "gob/game.h"
@@ -315,13 +314,13 @@ void util_cutFromStr(char *str, int16 from, int16 cutlen) {
int16 len;
int16 i;
- log_write("util_cutFromStr: str = %s, ", str);
+ //log_write("util_cutFromStr: str = %s, ", str);
len = strlen(str);
if (from >= len)
return;
if (from + cutlen > len) {
str[from] = 0;
- log_write("res = %s\n", str);
+ //log_write("res = %s\n", str);
return;
}
@@ -330,7 +329,7 @@ void util_cutFromStr(char *str, int16 from, int16 cutlen) {
str[i] = str[i + cutlen];
i++;
} while (str[i] != 0);
- log_write("res = %s\n", str);
+ //log_write("res = %s\n", str);
}
int16 util_strstr(const char *str1, char *str2) {
@@ -338,7 +337,7 @@ int16 util_strstr(const char *str1, char *str2) {
uint16 len1;
uint16 i;
- log_write("util_strstr: str1 = %s, str2 = %s\n", str1, str2);
+ //log_write("util_strstr: str1 = %s, str2 = %s\n", str1, str2);
for (i = 0, len1 = strlen(str1); strlen(str2 + i) >= len1; i++) {
c = str2[i + len1];
@@ -377,7 +376,7 @@ void util_listInsertBack(Util_List * list, void *data) {
if (list->pHead != 0) {
if (list->pTail == 0) {
list->pTail = list->pHead;
- log_write("util_listInsertBack: Broken list!");
+ warning("util_listInsertBack: Broken list!");
}
node =
diff --git a/gob/video.cpp b/gob/video.cpp
index f4c5c71220..05170f9c42 100644
--- a/gob/video.cpp
+++ b/gob/video.cpp
@@ -22,7 +22,6 @@
#include "gob/gob.h"
#include "gob/global.h"
#include "gob/video.h"
-#include "gob/debug.h"
#include "gob/dataio.h"
#include "gob/driver_vga.h"
@@ -63,8 +62,8 @@ int32 vid_getRectSize(int16 width, int16 height, int16 flag, int16 mode) {
int32 size;
if ((mode & 0x7f) != 0x13)
- log_write
- ("vid_getRectSize: Warning! Video mode %d is not fully supported!\n",
+ warning
+ ("vid_getRectSize: Video mode %d is not fully supported!",
mode & 0x7f);
switch (mode & 0x7f) {
case 5: