[Scummvm-cvs-logs] CVS: scummex blocks.h,1.13,1.14 image.cpp,1.25,1.26 resource.cpp,1.28,1.29 resource.h,1.20,1.21 wxwindows.cpp,1.36,1.37 wxwindows.h,1.17,1.18

Eugene Sandulenko sev at users.sourceforge.net
Sat Feb 14 12:58:04 CET 2004


Update of /cvsroot/scummvm/scummex
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29544

Modified Files:
	blocks.h image.cpp resource.cpp resource.h wxwindows.cpp 
	wxwindows.h 
Log Message:
o Proper handling of IACT chunks. Now scummex distinguishes between
  iMUSE and INSANE IACT and gives more info for INSANE
o SKIP chunks support
o Show resource number on each level. Now you can easily find Room #50
o AKOS chunks descriptions and display some additional info


Index: blocks.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/blocks.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- blocks.h	30 Jan 2004 02:07:51 -0000	1.13
+++ blocks.h	14 Feb 2004 20:51:10 -0000	1.14
@@ -169,7 +169,8 @@
 	POLD,
 	LSC2,
 	FMUS,
-	SKIP
+	SKIP,
+	IaCt
 };
 
 enum {

Index: image.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/image.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- image.cpp	8 Nov 2003 02:38:00 -0000	1.25
+++ image.cpp	14 Feb 2004 20:51:10 -0000	1.26
@@ -273,7 +273,7 @@
 	dstorg = dst = (byte *)malloc(_width * _height + 1000);
 	_input.read(chunk_buffer, _blockTable[id].blockSize - 22);
 
-	switch (_blockTable[id].variables) {
+	switch (_blockTable[id].variables[0]) {
 		case 1:
 			decodeCodec1(dst, chunk_buffer, _height);
 			break;

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/resource.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- resource.cpp	30 Jan 2004 02:07:51 -0000	1.28
+++ resource.cpp	14 Feb 2004 20:51:10 -0000	1.29
@@ -78,6 +78,7 @@
 int Resource::searchBlocks(BlockTable *_blockTable, File& _input, int index, int level, int size) {
 	int32 curpos = 0;
 	int called = 0;
+	int number = 0;
 	if (size != 0)
 		called = 1;
 		
@@ -95,6 +96,7 @@
 			_blockTable[index].offset = _input.pos() - 4;
 			//printf("block: %s offset: %x\n", _blockTable[index].blockName, _blockTable[index].offset);
 			_blockTable[index].blockTypeID = getBlockType(_blockTable[index].blockName);
+			_blockTable[index].number = number;
 			if (_blockTable[index].blockTypeID != -1) {
 				index = parseBlocks(_blockTable[index].blockName, _blockTable, _input, index, level);
 				curpos = _input.pos();
@@ -114,6 +116,7 @@
 			}
 
 			curpos = _input.pos();
+			number++;
 	}
 
 	return index;
@@ -423,7 +426,7 @@
 			
 		case MAXS:
 			_blockTable[index].blockSize = _input.readUint32BE();
-			_blockTable[index].variables = _input.readUint16LE();
+			_blockTable[index].variables[0] = _input.readUint16LE();
 			_input.readUint16LE();
 			_blockTable[index].bitVariables = _input.readUint16LE();
 			_blockTable[index].localObjects = _input.readUint16LE();
@@ -620,22 +623,22 @@
 			break;
 
 		case IACT:
-			_blockTable[index].blockSize = _input.readUint32BE() + 8;
+			_blockTable[index].blockSize = _input.readUint32BE();
 			_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
 			bufindex = index;
 			index++;
-			level++;
-			index = searchBlocks(_blockTable, _input, index, level, _blockTable[index-1].blockSize + _blockTable[index-1].offset);
-			_input.seek(_blockTable[bufindex].offset + _blockTable[bufindex].blockSize, SEEK_SET);
-			_input.read(_blockTable[index+1].blockName, 4);
-			_blockTable[index+1].blockName[4] = '\0';
-			_blockTable[index+1].blockTypeID = getBlockType(_blockTable[index+1].blockName);
-			//if (_blockTable[index+1].blockTypeID != -1) {
-			//	_input.seek(-4, SEEK_CUR);
-			//} else {
-			//	_blockTable[bufindex].blockSize += 1;
-			//	_input.seek(-3, SEEK_CUR);
-			//}
+			if (_blockTable[bufindex].blockSize > 36) { // in FT IACT do not have subchunks
+				level++;
+				_input.seek(_blockTable[bufindex].offset + 26, SEEK_SET);
+				index = searchBlocks(_blockTable, _input, index, level, _blockTable[bufindex].blockSize+_blockTable[bufindex].offset);
+			} else {
+				_blockTable[bufindex].blockSize += 8;
+				_blockTable[bufindex].blockTypeID = IaCt; // INSANE Action
+				strcpy(_blockTable[bufindex].blockDescription, blocksInfo[_blockTable[bufindex].blockTypeID].description);
+				_input.seek(_blockTable[bufindex].offset + 8, SEEK_SET);
+				for (int i = 0; i < 5; i++)
+					_blockTable[bufindex].variables[i] = _input.readUint16LE();
+			}
 			_input.seek(_blockTable[bufindex].offset + _blockTable[bufindex].blockSize, SEEK_SET);
 			break;
 
@@ -692,7 +695,7 @@
 		case FOBJ:
 			_blockTable[index].blockSize = _input.readUint32BE() + 8;
 			
-			_blockTable[index].variables = _input.readUint16LE(); // Codec
+			_blockTable[index].variables[0] = _input.readUint16LE(); // Codec
 			_input.readUint16BE(); // Left
 			_input.readUint16BE(); // Top
 			_blockTable[index].width = _input.readUint16LE(); // Width
@@ -730,7 +733,7 @@
 						int rate = _input.readByte();
 						_input.readByte();
 						len -= 2;
-						_blockTable[index].variables = getSampleRateFromVOCRate(rate);
+						_blockTable[index].variables[0] = getSampleRateFromVOCRate(rate);
 						// FIXME some FT samples (ex. 362) has bad length, 2 bytes too short
 						_input.seek(len, SEEK_CUR);
 						} break;
@@ -767,8 +770,24 @@
 			index++;
 			break;
 
-		default:
+		case AKHD:
+			_blockTable[index].blockSize = _input.readUint32BE();
+			_blockTable[index].variables[0] = _input.readUint16LE(); // Codec
+			_input.seek(_blockTable[index].offset + _blockTable[index].blockSize, SEEK_SET);
+			_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
+			index++;
+			break;
+
+		case SKIP:
 			_blockTable[index].blockSize = _input.readUint32BE() + 8;
+			_blockTable[index].variables[0] = _input.readUint16LE(); // Parameter
+			_input.seek(_blockTable[index].offset + _blockTable[index].blockSize, SEEK_SET);
+			_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
+			index++;
+			break;
+
+		default:
+			_blockTable[index].blockSize = _input.readUint32BE();
 			_input.seek(_blockTable[index].offset + _blockTable[index].blockSize, SEEK_SET);
 			_gui->add_tree_elements(_blockTable[index].blockName, index, level, _blockTable[index].blockTypeID);
 			index++;

Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/resource.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- resource.h	30 Jan 2004 02:07:51 -0000	1.20
+++ resource.h	14 Feb 2004 20:51:11 -0000	1.21
@@ -35,7 +35,7 @@
 	uint32 offset;
 	int numFiles;
 	uint32 blockSize;
-	uint32 variables;
+	uint32 variables[10];
 	uint32 bitVariables;
 	uint32 localObjects;
 	uint32 arrays;
@@ -44,6 +44,7 @@
 	int32 width;
 	int trans;
 	int32 height;
+	int number;
 	ImageWindow *image;
 };
 
@@ -148,16 +149,16 @@
 	{82, "IM10", "Image", 0, "", 25},
 	{83, "BOMP", "", 0, "", 47},
 	{84, "IMAG", "", 0, "", 25},
-	{85, "AKOS", "", 0, "", 47},
+	{85, "AKOS", "Animated Costume", 0, "", 47},
 	{86, "ZP04", "", 0, "", 52},
 	{87, "RMSC", "", 1, "help/specRMSC.html", 57},
 	{88, "BSTR", "", 0, "", 42},
 	{89, "ZPLN", "", 0, "", 52},
-	{90, "AKHD", "", 0, "", 47},
-	{91, "AKPL", "", 0, "", 47},
+	{90, "AKHD", "AKOS Header", 0, "", 47},
+	{91, "AKPL", "AKOS Palette", 0, "", 47},
 	{92, "RGBS", "", 0, "", 47},
-	{93, "AKOF", "", 0, "", 47},
-	{94, "AKCI", "", 0, "", 47},
+	{93, "AKOF", "AKOS Offset", 0, "", 47},
+	{94, "AKCI", "AKOS Costume Info", 0, "", 47},
 	{95, "AKCD", "", 0, "", 47},
 	{96, "AKSQ", "", 0, "", 47},
 	{97, "AKCH", "", 0, "", 47},
@@ -211,10 +212,11 @@
 	{145, "POLD", "", 0, "", 47},
 	{146, "LSC2", "", 0, "", 47},
 	{147, "FMUS", "Music header?", 0, "", 47},
-	{148, "SKIP", "SMUSH Skip", 0, "", 47}
+	{148, "SKIP", "SMUSH Skip", 0, "", 47},
+	{149, "IaCt", "INSANE Action", 0, "", 24} // small letters are intentional
 };
 
-const int numBlocks = 149;
+const int numBlocks = 150;
 
 const struct blockInfo oldBlocksInfo[] = {
 	{200, "0R", "Directory of Rooms", 0, "", 18},

Index: wxwindows.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- wxwindows.cpp	1 Oct 2003 14:12:52 -0000	1.36
+++ wxwindows.cpp	14 Feb 2004 20:51:11 -0000	1.37
@@ -560,17 +560,20 @@
 	
 	_GenLabel[0][1]->SetLabel(block.blockType);
 
-	sprintf(buf, "%d (0x%08X)", block.offset, block.offset);
+	sprintf(buf, "%d", block.number);
 	_GenLabel[1][1]->SetLabel(buf);
 
-	sprintf(buf, "%d (0x%08X)", block.blockSize, block.blockSize);
+	sprintf(buf, "%d (0x%08X)", block.offset, block.offset);
 	_GenLabel[2][1]->SetLabel(buf);
 
-	_GenLabel[3][1]->SetLabel(block.blockDescription);
+	sprintf(buf, "%d (0x%08X)", block.blockSize, block.blockSize);
+	_GenLabel[3][1]->SetLabel(buf);
+
+	_GenLabel[4][1]->SetLabel(block.blockDescription);
 
 	switch(block.blockTypeID) {
 		case MAXS:
-			updateLabel(_SpecLabel[0], "Num. of variables:", block.variables);
+			updateLabel(_SpecLabel[0], "Num. of variables:", block.variables[0]);
 			updateLabel(_SpecLabel[1], "Num. of bit variables:", block.bitVariables);
 			updateLabel(_SpecLabel[2], "Num. of local objects:", block.localObjects);
 			updateLabel(_SpecLabel[3], "Num. of arrays:", block.arrays);
@@ -615,13 +618,13 @@
 			
 		case Crea:
 		case AUdt:
-			updateLabel(_SpecLabel[0], "Sample Rate:", block.variables);
+			updateLabel(_SpecLabel[0], "Sample Rate:", block.variables[0]);
 			break;
 
 		case FOBJ:
 			updateLabel(_SpecLabel[0], "Frame Width:", block.width);
 			updateLabel(_SpecLabel[1], "Frame Height:", block.height);
-			updateLabel(_SpecLabel[2], "Codec:", block.variables);
+			updateLabel(_SpecLabel[2], "Codec:", block.variables[0]);
 			break;
 
 		case BOXD:
@@ -639,6 +642,20 @@
 			updateLabel(_SpecLabel[2], "Object Height:", block.height);
 			break;
 
+		case AKHD:
+			updateLabel(_SpecLabel[0], "Codec:", block.variables[0]);
+			break;
+
+		case SKIP:
+			updateLabel(_SpecLabel[0], "Parameter:", block.variables[0]);
+			break;
+
+		case IaCt:
+			for (int i = 0; i < 5; i++) {
+				sprintf(buf, "Var%d:", i+1);
+				updateLabel(_SpecLabel[i], buf, block.variables[i]);
+			}
+			break;
 	}
 	SetButton(block.blockTypeID);
 }
@@ -785,15 +802,16 @@
 	GenInfosHSizer->Add(GenInfosSizer2, 1, wxLEFT|wxEXPAND,	12);
 
 	_GenLabel[0][0] = new wxStaticText(infospanel, -1, "Type:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
-	_GenLabel[1][0] = new wxStaticText(infospanel, -1, "Offset:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
-	_GenLabel[2][0] = new wxStaticText(infospanel, -1, "Size:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
-	_GenLabel[3][0] = new wxStaticText(infospanel, -1, "Description:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+	_GenLabel[1][0] = new wxStaticText(infospanel, -1, "Number:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+	_GenLabel[2][0] = new wxStaticText(infospanel, -1, "Offset:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+	_GenLabel[3][0] = new wxStaticText(infospanel, -1, "Size:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+	_GenLabel[4][0] = new wxStaticText(infospanel, -1, "Description:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
 	
-	for (int i = 0; i < 4; i++) {
+	for (int i = 0; i < 5; i++) {
 		GenInfosSizer->Add(_GenLabel[i][0], 0, wxALL|wxEXPAND, 1);
 	}
 		
-	for (int i = 0; i < 4; i++) {
+	for (int i = 0; i < 5; i++) {
 		_GenLabel[i][1] = new wxStaticText(infospanel, -1, "n/a", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
 		GenInfosSizer2->Add(_GenLabel[i][1], 0, wxALL|wxEXPAND, 1);
 	}				

Index: wxwindows.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- wxwindows.h	1 Oct 2003 10:06:12 -0000	1.17
+++ wxwindows.h	14 Feb 2004 20:51:11 -0000	1.18
@@ -56,7 +56,7 @@
 	wxStaticBitmap *BigIcon;
 	wxPanel *panel, *infospanel, *htmlpanel, *searchpanel;
 	int htmlflag;
-	wxStaticText *_GenLabel[4][2];
+	wxStaticText *_GenLabel[5][2];
 	wxStaticText *_SpecLabel[6][2];
 	wxButton *SpecButton1, *SpecButton2;
 	wxTreeItemId iter[11];





More information about the Scummvm-git-logs mailing list