From 1b5d3e00a375acec452aee3a34fe7d508bbab4be Mon Sep 17 00:00:00 2001 From: lukaslw Date: Wed, 30 Jul 2014 23:44:45 +0200 Subject: PRINCE: FLC animations - update --- engines/prince/prince.cpp | 3 ++- engines/prince/script.cpp | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 17 deletions(-) (limited to 'engines/prince') diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 7f51fb284e..3fe43e6ed9 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -737,7 +737,7 @@ void PrinceEngine::setVoice(uint16 slot, uint32 sampleSlot, uint16 flag) { bool PrinceEngine::loadAnim(uint16 animNr, bool loop) { Common::String streamName = Common::String::format("AN%02d", animNr); - Common::SeekableReadStream * flicStream = SearchMan.createReadStreamForMember(streamName); + Common::SeekableReadStream *flicStream = SearchMan.createReadStreamForMember(streamName); if (!flicStream) { error("Can't open %s", streamName.c_str()); @@ -2299,6 +2299,7 @@ void PrinceEngine::moveRunHero(int heroId, int x, int y, int dir, bool runHeroFl } void PrinceEngine::leftMouseButton() { + _flags->setFlagValue(Flags::LMOUSE, 1); if (_mouseFlag) { int option = 0; int optionEvent = -1; diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 9dbab2f7e4..cf45d50fdb 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -1703,29 +1703,21 @@ void Interpreter::O_CHECKFLCFRAME() { uint16 frameNr = readScriptFlagValue(); debugInterpreter("O_CHECKFLCFRAME frame number %d", frameNr); if (_vm->_flicPlayer.getCurFrame() != frameNr) { - // Move instruction pointer before current instruction - // must do this check once again till it's false - _currentInstruction -= 2; + _currentInstruction -= 4; _opcodeNF = 1; } } void Interpreter::O_CHECKFLCEND() { - - //debugInterpreter("O_CHECKFLCEND"); - const Video::FlicDecoder &flicPlayer = _vm->_flicPlayer; - - //debug("frameCount %d, currentFrame %d", flicPlayer.getFrameCount(), flicPlayer.getCurFrame()); - + debugInterpreter("O_CHECKFLCEND frameCount %d, currentFrame %d", flicPlayer.getFrameCount(), flicPlayer.getCurFrame()); if (flicPlayer.getFrameCount() - flicPlayer.getCurFrame() > 1) { - // Move instruction pointer before current instruciton - // must do this check once again till it's false _currentInstruction -= 2; _opcodeNF = 1; } } +// TODO void Interpreter::O_FREEFLC() { debugInterpreter("O_FREEFLC"); } @@ -1828,14 +1820,14 @@ void Interpreter::O_SETVOICED() { } void Interpreter::O_VIEWFLCLOOP() { - uint16 value = readScriptFlagValue(); - _vm->loadAnim(value, true); - debugInterpreter("O_VIEWFLCLOOP animId %d", value); + uint16 animId = readScriptFlagValue(); + _vm->loadAnim(animId, true); + debugInterpreter("O_VIEWFLCLOOP animId %d", animId); } +// Not used in script void Interpreter::O_FLCSPEED() { - uint16 speed = readScriptFlagValue(); - debugInterpreter("O_FLCSPEED speed %d", speed); + error("O_FLCSPEED speed %d"); } void Interpreter::O_OPENINVENTORY() { -- cgit v1.2.3