From a4990f6f334b3d52c5a593750df9bcd4034d8442 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 27 Dec 2009 01:49:39 +0000 Subject: Now using m_kiewitz's picture code to show pictures in SCI32. Also took some bits off a similar patch from clone2727. The Sierra logo screen and the menu screen in GK1 should now be shown fully! svn-id: r46609 --- engines/sci/engine/kernel32.cpp | 17 +++++++++-------- engines/sci/engine/script.cpp | 1 + engines/sci/engine/vm.h | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'engines/sci') 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 }; -- cgit v1.2.3