diff options
author | Travis Howell | 2004-02-08 14:11:11 +0000 |
---|---|---|
committer | Travis Howell | 2004-02-08 14:11:11 +0000 |
commit | 587622d664777c3670c9222424e379726b88bb81 (patch) | |
tree | 38fdcc392b6e36c9c61351b7c2c4e983156cb65e | |
parent | a745b3a7d0fe1080e421e3ed3ef26cbdc7919fb6 (diff) | |
download | scummvm-rg350-587622d664777c3670c9222424e379726b88bb81.tar.gz scummvm-rg350-587622d664777c3670c9222424e379726b88bb81.tar.bz2 scummvm-rg350-587622d664777c3670c9222424e379726b88bb81.zip |
More cutscene fixes from roever
svn-id: r12774
-rw-r--r-- | sword1/animation.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sword1/animation.cpp b/sword1/animation.cpp index c6ea7bc0cb..7a132e7703 100644 --- a/sword1/animation.cpp +++ b/sword1/animation.cpp @@ -40,8 +40,10 @@ AnimationState::~AnimationState() { delete sndfile; #ifndef BACKEND_8BIT _sys->hide_overlay(); - delete overlay; + free(overlay); #endif + if (bgSoundStream) + delete bgSoundStream; #endif } @@ -137,7 +139,7 @@ bool AnimationState::init(const char *basename) { sprintf(tempFile, "%s.ogg", basename); if (sndfile->open(tempFile)) { bgSoundStream = makeVorbisStream(sndfile, sndfile->size()); - _snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1); + _snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false); } #endif @@ -315,8 +317,6 @@ bool AnimationState::decodeFrame() { * events are processed. */ - OSystem::Event event; - #ifdef BACKEND_8BIT if (checkPaletteSwitch() || (bgSoundStream == NULL) || (bgSoundStream->getSamplesPlayed()*12/bgSoundStream->getRate()) < (framenum+3)){ @@ -330,7 +330,6 @@ bool AnimationState::decodeFrame() { while (_sys->get_msecs() < ticks) _sys->delay_msecs(10); } - _sys->poll_event(&event); } else warning("dropped frame %i", framenum); @@ -350,7 +349,6 @@ bool AnimationState::decodeFrame() { while (_sys->get_msecs() < ticks) _sys->delay_msecs(10); } - _sys->poll_event(&event); } else warning("dropped frame %i", framenum); @@ -388,6 +386,16 @@ void MoviePlayer::play(const char *filename) { _sys->update_screen(); #endif // FIXME: check for ESC and abbort animation be just returning from the function + OSystem::Event event; + while (_sys->poll_event(&event)) { + if ((event.event_code == OSystem::EVENT_KEYDOWN) && + (event.kbd.keycode == 27)) { + delete anim; + return; + } + if (event.event_code == OSystem::EVENT_QUIT) + _sys->quit(); + } } } |