aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authormd52011-02-24 21:26:00 +0200
committermd52011-02-24 21:27:31 +0200
commite0ce5a61b54cde3916b9aad51be43e8e9d5ea651 (patch)
treedf4871c54668965b3cf288978d317f8357a2e393 /engines
parentf890c1b6ed3bf465fd7e372c2b2d29bd93cd048c (diff)
downloadscummvm-rg350-e0ce5a61b54cde3916b9aad51be43e8e9d5ea651.tar.gz
scummvm-rg350-e0ce5a61b54cde3916b9aad51be43e8e9d5ea651.tar.bz2
scummvm-rg350-e0ce5a61b54cde3916b9aad51be43e8e9d5ea651.zip
SCI: Added an initial implementation of RemapByPercent, which fixes the palette in the PQ:SWAT demo
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 9034bd1d5c..2bcf5903c0 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1220,12 +1220,19 @@ reg_t kRemapColors(EngineState *s, int argc, reg_t *argv) {
}
break;
case 2: { // remap by percent
- // NOTE: This adjusts the alpha value of a specific color, and it operates on
- // an RGBA palette
- int16 color = argv[1].toSint16(); // this is subtracted from a maximum color value, and can be offset by 10
+ // This adjusts the alpha value of a specific color, and it operates on
+ // an RGBA palette. Since we're operating on an RGB palette, we just
+ // modify the color intensity instead
+ // TODO: From what I understand, palette remapping should be placed
+ // separately, so that it can be reset by case 0 above. Thus, we
+ // should adjust the functionality of the Palette class accordingly.
+ int16 color = argv[1].toSint16();
+ if (color >= 10)
+ color -= 10;
uint16 percent = argv[2].toUint16(); // 0 - 100
- uint16 unk3 = (argc >= 4) ? argv[3].toUint16() : 0;
- warning("kRemapColors: RemapByPercent color %d by %d percent (unk3 = %d)", color, percent, unk3);
+ if (argc >= 4)
+ warning("RemapByPercent called with 4 parameters, unknown parameter is %d", argv[3].toUint16());
+ g_sci->_gfxPalette->kernelSetIntensity(color, 255, percent, false);
}
break;
case 3: { // remap to gray