[Scummvm-cvs-logs] CVS: scummex image.cpp,1.8,1.9 resource.cpp,1.13,1.14 resource.h,1.6,1.7 scummex.cpp,1.16,1.17 wxwindows.cpp,1.13,1.14

Adrien Mercier yoshizf at users.sourceforge.net
Mon Sep 22 12:49:04 CEST 2003


Update of /cvsroot/scummvm/scummex
In directory sc8-pr-cvs1:/tmp/cvs-serv10475

Modified Files:
	image.cpp resource.cpp resource.h scummex.cpp wxwindows.cpp 
Log Message:
Added support for COMI room/objects images

Index: image.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/image.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- image.cpp	22 Sep 2003 18:25:16 -0000	1.8
+++ image.cpp	22 Sep 2003 19:47:58 -0000	1.9
@@ -109,12 +109,12 @@
 int Image::drawBoxes(BlockTable *_blockTable, int id, File& _input, int newWindow) {
 	int nBox, RMHDindex, width, height;
 
-	RMHDindex = _resource->findBlock(0, _blockTable, _input, id, "RMHD", "-1");
+	RMHDindex = _resource->findBlock(0, _blockTable, id, "RMHD", "-1");
 	width = _blockTable[RMHDindex].width;
 	height = _blockTable[RMHDindex].height;
 
 	if (newWindow == 0)
-		id = _resource->findBlock(0, _blockTable, _input, id, "BOXD", "-1");
+		id = _resource->findBlock(0, _blockTable, id, "BOXD", "-1");
 	
 	_input.seek(_blockTable[id].offset + 10, SEEK_SET);
 	
@@ -157,7 +157,7 @@
 	int x = 0, y = 0;
 	byte *dst, *dstorg, *chunk_buffer;
 
-	index = _resource->findBlock(0, _blockTable, _input, id, "NPAL", "AHDR", "-1");
+	index = _resource->findBlock(0, _blockTable, id, "NPAL", "AHDR", "-1");
 	if (_blockTable[index].blockTypeID == AHDR) {
 		_input.seek(_blockTable[index].offset + 14, SEEK_SET);
 	} else {
@@ -210,24 +210,26 @@
 {
 	int RMHDindex, CLUTindex, SMAPindex, TRNSindex;
 	
-	if (_blockTable[id].blockTypeID == 209) {
-		RMHDindex = _resource->findBlock(0, _blockTable, _input, id, "HD", "-1");
+	if (_blockTable[id].blockTypeID == BM) {
+		RMHDindex = _resource->findBlock(0, _blockTable, id, "HD", "-1");
+	} else if (_blockTable[id-1].blockTypeID == IMHD) {
+		RMHDindex = id-1;
 	} else {
-		RMHDindex = _resource->findBlock(0, _blockTable, _input, id, "RMHD", "-1");
+		RMHDindex = _resource->findBlock(0, _blockTable, id, "RMHD", "-1");
 	}
 	_width = _blockTable[RMHDindex].width;
 	_height = _blockTable[RMHDindex].height;
 
 	_gui->DisplayImage("Room Image", _width, _height, IMAGE_BOXES);
 	
-	if (_blockTable[id].blockTypeID != 209) {
-		TRNSindex = _resource->findBlock(0, _blockTable, _input, id, "TRNS", "-1");
+	if (_blockTable[id].blockTypeID != BM) {
+		TRNSindex = _resource->findBlock(0, _blockTable, id, "TRNS", "-1");
 		_transp = _blockTable[TRNSindex].trans;
-		CLUTindex = _resource->findBlock(0, _blockTable, _input, id, "CLUT", "APAL", "NPAL", "-1");
+		CLUTindex = _resource->findBlock(0, _blockTable, id, "CLUT", "APAL", "NPAL", "-1");
 		_input.seek(_blockTable[CLUTindex].offset + 8, SEEK_SET);
 	} else {
 		_transp = 260;
-		CLUTindex = _resource->findBlock(0, _blockTable, _input, id, "PA", "-1");
+		CLUTindex = _resource->findBlock(0, _blockTable, id, "PA", "-1");
 		_input.seek(_blockTable[CLUTindex].offset + 8, SEEK_SET);
 	}
 
@@ -237,15 +239,19 @@
 		_rgbTable[j].blue = _input.readByte();	// blue
 	}
 	
-	if (_blockTable[id].blockTypeID != 209) {
-		SMAPindex = _resource->findBlock(1, _blockTable, _input, id, "SMAP", "-1");
+	if (_blockTable[id].blockTypeID != BM) {
+		SMAPindex = _resource->findBlock(1, _blockTable, id, "SMAP", "-1");
 	} else {
 		SMAPindex = id;
 	}
 
+	if (_blockTable[id].blockTypeID == IMAG) {
+		SMAPindex = _resource->findBlock(1, _blockTable, SMAPindex, "OFFS", "-1");
+	}
+
 	_offsets = new uint32[_width/8];
 	
-	if (_blockTable[id].blockTypeID != 209) {
+	if (_blockTable[id].blockTypeID != BM) {
 		_input.seek(_blockTable[SMAPindex].offset + 8, SEEK_SET);
 	} else {
 		_input.seek(_blockTable[SMAPindex].offset + 10, SEEK_SET);
@@ -270,18 +276,18 @@
 {
 	int RMHDindex, CLUTindex, SMAPindex, TRNSindex;
 
-	RMHDindex = _resource->findBlock(1, _blockTable, _input, id, "IMHD", "-1");
+	RMHDindex = _resource->findBlock(1, _blockTable, id, "IMHD", "-1");
 	
 	_width = _blockTable[RMHDindex].width;
 	_height = _blockTable[RMHDindex].height;
 	
 	_gui->DisplayImage("Object", _width, _height);
 	
-	TRNSindex = _resource->findBlock(0, _blockTable, _input, id, "TRNS", "-1");
+	TRNSindex = _resource->findBlock(0, _blockTable, id, "TRNS", "-1");
 
 	_transp = _blockTable[TRNSindex].trans;
 	
-	CLUTindex = _resource->findBlock(0, _blockTable, _input, id, "CLUT", "APAL", "NPAL", "-1");
+	CLUTindex = _resource->findBlock(0, _blockTable, id, "CLUT", "APAL", "NPAL", "-1");
 
 	_input.seek(_blockTable[CLUTindex].offset + 8, SEEK_SET);
 
@@ -291,7 +297,7 @@
 		_rgbTable[j].blue = _input.readByte();	// blue
 	}
 	
-	SMAPindex = _resource->findBlock(1, _blockTable, _input, id, "SMAP", "-1");
+	SMAPindex = _resource->findBlock(1, _blockTable, id, "SMAP", "-1");
 
 	_offsets = new uint32[_width/8];
 	

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/resource.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- resource.cpp	22 Sep 2003 15:23:56 -0000	1.13
+++ resource.cpp	22 Sep 2003 19:47:58 -0000	1.14
@@ -27,90 +27,6 @@
 
 int v8 = 0;
 
-/*void parseV5Index(BlockTable *_blockTable, RoomTable *_roomTable, File& _input, int fileType) {
-	int i = 0, index = 0, rooms = 0;
-
-	// MAXS block
-	if (rooms < 1)
-		fileType = 2;
-
-	if (fileType == 1) {
-		_input.read(_blockTable[index].blockName, 4);
-		_blockTable[index].blockName[4] = '\0';
-		strcpy(_blockTable[index].blockType, _blockTable[index].blockName);
-		_blockTable[index].blockTypeID = getBlockType(_blockTable[index].blockName);
-		strcpy(_blockTable[index].blockDescription, blocksInfo[_blockTable[index].blockTypeID].description);
-
-		_blockTable[index].blockSize = _input.readUint32BE();
-		_blockTable[index].offset = _input.pos() - 8;
-		_blockTable[index].variables = _input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].bitVariables = _input.readUint16LE();
-		_blockTable[index].localObjects = _input.readUint16LE();
-		_blockTable[index].arrays = _input.readUint16LE();
-		_blockTable[index].characters = _input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].invObjects = _input.readUint16LE();
-		index++;
-	}
-
-	if (fileType == 2) {
-		_input.read(_blockTable[index].blockName, 4);
-		_blockTable[index].blockName[4] = '\0';
-		strcpy(_blockTable[index].blockType, _blockTable[index].blockName);
-		_blockTable[index].blockTypeID = getBlockType(_blockTable[index].blockName);
-		strcpy(_blockTable[index].blockDescription, blocksInfo[_blockTable[index].blockTypeID].description);
-		_blockTable[index].blockSize = _input.readUint32BE();
-		_blockTable[index].offset = _input.pos() - 8;
-		_blockTable[index].variables = _input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].bitVariables = _input.readUint16LE();
-		_blockTable[index].localObjects = _input.readUint16LE();
-		_blockTable[index].arrays = _input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].invObjects = _input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].characters = _input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		index++;
-	}
-
-	if (fileType == 3) {
-		_input.read(_blockTable[index].blockName, 4);
-		_blockTable[index].blockName[4] = '\0';
-		strcpy(_blockTable[index].blockType, _blockTable[index].blockName);
-		_blockTable[index].blockTypeID = getBlockType(_blockTable[index].blockName);
-		strcpy(_blockTable[index].blockDescription, blocksInfo[_blockTable[index].blockTypeID].description);
-		_blockTable[index].blockSize = _input.readUint32BE();
-		_blockTable[index].offset = _input.pos() - 8;
-		_input.seek(50 + 50, SEEK_CUR);
-		_blockTable[index].variables = _input.readUint16LE();
-		_blockTable[index].bitVariables = _input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].localObjects = _input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].invObjects = _input.readUint16LE();
-		_blockTable[index].arrays = _input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_input.readUint16LE();
-		_blockTable[index].characters = _input.readUint16LE();
-		_input.readUint16LE();
-		index++;
-	}
-
-}
-*/
-
 Resource::Resource() {
 	stopflag = 0;
 }
@@ -654,6 +570,7 @@
 		case WRAP:
 		case OBIM:
 		case SOUN:
+		case ZPLN:
 			_blockTable[index].blockSize = _input.readUint32BE();
 			_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
 			bufindex = index;
@@ -951,7 +868,7 @@
 	return -1;
 }
 
-int Resource::findBlock(int direction, BlockTable * _blockTable, File& _input, int id, ...)
+int Resource::findBlock(int direction, BlockTable * _blockTable, int id, ...)
 {
 	va_list arg_ptr;
 	char *test;

Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/resource.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- resource.h	21 Sep 2003 23:50:28 -0000	1.6
+++ resource.h	22 Sep 2003 19:47:58 -0000	1.7
@@ -148,10 +148,10 @@
 	{83, "BOMP", ""},
 	{84, "IMAG", "", 0, "", 25},
 	{85, "AKOS", ""},
-	{86, "ZP04", ""},
+	{86, "ZP04", "", 0, "", 52},
 	{87, "RMSC", "", 1, "help/specRMSC.html", 57},
 	{88, "BSTR", "", 0, "", 42},
-	{89, "ZPLN", ""},
+	{89, "ZPLN", "", 0, "", 52},
 	{90, "AKHD", ""},
 	{91, "AKPL", ""},
 	{92, "RGBS", ""},
@@ -220,7 +220,7 @@
 	int searchOldBlocks(BlockTable *_blockTable, File& _input, int index = 0, int level = 1, int size = 0);
 	int parseBlocks(char *blockName, BlockTable *_blockTable, File& _input, int index, int level);
 	int parseOldBlocks(char *blockName, BlockTable *_blockTable, File& _input, int index, int level);
-	int findBlock(int direction, BlockTable * _blockTable, File& _input, int id, ...);
+	int findBlock(int direction, BlockTable * _blockTable, int id, ...);
 };
 
 #endif

Index: scummex.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/scummex.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- scummex.cpp	22 Sep 2003 18:25:16 -0000	1.16
+++ scummex.cpp	22 Sep 2003 19:47:58 -0000	1.17
@@ -368,6 +368,7 @@
 
 		case RMIM:
 		case BM:
+		case IMAG:
 			_gui->SetButton(_blockTable[blockid].blockTypeID);
 			break;
 

Index: wxwindows.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- wxwindows.cpp	22 Sep 2003 18:25:16 -0000	1.13
+++ wxwindows.cpp	22 Sep 2003 19:47:59 -0000	1.14
@@ -379,6 +379,7 @@
 		
 		case BM:
 		case RMIM:
+		case IMAG:
 			SpecButton1->SetLabel("View Image");
 			SpecButton1->Show(TRUE);
 			SpecButton1->Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
@@ -1112,6 +1113,8 @@
 		case ZP01:
 		case ZP02:
 		case ZP03:
+		case ZP04:
+		case ZPLN:
 			bigIconBitmap = wxBitmap(xpm_52_big);
 			break;
 			





More information about the Scummvm-git-logs mailing list