aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorHeather Douglass2011-10-08 20:43:54 -0700
committerFilippos Karapetis2011-10-12 02:50:28 +0300
commit084b2deccc7eeb64f2936dbb6cd0fb47319e5db2 (patch)
tree2e8db8ba7856bc9d7a8333a21c592b3bc88d788b /engines/sci/engine
parentc5e6cdea551f34fd78ab23411d76724959d597a8 (diff)
downloadscummvm-rg350-084b2deccc7eeb64f2936dbb6cd0fb47319e5db2.tar.gz
scummvm-rg350-084b2deccc7eeb64f2936dbb6cd0fb47319e5db2.tar.bz2
scummvm-rg350-084b2deccc7eeb64f2936dbb6cd0fb47319e5db2.zip
SCI: Implementation of kCelInfo subop 4
kCelInfo subop 4 returns the pixel color at the passed in x,y coordinates for the passed in view, loop, cel. Shivers uses this function for the red door puzzle, room 23601 to determine what blocks on the puzzle board are already occupied by pieces.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index c60c0a44b9..ce670b21fe 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1471,10 +1471,8 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
}
reg_t kCelInfo(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);
-
- // Used by Shivers 1, room 23601
+ // Used by Shivers 1, room 23601 to determine what blocks on the red door puzzle board
+ // are occupied by pieces already
// 6 arguments, all integers:
// argv[0] - subop (0 - 4). It's constantly called with 4 in Shivers 1
@@ -1490,7 +1488,21 @@ reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) {
// 2, 3 - nop
// 4 - return value of pixel at x, y
- return s->r_acc;
+ switch (argv[0].toUint16()) {
+ case 4: {
+ GuiResourceId viewId = argv[1].toSint16();
+ int16 loopNo = argv[2].toSint16();
+ int16 celNo = argv[3].toSint16();
+ int16 x = argv[4].toUint16();
+ int16 y = argv[5].toUint16();
+ byte color = g_sci->_gfxCache->kernelViewGetColorAtCoordinate(viewId, loopNo, celNo, x, y);
+ return make_reg(0, color);
+ }
+ default: {
+ kStub(s, argc, argv);
+ return s->r_acc;
+ }
+ }
}
reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) {