diff options
-rw-r--r-- | engines/cge2/cge2_main.cpp | 38 | ||||
-rw-r--r-- | engines/cge2/snail.cpp | 5 |
2 files changed, 27 insertions, 16 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 5fa44531df..b17f48dacd 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -475,15 +475,6 @@ void CGE2Engine::sceneDown() { _spare->dispose(); } -void CGE2Engine::closePocket() { - for (int i = 0; i < 2; i++) { - for (int j = 0; j < kPocketMax + 1; j++) { - Sprite *spr = _heroTab[i]->_pocket[j]; - _heroTab[i]->_pocket[j] = (Sprite*)((spr) ? spr->_ref : -1); - } - } -} - void CGE2Engine::switchScene(int scene) { if (scene == _now) return; @@ -607,15 +598,38 @@ void CGE2Engine::tick() { } void CGE2Engine::openPocket() { - warning("STUB: CGE2Engine::openPocket()"); + for (int i = 0; i < 2; i++) { + for (int j = 0; j < kPocketMax + 1; j++) { + int ref = (int)_heroTab[i]->_pocket[j]; + _heroTab[i]->_pocket[j] = (ref == -1) ? nullptr : _vga->_showQ->locate(ref); + } + } +} + +void CGE2Engine::closePocket() { + for (int i = 0; i < 2; i++) { + for (int j = 0; j < kPocketMax + 1; j++) { + Sprite *spr = _heroTab[i]->_pocket[j]; + _heroTab[i]->_pocket[j] = (Sprite*)((spr) ? spr->_ref : -1); + } + } } + void CGE2Engine::selectPocket(int n) { - warning("STUB: CGE2Engine::selectPocket()"); + Sprite **p = _heroTab[_sex]->_pocket; + int &pp = _heroTab[_sex]->_pocPtr; + if (n < 0 || pp == n) { + n = findActivePocket(-1); + if (n >= 0) + pp = n; + } else if (p[n]) { + pp = n; + } } void CGE2Engine::busy(bool on) { - warning("STUB: CGE2Engine::selectPocket()"); + warning("STUB: CGE2Engine::busy()"); } void CGE2Engine::runGame() { diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index e3c3baaccc..3a17168893 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -740,9 +740,6 @@ void CGE2Engine::feedSnail(Sprite *spr, Action snq, Hero *hero) { CommandHandler::Command *c = &comtab[ptr]; CommandHandler::Command *q = &comtab[cnt]; - warning("STUB: CGE2Engine::feedSnail()"); - // Dont bother with pockets (inventory system) for now... TODO: Implement it later!!! - /* int pocFre = freePockets(hero->_ref & 1); int pocReq = 0; CommandHandler::Command *p = c; @@ -771,7 +768,7 @@ void CGE2Engine::feedSnail(Sprite *spr, Action snq, Hero *hero) { pocFul(); return; } - }*/ + } while (c < q) { if (c->_commandType == kCmdTalk) { |