diff options
author | Filippos Karapetis | 2011-01-22 13:01:10 +0000 |
---|---|---|
committer | Filippos Karapetis | 2011-01-22 13:01:10 +0000 |
commit | 89087b18c79885680ad1f0d17d36975ea7b06f13 (patch) | |
tree | 87e07190e5e610881db62cac72f47421f4d23850 /engines/sci/engine | |
parent | 7c14cf2b1bddaf4ec9403f49a1fc09ec750ee6c6 (diff) | |
download | scummvm-rg350-89087b18c79885680ad1f0d17d36975ea7b06f13.tar.gz scummvm-rg350-89087b18c79885680ad1f0d17d36975ea7b06f13.tar.bz2 scummvm-rg350-89087b18c79885680ad1f0d17d36975ea7b06f13.zip |
SCI21: Allow the game scripts to sync robot videos, like in SSCI. Also, references of the SciEngine class to itself via g_sci have been removed
svn-id: r55422
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 855c6a25c0..0065c7ae74 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -1398,6 +1398,7 @@ reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) { reg_t kRobot(EngineState *s, int argc, reg_t *argv) { int16 subop = argv[0].toUint16(); + GfxRobot *robot = g_sci->_gfxRobot; switch (subop) { case 0: { // init @@ -1407,10 +1408,7 @@ reg_t kRobot(EngineState *s, int argc, reg_t *argv) { int16 x = argv[4].toUint16(); int16 y = argv[5].toUint16(); warning("kRobot(init), id %d, obj %04x:%04x, flag %d, x=%d, y=%d", id, PRINT_REG(obj), flag, x, y); - GfxRobot *test = new GfxRobot(g_sci->getResMan(), g_sci->_gfxScreen, g_sci->_gfxPalette, id); - test->draw(x,y); - delete test; - + robot->init(id, x, y); } break; case 1: // LSL6 hires (startup) @@ -1422,11 +1420,10 @@ reg_t kRobot(EngineState *s, int argc, reg_t *argv) { } break; case 8: // sync - //warning("kRobot(sync), obj %04x:%04x", PRINT_REG(argv[1])); - // HACK: Make robots return immediately for now, - // otherwise they just hang for a while. - // TODO: Replace with proper robot functionality. - writeSelector(s->_segMan, argv[1], SELECTOR(signal), SIGNAL_REG); + robot->drawNextFrame(); + // Sync + if (robot->getCurFrame() == robot->getFrameCount()) + writeSelector(s->_segMan, argv[1], SELECTOR(signal), SIGNAL_REG); break; default: warning("kRobot(%d)", subop); |