aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2/snail.cpp
diff options
context:
space:
mode:
authoruruk2014-05-29 19:58:38 +0200
committeruruk2014-05-29 19:58:38 +0200
commit7c73ce5d8b516976180aa38e76f75e88b1cbc474 (patch)
tree4ecd903629a733c0086f006a8449ed5df91ce1b7 /engines/cge2/snail.cpp
parent566419f3ad868272df5bce837558592668c5aff6 (diff)
downloadscummvm-rg350-7c73ce5d8b516976180aa38e76f75e88b1cbc474.tar.gz
scummvm-rg350-7c73ce5d8b516976180aa38e76f75e88b1cbc474.tar.bz2
scummvm-rg350-7c73ce5d8b516976180aa38e76f75e88b1cbc474.zip
CGE2: Implement snSend().
Diffstat (limited to 'engines/cge2/snail.cpp')
-rw-r--r--engines/cge2/snail.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index 45ca715d26..d92862a1ed 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -361,7 +361,39 @@ void CGE2Engine::snRSeq(Sprite *spr, int val) {
}
void CGE2Engine::snSend(Sprite *spr, int val) {
- warning("STUB: CGE2Engine::snSend()");
+ if (!spr)
+ return;
+
+ // Sending", spr->File
+ // from cave", spr->Cave
+ // to cave", val
+ bool was1 = (_vga->_showQ->locate(spr->_ref) != nullptr);
+ bool val1 = (val == 0 || val == _now);
+ spr->_scene = val;
+ releasePocket(spr);
+ if (val1 != was1) {
+ if (was1) {
+ // deactivating
+ hide1(spr);
+ spr->_flags._slav = false;
+ if (spr == _heroTab[_sex]->_ptr)
+ if (_heroTab[!_sex]->_ptr->_scene == _now)
+ switchHero(!_sex);
+ _spare->dispose(spr);
+ } else {
+ // activating
+ if (byte(spr->_ref) == 0)
+ _bitmapPalette = _vga->_sysPal;
+ _vga->_showQ->insert(spr);
+ if (isHero(spr)) {
+ V2D p = *_heroTab[spr->_ref & 1]->_posTab[val];
+ spr->gotoxyz(V3D(p.x, 0, p.y));
+ ((Hero*)spr)->setCurrent();
+ }
+ _taken = false;
+ _bitmapPalette = NULL;
+ }
+ }
}
void CGE2Engine::snSwap(Sprite *spr, int val) {
@@ -492,6 +524,10 @@ void CGE2Engine::snGhost(Bitmap *bmp) {
warning("STUB: CGE2Engine::snGhost()");
}
+void CGE2Engine::hide1(Sprite *spr) {
+ _commandHandlerTurbo->addCommand(kCmdGhost, -1, 0, spr->ghost());
+}
+
void CommandHandler::addCommand(CommandType com, int ref, int val, void *ptr) {
if (ref == 2)
ref = 142 - _vm->_sex;