diff options
-rw-r--r-- | engines/sci/engine/kernel32.cpp | 17 | ||||
-rw-r--r-- | engines/sci/engine/script.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/vm.h | 1 |
3 files changed, 11 insertions, 8 deletions
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp index 04ab939716..af1516f22b 100644 --- a/engines/sci/engine/kernel32.cpp +++ b/engines/sci/engine/kernel32.cpp @@ -675,18 +675,18 @@ reg_t kDeleteScreenItem(EngineState *s, int argc, reg_t *argv) { reg_t kAddPlane(EngineState *s, int argc, reg_t *argv) { reg_t picObj = argv[0]; - // This kernel call shows pictures on screen - // The picture ID is likely in the "picture" selector (?) // TODO + // The picture selector usually doesn't hold the actual picture at this point. It's filled in + // when kUpdatePlane is called + warning("kAddPlane object %04x:%04x", PRINT_REG(picObj)); return NULL_REG; } reg_t kDeletePlane(EngineState *s, int argc, reg_t *argv) { reg_t picObj = argv[0]; - // The picture ID is likely in the "picture" selector (?) // TODO @@ -696,17 +696,18 @@ reg_t kDeletePlane(EngineState *s, int argc, reg_t *argv) { reg_t kUpdatePlane(EngineState *s, int argc, reg_t *argv) { reg_t picObj = argv[0]; - // The picture ID is likely in the "picture" selector (?) + int16 picNum = GET_SEL32V(s->_segMan, picObj, picture); - // TODO + if (picNum > -1) { + s->_gui->drawPicture(picNum, 100, false, false, false, 0); + s->_gui->animateShowPic(); + } - warning("kUpdatePlane object %04x:%04x", PRINT_REG(picObj)); - return NULL_REG; + return s->r_acc; } reg_t kRepaintPlane(EngineState *s, int argc, reg_t *argv) { reg_t picObj = argv[0]; - // The picture ID is likely in the "picture" selector (?) // TODO diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 0bab7f31ae..36f47e8da8 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -240,6 +240,7 @@ void Kernel::mapSelectors() { #ifdef ENABLE_SCI32 FIND_SELECTOR(data); + FIND_SELECTOR(picture); #endif } diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index 25acfc5ae6..93116dc675 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -198,6 +198,7 @@ struct SelectorCache { #ifdef ENABLE_SCI32 Selector data; // Used by Array() + Selector picture; // Used to hold the picture ID for SCI32 pictures #endif }; |