diff --git a/insane.cpp b/insane.cpp index 3a89efbb077..75a065e0ae3 100644 --- a/insane.cpp +++ b/insane.cpp @@ -414,7 +414,7 @@ void codec37(CodecData *cd, PersistentCodecData37 *pcd) { case 1: case 4: - printf("code %d", cd->src[0]); + warning("code %d", cd->src[0]); return; default: @@ -596,6 +596,9 @@ void SmushPlayer::startVideo(short int arg, byte* videoFile) fileSize=fileReadBE32(); + sm->videoFinished = 0; + sm->_insaneState = 1; + do { if(ftell(_in)>=fileSize ) return; @@ -613,10 +616,12 @@ void SmushPlayer::startVideo(short int arg, byte* videoFile) updateScreen(sm); sm->delta = sm->_system->waitTick(sm->delta); + + sm->processKbd(); - if(sm->_keyPressed == sm->_vars[sm->VAR_CUTSCENEEXIT_KEY]) - return; - } while (1); + } while (!sm->videoFinished); + + sm->_insaneState = 0; } diff --git a/scumm.h b/scumm.h index b2baf2ea4a6..b3ce1767b53 100644 --- a/scumm.h +++ b/scumm.h @@ -591,6 +591,8 @@ public: /* _insane vars */ int _insaneFlag; + int _insaneState; + int videoFinished; void scummInit(); diff --git a/scummvm.cpp b/scummvm.cpp index 5fb8785ca9a..ee128c89b52 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -788,7 +788,10 @@ void Scumm::processKbd() { } if (_lastKeyHit==_vars[VAR_CUTSCENEEXIT_KEY]) { - exitCutscene(); + if (_insaneState) { + videoFinished=1; + } else + exitCutscene(); } else if (_lastKeyHit==_vars[VAR_SAVELOADDIALOG_KEY]) { if ( _features & GF_AFTER_V7) runScript(_vars[VAR_UNK_SCRIPT],0,0,0); diff --git a/sdl.cpp b/sdl.cpp index 74d94b22a4e..684abff9a6f 100644 --- a/sdl.cpp +++ b/sdl.cpp @@ -1087,6 +1087,8 @@ int main(int argc, char* argv[]) { scumm->_insaneFlag = 12; + scumm->_insaneState = 0; + /* */ scumm->_fullScreen = detector._fullScreen;