aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2/snail.cpp
diff options
context:
space:
mode:
authoruruk2014-06-17 15:37:55 +0200
committeruruk2014-06-17 15:37:55 +0200
commit186d90e5b58c09e04f570b51f97a7bd3315dcbde (patch)
tree89ad609f7854fa078c0a76b6b0be13c0838d739e /engines/cge2/snail.cpp
parent40262bad980ffb0a86492e67c5430b24e6454438 (diff)
downloadscummvm-rg350-186d90e5b58c09e04f570b51f97a7bd3315dcbde.tar.gz
scummvm-rg350-186d90e5b58c09e04f570b51f97a7bd3315dcbde.tar.bz2
scummvm-rg350-186d90e5b58c09e04f570b51f97a7bd3315dcbde.zip
CGE2: Implement switching between scenes.
Minor modification in Spare again to do so.
Diffstat (limited to 'engines/cge2/snail.cpp')
-rw-r--r--engines/cge2/snail.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index 068ccf86d5..d799f28cc1 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -301,7 +301,20 @@ void CommandHandler::runCommand() {
_vm->snDim(spr, tailCmd._val);
break;
case kCmdExec:
- warning("Unhandled command - kCmdExec");
+ switch (tailCmd._cbType) {
+ case kQGame:
+ _vm->qGame();
+ break;
+ case kXScene:
+ _vm->xScene();
+ break;
+ case kSoundSetVolume:
+ _vm->sndSetVolume();
+ break;
+ default:
+ error("Unknown Callback Type in SNEXEC");
+ break;
+ }
break;
case kCmdStep:
spr->step();
@@ -638,6 +651,20 @@ Sprite *CGE2Engine::expandSprite(Sprite *spr) {
return spr;
}
+void CGE2Engine::qGame() {
+ warning("STUB: CGE2Engine::qGame()");
+ _endGame = true;
+}
+
+void CGE2Engine::xScene() {
+ sceneDown();
+ sceneUp(_req);
+}
+
+void CGE2Engine::sndSetVolume() {
+ warning("STUB: CGE2Engine::sndSetVolume()");
+}
+
void CommandHandler::addCommand(CommandType com, int ref, int val, void *ptr) {
if (ref == 2)
ref = 142 - _vm->_sex;
@@ -653,7 +680,17 @@ void CommandHandler::addCommand(CommandType com, int ref, int val, void *ptr) {
}
void CommandHandler::addCallback(CommandType com, int ref, int val, CallbackType cbType) {
- warning("STUB: CommandHandler::addCallback()");
+ Command *headCmd = &_commandList[_head++];
+ headCmd->_commandType = com;
+ headCmd->_ref = ref;
+ headCmd->_val = val;
+ headCmd->_spritePtr = NULL;
+ headCmd->_cbType = cbType;
+ if (headCmd->_commandType == kCmdClear) {
+ _tail = _head;
+ _vm->killText();
+ _timerExpiry = 0;
+ }
}
void CommandHandler::insertCommand(CommandType com, int ref, int val, void *ptr) {