[Scummvm-cvs-logs] CVS: scummvm/bs2/driver palette.cpp,1.16,1.17

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sat Sep 27 08:31:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv27999

Modified Files:
	palette.cpp 
Log Message:
I don't think UpdatePaletteMatchTable() has to write the table to file. In
fact, I'm not even sure the !data case ever happens.


Index: palette.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/palette.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- palette.cpp	23 Sep 2003 16:53:25 -0000	1.16
+++ palette.cpp	27 Sep 2003 15:30:17 -0000	1.17
@@ -138,18 +138,18 @@
 	}
 
 	// Here, minIndex is the index of the matchpalette which is closest.
-	return(minIndex);
+	return minIndex;
 }
 
-// FIXME: Does this function really need to write to file?
-
 int32 UpdatePaletteMatchTable(uint8 *data) {
 	if (!data) {
-		FILE *fp;
 		int16 red, green, blue;
 		uint8 *p;
 
 		// Create palette match table
+
+		// FIXME: Does this case ever happen?
+
 		p = &paletteMatch[0];
 		for (red = 0; red < 256; red += 4) {
 			for (green = 0; green < 256; green += 4) {
@@ -158,30 +158,11 @@
 				}
 			}
 		}
-
-		// Write out palette match table
-		fp = fopen("r11.rgb", "wb");
-		if (fp == NULL)
-			return(RDERR_INVALIDFILENAME);
-		if (fwrite(paletteMatch, 1, 64*64*64, fp) != 64*64*64)
-			return(RDERR_WRITEERROR);
-		fclose(fp);
 	} else {
-		// Read table from file
+		// The provided data is th new palette match table
 		memcpy(paletteMatch, data, PALTABLESIZE);
-	
-/*
-		FILE *fp;
-
-		fp = fopen(filename, "rb");
-		if (fp == NULL)
-			return(RDERR_INVALIDFILENAME);
-		if (fread(paletteMatch, 1, 64*64*64, fp) != 64*64*64)
-			return(RDERR_READERROR);
-		fclose(fp);
-		return(RD_OK);
-*/		
 	}
+
 	return RD_OK;
 }
 





More information about the Scummvm-git-logs mailing list