aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Battaglia2009-05-24 17:08:03 +0000
committerFabio Battaglia2009-05-24 17:08:03 +0000
commitdd41ba80da92e620c72cd23b53880774d3b806a6 (patch)
tree57b864e83d772e5ca701a57935913a3163fdee18
parentb3c6751b9b7fc1401fd5e87a034cdaec92b67b20 (diff)
downloadscummvm-rg350-dd41ba80da92e620c72cd23b53880774d3b806a6.tar.gz
scummvm-rg350-dd41ba80da92e620c72cd23b53880774d3b806a6.tar.bz2
scummvm-rg350-dd41ba80da92e620c72cd23b53880774d3b806a6.zip
tinsel: Changes to psx palette conversion function
svn-id: r40869
-rw-r--r--engines/tinsel/palette.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index 065fc24ae6..438624b68c 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -100,15 +100,15 @@ COLORREF* psxClutToRGBPal(uint8 *srcClut, int *colours) {
int coloursInPalette = 0;
// Allocate space for the 16 colour destination palette
- COLORREF *dstPal = (COLORREF*)calloc(sizeof(COLORREF), MAX_COLOURS);
- memset(dstPal, 0, MAX_COLOURS * sizeof(COLORREF));
+ COLORREF *dstPal = (COLORREF*)calloc(sizeof(COLORREF), 16);
+ memset(dstPal, 0, 16 * sizeof(COLORREF));
- for (int idx = 0; idx < 0x10; idx++) {
+ for (int idx = 0; idx < 16; idx++) {
clutEntry = READ_LE_UINT16(srcClut); // Read PSX CLUT entry
srcClut += sizeof(uint16);
if ((clutEntry == 0) && (coloursInPalette == 0))
- coloursInPalette++;
+ continue;
else if ((clutEntry == 0) && (coloursInPalette != 0)) {
*colours = coloursInPalette;
return dstPal;