diff options
author | uruk | 2014-05-29 19:58:38 +0200 |
---|---|---|
committer | uruk | 2014-05-29 19:58:38 +0200 |
commit | 7c73ce5d8b516976180aa38e76f75e88b1cbc474 (patch) | |
tree | 4ecd903629a733c0086f006a8449ed5df91ce1b7 /engines | |
parent | 566419f3ad868272df5bce837558592668c5aff6 (diff) | |
download | scummvm-rg350-7c73ce5d8b516976180aa38e76f75e88b1cbc474.tar.gz scummvm-rg350-7c73ce5d8b516976180aa38e76f75e88b1cbc474.tar.bz2 scummvm-rg350-7c73ce5d8b516976180aa38e76f75e88b1cbc474.zip |
CGE2: Implement snSend().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/bitmap.h | 2 | ||||
-rw-r--r-- | engines/cge2/cge2.h | 4 | ||||
-rw-r--r-- | engines/cge2/cge2_main.cpp | 8 | ||||
-rw-r--r-- | engines/cge2/snail.cpp | 38 |
4 files changed, 50 insertions, 2 deletions
diff --git a/engines/cge2/bitmap.h b/engines/cge2/bitmap.h index e5f38a05d7..82c3b07e31 100644 --- a/engines/cge2/bitmap.h +++ b/engines/cge2/bitmap.h @@ -50,7 +50,7 @@ enum { struct HideDesc { uint16 _skip; uint16 _hide; -} PACKED_STRUCT; +}; #include "common/pack-end.h" diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index c2e0dab2be..cac5a08936 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -136,6 +136,8 @@ public: void checkSaySwitch(); void qGame(); void loadPos(); + void releasePocket(Sprite *spr); + void switchHero(bool sex); void setEye(V3D &e); void setEye(const V2D& e2, int z = -kScrWidth); @@ -185,6 +187,8 @@ public: void snSound(Sprite *spr, int wav); void snRoom(Sprite *spr, int val); void snGhost(Bitmap *bmp); + + void hide1(Sprite *spr); const ADGameDescription *_gameDescription; diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index e1641b9f12..d4cee68871 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -582,6 +582,10 @@ void CGE2Engine::loadPos() { error("Missing file: CGE.HXY"); } +void CGE2Engine::releasePocket(Sprite *spr) { + warning("STUB: CGE2Engine::releasePocket()"); +} + void CGE2Engine::checkSaySwitch() { warning("STUB: CGE2Engine::checkSaySwitch()"); } @@ -748,4 +752,8 @@ void CGE2Engine::killText() { _talk = NULL; } +void CGE2Engine::switchHero(bool sex) { + warning("STUB: CGE2Engine::switchHero()"); +} + } // End of namespace CGE2 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; |