[Scummvm-cvs-logs] SF.net SVN: scummvm: [29986] scummvm/trunk/engines/cruise

yazoo at users.sourceforge.net yazoo at users.sourceforge.net
Tue Dec 25 19:11:35 CET 2007


Revision: 29986
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29986&view=rev
Author:   yazoo
Date:     2007-12-25 10:11:35 -0800 (Tue, 25 Dec 2007)

Log Message:
-----------
Bunch of gfx fix

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/background.cpp
    scummvm/trunk/engines/cruise/dataLoader.cpp
    scummvm/trunk/engines/cruise/gfxModule.cpp
    scummvm/trunk/engines/cruise/mainDraw.cpp
    scummvm/trunk/engines/cruise/volume.cpp

Modified: scummvm/trunk/engines/cruise/background.cpp
===================================================================
--- scummvm/trunk/engines/cruise/background.cpp	2007-12-25 16:37:12 UTC (rev 29985)
+++ scummvm/trunk/engines/cruise/background.cpp	2007-12-25 18:11:35 UTC (rev 29986)
@@ -136,6 +136,7 @@
 		// read palette
 		switch(mode)
 		{
+		case 0:
 		case 4: // color on 3 bit
 			{
 				uint16 oldPalette[32];
@@ -148,7 +149,6 @@
 				{
 					gfxModuleData_convertOldPalColor(oldPalette[i], &palScreen[idx][i*3]);
 				}
-				ptr2 += 32000;
 				break;
 			}
 		case 5: // color on 4 bit
@@ -158,9 +158,9 @@
 					uint8* inPtr = ptr2 + i * 2;
 					uint8* outPtr = palScreen[idx] +i * 3;
 					
-					outPtr[2] = ((inPtr[1])&0x0F) << 4;
-					outPtr[1] = (((inPtr[1])&0xF0) >> 4) << 4;
-					outPtr[0] = ((inPtr[0])&0x0F) << 4;
+					outPtr[2] = ((inPtr[1])&0x0F) * 17;
+					outPtr[1] = (((inPtr[1])&0xF0) >> 4) * 17;
+					outPtr[0] = ((inPtr[0])&0x0F) * 17;
 				}
 				ptr2 += 2*32;
 				break;
@@ -176,24 +176,27 @@
 
 		gfxModuleData_setPal256(palScreen[idx]);
 
-		loadMEN(&ptr2);
-		loadCVT(&ptr2);
-
 		// read image data
 		gfxModuleData_gfxClearFrameBuffer(backgroundPtrtable[idx]);
 
 		switch(mode)
 		{
+		case 0:
 		case 4:
 			convertGfxFromMode4(ptr2, 320, 200, backgroundPtrtable[idx]);
+			ptr2 += 32000;
 			break;
 		case 5:
 			convertGfxFromMode5(ptr2, 320, 200, backgroundPtrtable[idx]);
 			break;
 		case 8:
 			memcpy(backgroundPtrtable[idx], ptr2, 320 * 200);
+			ptr2 += 32000;
 			break;
 		}
+
+		loadMEN(&ptr2);
+		loadCVT(&ptr2);
 	}
 
 

Modified: scummvm/trunk/engines/cruise/dataLoader.cpp
===================================================================
--- scummvm/trunk/engines/cruise/dataLoader.cpp	2007-12-25 16:37:12 UTC (rev 29985)
+++ scummvm/trunk/engines/cruise/dataLoader.cpp	2007-12-25 18:11:35 UTC (rev 29986)
@@ -467,7 +467,7 @@
 		ptr5 += resourceSize;
 
 		switch (localBuffer.type) {
-		case 0:
+		case 0: // polygon
 			{
 				filesDatabase[fileIndex].subData.resourceType = 8;
 				filesDatabase[fileIndex].subData.index = currentEntryIdx;

Modified: scummvm/trunk/engines/cruise/gfxModule.cpp
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.cpp	2007-12-25 16:37:12 UTC (rev 29985)
+++ scummvm/trunk/engines/cruise/gfxModule.cpp	2007-12-25 18:11:35 UTC (rev 29986)
@@ -63,9 +63,8 @@
 }
 
 void convertGfxFromMode4(uint8 *sourcePtr, int width, int height, uint8 *destPtr) {
-
-	for (int y = 0; y < (height/16); ++y) {
-		for (int x = 0; x < width; ++x) {
+	for (int y = 0; y < height; ++y) {
+		for (int x = 0; x < width/16; ++x) {
 			for (int bit = 0; bit < 16; ++bit) {
 				uint8 color = 0;
 				for (int p = 0; p < 4; ++p) {
@@ -202,8 +201,7 @@
 void gfxModuleData_flip(void) {
 }
 
-void gfxModuleData_field_64(char *sourceBuffer, int width, int height,
-	    char *dest, int x, int y, int color) {
+void gfxModuleData_field_64(char *sourceBuffer, int width, int height, char *dest, int x, int y, int color) {
 	int i;
 	int j;
 
@@ -212,8 +210,7 @@
 
 	for (i = 0; i < height; i++) {
 		for (j = 0; j < width; j++) {
-			dest[(y + i) * 320 / 4 + x + j] =
-			    sourceBuffer[i * width + j];
+			dest[(y + i) * 320 / 4 + x + j] = sourceBuffer[i * width + j];
 		}
 	}
 }

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2007-12-25 16:37:12 UTC (rev 29985)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2007-12-25 18:11:35 UTC (rev 29986)
@@ -837,9 +837,9 @@
 
 				if (destBuffer) {
 					if (pMask) {
-						blitPolyMode1(destBuffer, pMask, polyBuffer4, m_color & 0xF);
+						blitPolyMode1(destBuffer, pMask, polyBuffer4, m_color & 0xFF);
 					} else {
-						blitPolyMode2(destBuffer, polyBuffer4, m_color & 0xF);
+						blitPolyMode2(destBuffer, polyBuffer4, m_color & 0xFF);
 					}
 				}
 			}

Modified: scummvm/trunk/engines/cruise/volume.cpp
===================================================================
--- scummvm/trunk/engines/cruise/volume.cpp	2007-12-25 16:37:12 UTC (rev 29985)
+++ scummvm/trunk/engines/cruise/volume.cpp	2007-12-25 18:11:35 UTC (rev 29986)
@@ -452,12 +452,13 @@
 
 			char nameBuffer[256];
 
-			sprintf(nameBuffer, "D:/oldies/c-eng/dump/%s", buffer[j].name);
+			sprintf(nameBuffer, "%s", buffer[j].name);
 
 			if (buffer[j].size == buffer[j].extSize) {
 				Common::File fout;
 				fout.open(nameBuffer, Common::File::kFileWriteMode);
-				fout.write(bufferLocal, buffer[j].size);
+				if(fout.isOpen())
+					fout.write(bufferLocal, buffer[j].size);
 			} else {
 				char *uncompBuffer = (char *)mallocAndZero(buffer[j].extSize + 500);
 
@@ -465,7 +466,8 @@
 
 				Common::File fout;
 				fout.open(nameBuffer, Common::File::kFileWriteMode);
-				fout.write(uncompBuffer, buffer[j].extSize);
+				if(fout.isOpen())
+					fout.write(uncompBuffer, buffer[j].extSize);
 
 				//free(uncompBuffer);
 
@@ -473,6 +475,7 @@
 
 			free(bufferLocal);
 		}
+		fileHandle.close();
 	}
 
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list