aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormd52011-02-22 19:11:35 +0200
committermd52011-02-22 19:11:35 +0200
commita9620d938dc7031e47533f0dadf3295cd6488ca8 (patch)
tree4ac43693ea6fe05fceee117bd3e833b3c485b96a
parent8e7178a538d21c815b44692f30657600b4f866bc (diff)
downloadscummvm-rg350-a9620d938dc7031e47533f0dadf3295cd6488ca8.tar.gz
scummvm-rg350-a9620d938dc7031e47533f0dadf3295cd6488ca8.tar.bz2
scummvm-rg350-a9620d938dc7031e47533f0dadf3295cd6488ca8.zip
SCI: Some work on kRemapColors, and added a note that it operates on an RGBA
palette
-rw-r--r--engines/sci/engine/kgraphics.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 8730724d68..9034bd1d5c 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1201,14 +1201,12 @@ reg_t kShow(EngineState *s, int argc, reg_t *argv) {
}
reg_t kRemapColors(EngineState *s, int argc, reg_t *argv) {
- // TODO: This is all a stub/skeleton, thus we're invoking kStub() for now
- kStub(s, argc, argv);
-
uint16 operation = argv[0].toUint16();
switch (operation) {
- case 0: { // Initialize remapping to base. 0 turns remapping off.
- //int16 unk1 = (argc >= 2) ? argv[1].toSint16() : 0;
+ case 0: { // Set remapping to base. 0 turns remapping off.
+ int16 base = (argc >= 2) ? argv[1].toSint16() : 0;
+ warning("kRemapColors: Set remapping to base %d", base);
}
break;
case 1: { // unknown
@@ -1218,18 +1216,25 @@ reg_t kRemapColors(EngineState *s, int argc, reg_t *argv) {
//int16 unk3 = argv[3].toSint16();
//uint16 unk4 = argv[4].toUint16();
//uint16 unk5 = (argc >= 6) ? argv[5].toUint16() : 0;
+ kStub(s, argc, argv);
}
break;
case 2: { // remap by percent
- //int16 unk1 = argv[1].toSint16();
- //uint16 percent = argv[2].toUint16();
- //uint16 unk3 = (argc >= 4) ? argv[3].toUint16() : 0;
+ // 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
+ 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);
}
break;
case 3: { // remap to gray
- //int16 unk1 = argv[1].toSint16();
- //int16 percent = argv[2].toSint16(); // 0 - 100
- //uint16 unk3 = (argc >= 4) ? argv[3].toUint16() : 0;
+ // 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
+ int16 percent = argv[2].toSint16(); // 0 - 100
+ uint16 unk3 = (argc >= 4) ? argv[3].toUint16() : 0;
+ warning("kRemapColors: RemapToGray color %d by %d percent (unk3 = %d)", color, percent, unk3);
}
break;
case 4: { // unknown
@@ -1237,11 +1242,13 @@ reg_t kRemapColors(EngineState *s, int argc, reg_t *argv) {
//uint16 unk2 = argv[2].toUint16();
//uint16 unk3 = argv[3].toUint16();
//uint16 unk4 = (argc >= 5) ? argv[4].toUint16() : 0;
+ kStub(s, argc, argv);
}
break;
case 5: { // increment color
//int16 unk1 = argv[1].toSint16();
//uint16 unk2 = argv[2].toUint16();
+ kStub(s, argc, argv);
}
break;
default: