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

Adrien Mercier yoshizf at users.sourceforge.net
Tue Sep 23 02:07:05 CEST 2003


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

Modified Files:
	image.cpp resource.h wxwindows.cpp 
Log Message:
Added support for RGBS palettes and v7 BOXD

Index: image.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/image.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- image.cpp	23 Sep 2003 06:44:43 -0000	1.12
+++ image.cpp	23 Sep 2003 09:05:47 -0000	1.13
@@ -41,6 +41,7 @@
 {
 	int addindex = 0;
 	int index = 0;
+	int h;
 
 	_gui->DisplayImage("Block Palette", 384, 384);
 
@@ -49,10 +50,23 @@
 	if (_blockTable[id].blockTypeID == AHDR)
 		_input.seek(6, SEEK_CUR);
 
-	for (int j = 0; j < 256; j++) {
-		_rgbTable[j].red = _input.readByte();	// red
-		_rgbTable[j].green = _input.readByte(); // green
-		_rgbTable[j].blue = _input.readByte();	// blue
+	if (_blockTable[id].blockTypeID == RGBS) {
+		for (h = 0; h < (_blockTable[id].blockSize - 8) / 3; h++) {
+			_rgbTable[h].red = _input.readByte();	// red
+			_rgbTable[h].green = _input.readByte(); // green
+			_rgbTable[h].blue = _input.readByte();	// blue
+		}
+		for (; h < 256; h++) {
+			_rgbTable[h].red = 255;
+			_rgbTable[h].green = 255;
+			_rgbTable[h].blue = 255;
+		}
+	} else {				
+		for (int j = 0; j < 256; j++) {
+			_rgbTable[j].red = _input.readByte();	// red
+			_rgbTable[j].green = _input.readByte(); // green
+			_rgbTable[j].blue = _input.readByte();	// blue
+		}
 	}
 
 	int x = 0, y = 0;
@@ -107,24 +121,27 @@
 }
 
 int Image::drawBoxes(BlockTable *_blockTable, int id, File& _input, int newWindow) {
-	int nBox, RMHDindex, width, height, v8 = 0;
+	int nBox, RMHDindex, width, height, version = 5;
 
 	RMHDindex = _resource->findBlock(0, _blockTable, id, "RMHD", NULL);
 	width = _blockTable[RMHDindex].width;
 	height = _blockTable[RMHDindex].height;
 
-	if ( _resource->findBlock(0, _blockTable, id, "IMAG", NULL) != -1)
-			v8 = 1;
+	if ( _resource->findBlock(0, _blockTable, id, "IMAG", NULL) != -1) {
+		version = 8;
+	} else if ( _resource->findBlock(0, _blockTable, id, "PALS", NULL) != -1) {
+		version = 7;
+	}
 			
 	if (newWindow == 0) {
-		if (v8) {
+		if (version > 5) {
 			id = _resource->findBlock(1, _blockTable, id, "BOXD", NULL);
 		} else {
 			id = _resource->findBlock(0, _blockTable, id, "BOXD", NULL);
 		}
 	}
 	
-	if (v8) { 
+	if (version == 8) { 
 		_input.seek(_blockTable[id].offset + 12, SEEK_SET);
 	} else {
 		_input.seek(_blockTable[id].offset + 10, SEEK_SET);
@@ -132,7 +149,7 @@
 	
 	nBox = _blockTable[id].numFiles;
 
-	if (v8) {
+	if (version == 8) {
 		for (int i=0; i<nBox; i++) {
 			_points[i][0].x = (short)_input.readUint32LE();
 			_points[i][0].y = (short)_input.readUint32LE();

Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/resource.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- resource.h	23 Sep 2003 00:47:23 -0000	1.8
+++ resource.h	23 Sep 2003 09:05:47 -0000	1.9
@@ -147,19 +147,19 @@
 	{82, "IM10", "Image", 0, "", 25},
 	{83, "BOMP", ""},
 	{84, "IMAG", "", 0, "", 25},
-	{85, "AKOS", ""},
+	{85, "AKOS", "", 0, "", 47},
 	{86, "ZP04", "", 0, "", 52},
 	{87, "RMSC", "", 1, "help/specRMSC.html", 57},
 	{88, "BSTR", "", 0, "", 42},
 	{89, "ZPLN", "", 0, "", 52},
-	{90, "AKHD", ""},
-	{91, "AKPL", ""},
-	{92, "RGBS", ""},
-	{93, "AKOF", ""},
-	{94, "AKCI", ""},
-	{95, "AKCD", ""},
-	{96, "AKSQ", ""},
-	{97, "AKCH", ""},
+	{90, "AKHD", "", 0, "", 47},
+	{91, "AKPL", "", 0, "", 47},
+	{92, "RGBS", "", 0, "", 47},
+	{93, "AKOF", "", 0, "", 47},
+	{94, "AKCI", "", 0, "", 47},
+	{95, "AKCD", "", 0, "", 47},
+	{96, "AKSQ", "", 0, "", 47},
+	{97, "AKCH", "", 0, "", 47},
 	{98, "ANIM", "SMUSH Animation", 0, "", 55},
 	{99, "AHDR", "SMUSH Animation Header", 0, "", 1},
 	{100, "FRME", "SMUSH Frame", 0, "", 55},

Index: wxwindows.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- wxwindows.cpp	23 Sep 2003 01:28:15 -0000	1.16
+++ wxwindows.cpp	23 Sep 2003 09:05:47 -0000	1.17
@@ -380,6 +380,7 @@
 		case PA:
 		case NPAL:
 		case AHDR:
+		case RGBS:
 			SpecButton1->SetLabel("View Palette");
 			SpecButton1->Show(TRUE);
 printf("Connect: SpecButton1 = %d, this = %d\n", (int)SpecButton1, (int)this);
@@ -522,6 +523,7 @@
 		case PA:
 		case NPAL:
 		case AHDR:
+		case RGBS:
 			SetButton(block.blockTypeID);
 			break;
 





More information about the Scummvm-git-logs mailing list