aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2014-06-23 10:20:24 +0200
committeruruk2014-06-23 10:20:24 +0200
commit2226eb078969dc4217bb490e594819e027187590 (patch)
tree0f4ffc176a309469807926bed7a7225742403c10
parent19bc15193941d9afd5a896c8bdead2e896f780bd (diff)
downloadscummvm-rg350-2226eb078969dc4217bb490e594819e027187590.tar.gz
scummvm-rg350-2226eb078969dc4217bb490e594819e027187590.tar.bz2
scummvm-rg350-2226eb078969dc4217bb490e594819e027187590.zip
CGE2: Implement snSay(), reimplement some parts of the sound code.
-rw-r--r--engines/cge2/snail.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index 300c02a66a..5ec62746f9 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -286,13 +286,12 @@ void CommandHandler::runCommand() {
break;
case kCmdSound:
_vm->snSound(spr, tailCmd._val);
- _count = 1;
break;
case kCmdMap:
_vm->_heroTab[tailCmd._ref & 1]->_ptr->_ignoreMap = tailCmd._val == 0;
break;
case kCmdCount:
- _count = tailCmd._val;
+ _vm->_sound->setRepeat(tailCmd._val);
break;
case kCmdRoom:
_vm->snRoom(spr, tailCmd._val);
@@ -512,7 +511,10 @@ void CGE2Engine::snKeep(Sprite *spr, int stp) {
if (spr && !spr->_flags._kept && ht->_pocket[pp] == nullptr) {
V3D pos(14, -10, -1);
+ int16 oldRepeat = _sound->getRepeat();
+ _sound->setRepeat(1);
snSound(ht->_ptr, 3);
+ _sound->setRepeat(oldRepeat);
if (_taken) {
_vga->_showQ->insert(spr);
_taken = false;
@@ -674,7 +676,8 @@ void CGE2Engine::snSound(Sprite *spr, int wav) {
_sound->play(_fx->load(_commandStat._ref[1], _commandStat._ref[0]),
(spr) ? (spr->_pos2D.x / (kScrWidth / 16)) : 8);
}
-
+
+ _sound->setRepeat(1);
}
void CGE2Engine::snRoom(Sprite *spr, int val) {
@@ -711,7 +714,14 @@ void CGE2Engine::snSay(Sprite *spr, int val) {
int i = val;
if (i < 256)
i -= 100;
- warning("STUB: CGE2Engine::snSay"); // TODO: Implement it with the revision of the sound code!
+ int16 oldRepeat = _sound->getRepeat();
+ _sound->setRepeat(1);
+ snSound(spr, i);
+ _sound->setRepeat(oldRepeat);
+ //_commandStat._wait = &_sound->_smpinf._counter;
+ // This line is commented out for now since I wasn't able to find where this flag is reset
+ // and it's prevented the main loop from doing anything.
+ // TODO: Recheck this later! At the moment it seems working fine.
}
}
}