aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-09-27 15:30:17 +0000
committerTorbjörn Andersson2003-09-27 15:30:17 +0000
commit442fd0cdf895c26ea26db3291b465e87ac3ff466 (patch)
tree398ec6a7dd56789cd04024dbf9dbb0d00fa94418 /sword2
parent3278a0dce61407d3bdf5bdb03b96f2201a92c2eb (diff)
downloadscummvm-rg350-442fd0cdf895c26ea26db3291b465e87ac3ff466.tar.gz
scummvm-rg350-442fd0cdf895c26ea26db3291b465e87ac3ff466.tar.bz2
scummvm-rg350-442fd0cdf895c26ea26db3291b465e87ac3ff466.zip
I don't think UpdatePaletteMatchTable() has to write the table to file. In
fact, I'm not even sure the !data case ever happens. svn-id: r10425
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/palette.cpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/sword2/driver/palette.cpp b/sword2/driver/palette.cpp
index 3de703336e..f2b9ea0162 100644
--- a/sword2/driver/palette.cpp
+++ b/sword2/driver/palette.cpp
@@ -138,18 +138,18 @@ uint8 GetMatch(uint8 r, uint8 g, uint8 b) {
}
// 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 @@ int32 UpdatePaletteMatchTable(uint8 *data) {
}
}
}
-
- // 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;
}