o Put numerous debug messages to deeper level and removed others

o Occasional indentation fixes
o Fixed bug with cursor. Thanks wjp. Now even gob1demo works but final screen which is not playable in original hangs here.

svn-id: r17462
This commit is contained in:
Eugene Sandulenko 2005-04-09 01:28:16 +00:00
parent 61cfe81278
commit aff66038f3
7 changed files with 13 additions and 25 deletions

View File

@ -115,7 +115,7 @@ int32 data_readChunk(int16 handle, char *buf, int16 size) {
offset =
chunkOffset[file * MAX_SLOT_COUNT + slot] +
chunkPos[file * MAX_SLOT_COUNT + slot];
debug(0, "seek: %ld, %ld", chunkOffset[file * MAX_SLOT_COUNT + slot], chunkPos[file * MAX_SLOT_COUNT + slot]);
debug(7, "seek: %ld, %ld", chunkOffset[file * MAX_SLOT_COUNT + slot], chunkPos[file * MAX_SLOT_COUNT + slot]);
file_getHandle(dataFileHandles[file])->seek(offset, SEEK_SET);
}
@ -207,7 +207,7 @@ void data_openDataFile(const char *src) {
numDataChunks[file] = file_getHandle(dataFileHandles[file])->readUint16LE();
debug(0, "DataChunks: %d [for %s]", numDataChunks[file], path);
debug(7, "DataChunks: %d [for %s]", numDataChunks[file], path);
dataFiles[file] = dataDesc =
(struct ChunkDesc *)malloc(sizeof(struct ChunkDesc) *
@ -221,7 +221,7 @@ void data_openDataFile(const char *src) {
}
for (i = 0; i < numDataChunks[file]; i++)
debug(0, "%d: %s %d", i, dataDesc[i].chunkName, dataDesc[i].size);
debug(7, "%d: %s %d", i, dataDesc[i].chunkName, dataDesc[i].size);
for (i = 0; i < MAX_SLOT_COUNT; i++)
chunkPos[file * MAX_SLOT_COUNT + i] = -1;

View File

@ -113,15 +113,15 @@ char *game_loadExtData(int16 itemId, int16 *pResWidth, int16 *pResHeight) {
if (pResWidth != 0) {
*pResWidth = item->width & 0x7fff;
*pResHeight = item->height;
debug(0, "game_loadExtData(%d, %d, %d)", itemId, *pResWidth, *pResHeight);
debug(7, "game_loadExtData(%d, %d, %d)", itemId, *pResWidth, *pResHeight);
}
debug(0, "game_loadExtData(%d, 0, 0)", itemId);
debug(7, "game_loadExtData(%d, 0, 0)", itemId);
if (item->height == 0)
size += (item->width & 0x7fff) << 16;
debug(0, "size: %d off: %d", size, offset);
debug(7, "size: %d off: %d", size, offset);
if (offset >= 0) {
handle = game_extHandle;
} else {
@ -134,7 +134,7 @@ char *game_loadExtData(int16 itemId, int16 *pResWidth, int16 *pResHeight) {
handle = commonHandle;
}
debug(0, "off: %ld size: %ld", offset, tableSize);
debug(7, "off: %ld size: %ld", offset, tableSize);
data_seekData(handle, offset + tableSize, SEEK_SET);
if (isPacked)
dataBuf = (char *)malloc(size);
@ -161,10 +161,6 @@ char *game_loadExtData(int16 itemId, int16 *pResWidth, int16 *pResHeight) {
free(packedBuf);
}
for (int16 i = 0; i < 16; i++)
printf("%02x ", (byte)dataBuf[i]);
printf("\n");
return dataBuf;
}
@ -381,8 +377,7 @@ char *game_loadTotResource(int16 id) {
return ((char *)game_totResourceTable) + szGame_TotResTable +
szGame_TotResItem * game_totResourceTable->itemsCount + offset;
} else {
return (char *)(game_imFileData +
((int32 *)game_imFileData)[-offset - 1]);
return (char *)(game_imFileData + ((int32 *)game_imFileData)[-offset - 1]);
}
}
@ -1693,7 +1688,6 @@ void game_loadImFile(void) {
char path[20];
int16 handle;
// If demo
if (game_totFileData[0x3d] != 0 && game_totFileData[0x3b] == 0)
return;

View File

@ -44,8 +44,8 @@ typedef struct Game_ExtTable {
#define szGame_TotResItem (4 + 2 + 2 + 2)
typedef struct Game_TotResItem {
int32 offset; // if > 0, then offset from end of resource table.
// If < 0, then -offset-1 is index in .IM file table
int32 offset; // if > 0, then offset from end of resource table.
// If < 0, then -offset-1 is index in .IM file table
int16 size;
int16 width;
int16 height;

View File

@ -43,7 +43,7 @@ int16 *inter_breakFromLevel;
int16 *inter_nestLevel;
int16 inter_load16(void) {
int16 tmp = READ_LE_UINT16(inter_execPtr);
int16 tmp = (int16)READ_LE_UINT16(inter_execPtr);
inter_execPtr += 2;
return tmp;
}
@ -803,12 +803,11 @@ void inter_loadCursor(void) {
Game_TotResItem *itemPtr;
int16 width;
int16 height;
int16 offset;
int32 offset;
char *dataBuf;
int16 id;
int8 index;
debug(0, "inter_loadCursor");
id = inter_load16();
index = *inter_execPtr++;
itemPtr = &game_totResourceTable->items[id];

View File

@ -140,7 +140,7 @@ char pal_fadeStep(int16 oper) {
return 1;
}
void pal_fade(PalDesc * palDesc, int16 fade, int16 allColors) {
void pal_fade(PalDesc *palDesc, int16 fade, int16 allColors) {
char stop;
int16 i;

View File

@ -111,7 +111,6 @@ int16 scen_loadStatic(char search) {
ptr->layersCount = (int16)READ_LE_UINT16(dataPtr);
dataPtr += 2;
debug("layer: %d", ptr->layersCount);
ptr->layers = (Scen_StaticLayer **)malloc(sizeof(Scen_StaticLayer *) * ptr->layersCount);
ptr->pieces = (Scen_PieceDesc **)malloc(sizeof(Scen_PieceDesc *) * picsCount);

View File

@ -93,8 +93,6 @@ SurfaceDesc *vid_initSurfDesc(int16 vidMode, int16 width, int16 height, int16 fl
int16 someFlags = 1;
SurfaceDesc *descPtr;
debug(0, "stub: vid_initSurfDesc()");
if (flags != PRIMARY_SURFACE)
sprAllocated++;
@ -441,8 +439,6 @@ char vid_spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
int16 bufPos;
int16 strLen;
warning("vid_spriteUncompressor called");
if ((destDesc->vidMode & 0x7f) != 0x13)
error("vid_spriteUncompressor: Video mode 0x%x is not supported!",
destDesc->vidMode & 0x7f);