diff options
author | uruk | 2014-06-10 17:27:59 +0200 |
---|---|---|
committer | uruk | 2014-06-10 17:27:59 +0200 |
commit | 5a5fe344a0f26f164b4908109bbf7cfa39e6c47f (patch) | |
tree | 6434ac56a54ac09e0302d6dd6c2640ff18c7bf45 /engines/cge2/snail.cpp | |
parent | 85c55333b334f18f795118a3a3e4a2d2c210253b (diff) | |
download | scummvm-rg350-5a5fe344a0f26f164b4908109bbf7cfa39e6c47f.tar.gz scummvm-rg350-5a5fe344a0f26f164b4908109bbf7cfa39e6c47f.tar.bz2 scummvm-rg350-5a5fe344a0f26f164b4908109bbf7cfa39e6c47f.zip |
CGE2: Implement display of speech bubbles.
The sound code connected to them is still gappy.
Diffstat (limited to 'engines/cge2/snail.cpp')
-rw-r--r-- | engines/cge2/snail.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index 6957f8f50e..aa0988f293 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -126,8 +126,7 @@ void CommandHandler::runCommand() { _vm->snHide(spr, tailCmd._val); break; case kCmdSay: - if (spr && spr->active() && _talkEnable) //-- mouth animation - warning("STUB: CommandHandler::runCommand() - Mouth animation missing!"); + _vm->snSay(spr, tailCmd._val); break; case kCmdInf: if (_talkEnable) @@ -559,6 +558,24 @@ void CGE2Engine::snGhost(Bitmap *bmp) { bmp = nullptr; } +void CGE2Engine::snSay(Sprite *spr, int val) { + if (spr && spr->active() && _commandHandler->_talkEnable) { + //-- mouth animation + if (isHero(spr) && spr->seqTest(-1)) + ((Hero *)spr)->say(); + if (_sayCap) + _text->say(_text->getText(val), spr); + if (_sayVox) { + int i = val; + if (i < 256) + i -= 100; + // TODO: These 2 lines may need some re-check with the whole sound-code! + snSound(spr, i); + _commandStat._wait = &_sound->_smpinf._counter; + } + } +} + void CGE2Engine::hide1(Sprite *spr) { _commandHandlerTurbo->addCommand(kCmdGhost, -1, 0, spr->ghost()); } |