diff options
author | Paul Gilbert | 2014-04-15 19:28:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-04-15 19:28:29 -0400 |
commit | 7b907be93775167eab8efab45bea3b9a2776e288 (patch) | |
tree | 5637e0c2adc76e044b2129309df58e8fe470e2a4 /engines/mads/nebular | |
parent | 3db3aced02bd028b41939818b5aa1028733886f3 (diff) | |
download | scummvm-rg350-7b907be93775167eab8efab45bea3b9a2776e288.tar.gz scummvm-rg350-7b907be93775167eab8efab45bea3b9a2776e288.tar.bz2 scummvm-rg350-7b907be93775167eab8efab45bea3b9a2776e288.zip |
MADS: General cleanup and minor renamings
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r-- | engines/mads/nebular/dialogs_nebular.cpp | 27 | ||||
-rw-r--r-- | engines/mads/nebular/dialogs_nebular.h | 7 | ||||
-rw-r--r-- | engines/mads/nebular/game_nebular.cpp | 35 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes1.cpp | 18 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes2.cpp | 22 |
5 files changed, 67 insertions, 42 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 30b28fe9d7..3606830abc 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -242,6 +242,33 @@ bool DialogsNebular::show(int msgId) { return result; } +void DialogsNebular::showItem(int objectId, int messageId, int arg) { + show(messageId); +#if 0 + Scene &scene = _vm->_game->_scene; + byte highPalette[8 * 3]; + Common::copy(&_vm->_palette->_mainPalette[0x2E8], &_vm->_palette->_mainPalette[PALETTE_SIZE], + &highPalette[0]); + byte *depthP = scene._depthSurface.getData(); + byte greyScale[3]; + greyScale[0] = greyScale[1] = greyScale[2] = 0xFFFF; + Common::String setName = Common::String::format("*OBJ%.3d.SS", objectId); + + // Turn off cycling if active + bool cyclingActive = scene._cyclingActive; + scene._cyclingActive = false; + + // Make a copy of the current screen surface + byte *savedSurface = new byte[MADS_SCREEN_WIDTH * MADS_SCREEN_HEIGHT]; + Common::copy(_vm->_screen.getData(), _vm->_screen.getData() + + MADS_SCREEN_WIDTH * MADS_SCREEN_HEIGHT, savedSurface); + + + + delete[] savedSurface; +#endif +} + Common::String DialogsNebular::getVocab(int vocabId) { assert(vocabId > 0); diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h index e123efd49c..041dedadd5 100644 --- a/engines/mads/nebular/dialogs_nebular.h +++ b/engines/mads/nebular/dialogs_nebular.h @@ -50,10 +50,9 @@ public: virtual void showDialog() { warning("TODO: showDialog"); } - virtual void showPicture(int objId, int msgId, int arg3) { - show(msgId); - warning("TODO: showPicture"); - } + + virtual void showItem(int objectId, int msgId, int arg); + virtual bool show(int id); }; diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 4142cb4708..23c8b3cdd6 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -362,7 +362,7 @@ void GameNebular::doObjectAction() { _objects.addToInventory(OBJ_BLOWGUN); _objects.setRoom(OBJ_PLANT_STALK, PLAYER_INVENTORY); _globals[kBlowgunStatus] = 0; - dialogs.showPicture(OBJ_BLOWGUN, 809); + dialogs.showItem(OBJ_BLOWGUN, 809); } else if (action.isAction(VERB_PUT, 276, NOUN_BLOWGUN) && _objects.isInInventory(OBJ_POISON_DARTS) && _objects.isInInventory(OBJ_BLOWGUN)) { dialogs.show(433); @@ -374,7 +374,7 @@ void GameNebular::doObjectAction() { action.isAction(936) && _objects.isInInventory(OBJ_NOTE)) { _objects.setRoom(OBJ_NOTE, PLAYER_INVENTORY); _objects.addToInventory(OBJ_COMBINATION); - dialogs.showPicture(OBJ_COMBINATION, 851); + dialogs.showItem(OBJ_COMBINATION, 851); } else if ((action.isAction(VERB_LOOK) || action.isAction(NOUN_READ)) && ((id = _objects.getIdFromDesc(action._activeAction._objectNameId)) > 0 || (action._activeAction._indirectObjectId > 0 && @@ -390,7 +390,7 @@ void GameNebular::doObjectAction() { dialogs._indexList[7] = _globals[kTeleporterCode + 5]; dialogs._indexList[8] = _globals[kTeleporterCode + 2]; - dialogs.showPicture(id, 402); + dialogs.showItem(id, 402); } else { int messageId = 800 + id; if (id == OBJ_CHARGE_CASES) { @@ -410,14 +410,14 @@ void GameNebular::doObjectAction() { if (id == OBJ_PHONE_HANDSET && _globals[kHandsetCellStatus]) messageId = 861; - dialogs.showPicture(id, messageId); + dialogs.showItem(id, messageId); } } else if (action.isAction(VERB_PUT, NOUN_BURGER, NOUN_DEAD_FISH)) { if (_objects.isInInventory(OBJ_BURGER) || _objects.isInInventory(OBJ_DEAD_FISH)) { _objects.removeFromInventory(OBJ_DEAD_FISH, PLAYER_INVENTORY); _objects.removeFromInventory(OBJ_BURGER, PLAYER_INVENTORY); _objects.addToInventory(OBJ_STUFFED_FISH); - dialogs.showPicture(OBJ_STUFFED_FISH, 803); + dialogs.showItem(OBJ_STUFFED_FISH, 803); } } else if (action.isAction(VERB_PUT, 26, 357) && _objects.isInInventory(OBJ_AUDIO_TAPE) && _objects.isInInventory(OBJ_TAPE_PLAYER)) { @@ -449,7 +449,7 @@ void GameNebular::doObjectAction() { _objects.setRoom(OBJ_TIMER_MODULE, PLAYER_INVENTORY); _objects.addToInventory(OBJ_TIMEBOMB); - dialogs.showPicture(OBJ_TIMEBOMB, 404); + dialogs.showItem(OBJ_TIMEBOMB, 404); } else if (action.isAction(140, 271)) { dialogs.show(410); } else if (action.isAction(119, 46)) { @@ -458,7 +458,7 @@ void GameNebular::doObjectAction() { } else if (action.isAction(108, 136)) { if (_objects[OBJ_FISHING_LINE]._roomNumber == 3) { _objects.addToInventory(OBJ_FISHING_LINE); - dialogs.showPicture(OBJ_FISHING_LINE, 409); + dialogs.showItem(OBJ_FISHING_LINE, 409); } else { dialogs.show(428); } @@ -467,19 +467,19 @@ void GameNebular::doObjectAction() { case 1: case 2: _objects.addToInventory(OBJ_DURAFAIL_CELLS); - dialogs.showPicture(OBJ_DURAFAIL_CELLS, 412); + dialogs.showItem(OBJ_DURAFAIL_CELLS, 412); break; case 3: _objects.addToInventory(OBJ_PHONE_CELLS); - dialogs.showPicture(OBJ_DURAFAIL_CELLS, 413); + dialogs.showItem(OBJ_DURAFAIL_CELLS, 413); break; case 5: _objects.addToInventory(OBJ_DURAFAIL_CELLS); - dialogs.showPicture(OBJ_DURAFAIL_CELLS, 411); + dialogs.showItem(OBJ_DURAFAIL_CELLS, 411); break; case 6: _objects.addToInventory(OBJ_DURAFAIL_CELLS); - dialogs.showPicture(OBJ_DURAFAIL_CELLS, 429); + dialogs.showItem(OBJ_DURAFAIL_CELLS, 429); break; default: dialogs.show(478); @@ -489,24 +489,24 @@ void GameNebular::doObjectAction() { switch (_globals[kHandsetCellStatus]) { case 1: _objects.addToInventory(OBJ_DURAFAIL_CELLS); - dialogs.showPicture(OBJ_DURAFAIL_CELLS, + dialogs.showItem(OBJ_DURAFAIL_CELLS, _difficulty != 1 || _globals[kDurafailRecharged] ? 415 : 414); break; case 2: _objects.addToInventory(OBJ_DURAFAIL_CELLS); if (_difficulty == 1) { - dialogs.showPicture(OBJ_DURAFAIL_CELLS, 416); + dialogs.showItem(OBJ_DURAFAIL_CELLS, 416); } else { _globals[kHandsetCellStatus] = 0; } break; case 3: _objects.addToInventory(OBJ_PHONE_CELLS); - dialogs.showPicture(OBJ_PHONE_CELLS, 418); + dialogs.showItem(OBJ_PHONE_CELLS, 418); break; case 4: _objects.addToInventory(OBJ_PHONE_CELLS); - dialogs.showPicture(OBJ_PHONE_CELLS, 417); + dialogs.showItem(OBJ_PHONE_CELLS, 417); break; default: dialogs.show(478); @@ -525,8 +525,7 @@ void GameNebular::doObjectAction() { _globals[kHandsetCellStatus] = 3; _objects.setRoom(OBJ_PHONE_CELLS, PLAYER_INVENTORY); dialogs.show(421); - } - else { + } else { dialogs.show(422); } } else if (action.isAction(VERB_PUT, 115, 262)) { @@ -557,7 +556,7 @@ void GameNebular::doObjectAction() { } _objects.addToInventory(OBJ_CHICKEN_BOMB); - dialogs.showPicture(OBJ_CHICKEN_BOMB, 430); + dialogs.showItem(OBJ_CHICKEN_BOMB, 430); } else { return; } diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index 9ae9a46eb5..1de0dcd787 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -396,12 +396,12 @@ void Scene101::actions() { } if ((_action.isAction(VERB_TAKE, 0x137) || _action.isAction(VERB_PULL, 0x137)) && _game._objects.isInRoom(0x18)) { - _game._objects.addToInventory(0x18); + _game._objects.addToInventory(OBJ_SHIELD_MODULATOR); _scene->_sequences.remove(_globals._sequenceIndexes[13]); _globals._sequenceIndexes[13] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[14], false, 6, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[13], -2, -2); _scene->_hotspots.activate(0x137, false); - _vm->_dialogs->showPicture(0x18, 0x2788); + _vm->_dialogs->showItem(OBJ_SHIELD_MODULATOR, 10120); _vm->_sound->command(22); _action._inProgress = false; return; @@ -1133,7 +1133,7 @@ void Scene102::actions() { _game._player._visible = true; _game._player._stepEnabled = true; _vm->_sound->command(22); - _vm->_dialogs->showPicture(OBJ_BINOCULARS, 0x27D9); + _vm->_dialogs->showItem(OBJ_BINOCULARS, 10201); break; } _action._inProgress = false; @@ -1142,7 +1142,7 @@ void Scene102::actions() { if (_action.isAction(VERB_TAKE, 0x35) && _game._objects.isInRoom(OBJ_BURGER)) { if (_game._trigger == 0) { - _vm->_dialogs->showPicture(OBJ_BURGER, 0x27FB); + _vm->_dialogs->showItem(OBJ_BURGER, 10235); _scene->_sequences.remove(_globals._sequenceIndexes[10]); _game._objects.addToInventory(OBJ_BURGER); _scene->_hotspots.activate(0x35, false); @@ -1358,7 +1358,7 @@ void Scene103::actions() { _scene->_hotspots.activate(371, false); _vm->_game->_player._visible = true; _vm->_game->_player._stepEnabled = true; - _vm->_dialogs->showPicture(OBJ_REBREATHER, 805); + _vm->_dialogs->showItem(OBJ_REBREATHER, 805); break; default: @@ -1386,7 +1386,7 @@ void Scene103::actions() { _scene->_hotspots.activate(289, false); _vm->_game->_player._visible = true; _vm->_game->_player._stepEnabled = true; - _vm->_dialogs->showPicture(OBJ_REBREATHER, 804); + _vm->_dialogs->showItem(OBJ_REBREATHER, 804); break; default: @@ -1822,7 +1822,7 @@ void Scene105::actions() { _scene->_sequences.remove(_globals._sequenceIndexes[4]); _game._objects.addToInventory(OBJ_DEAD_FISH); _globals[kFishIn105] = false; - _vm->_dialogs->showPicture(OBJ_DEAD_FISH, 0x322, 0); + _vm->_dialogs->showItem(OBJ_DEAD_FISH, 802, 0); } } else if (_action.isAction(VERB_LOOK, 0x195)) _vm->_dialogs->show(0x2905); @@ -2141,7 +2141,7 @@ void Scene107::actions() { _scene->_sequences.remove(_globals._sequenceIndexes[4]); _game._objects.addToInventory(OBJ_DEAD_FISH); _globals[kFishIn107] = false; - _vm->_dialogs->showPicture(OBJ_DEAD_FISH, 0x322); + _vm->_dialogs->showItem(OBJ_DEAD_FISH, 802); } } else if (_action.isAction(0x15D, 0xEE)) _scene->_nextSceneId = 105; @@ -2227,7 +2227,7 @@ void Scene108::actions() { _scene->_sequences.remove(_globals._sequenceIndexes[4]); _game._objects.addToInventory(OBJ_DEAD_FISH); _globals[kFishIn108] = false; - _vm->_dialogs->showPicture(OBJ_DEAD_FISH, 0x2A38); + _vm->_dialogs->showItem(OBJ_DEAD_FISH, 10808); } } else if (_action.isAction(0x15D, 0xF4)) _scene->_nextSceneId = 107; diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 333bdc2d2b..2e5ef35cd3 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -781,10 +781,10 @@ void Scene202::actions() { if (_game._objects.isInInventory(OBJ_BONE)) { _game._objects.removeFromInventory(OBJ_BONE, 1); _game._objects.addToInventory(OBJ_BONES); - _vm->_dialogs->showPicture(OBJ_BONES, 0x4EFA, 0); + _vm->_dialogs->showItem(OBJ_BONES, 0x4EFA, 0); } else { _game._objects.addToInventory(OBJ_BONE); - _vm->_dialogs->showPicture(OBJ_BONE, 0x4EFA, 0); + _vm->_dialogs->showItem(OBJ_BONE, 0x4EFA, 0); } _scene->changeVariant(_globals[kBone202Status]); _game._player._stepEnabled = true; @@ -1352,9 +1352,9 @@ void Scene207::preActions() { void Scene207::actions() { if (_action._savedFields._lookFlag) { _vm->_dialogs->show(0x50E7); - } else if (_action.isAction(0x18B, 0x70)) + } else if (_action.isAction(0x18B, 0x70)) { _scene->_nextSceneId = 214; - else { + } else { if ((_game._player._playerPos.x > 150) && (_game._player._playerPos.x < 189) && (_game._player._playerPos.y > 111) && (_game._player._playerPos.y < 130)) { if ((_game._player._playerPos.x <= 162) && (_game._player._playerPos.x >= 181) && @@ -1622,7 +1622,7 @@ void Scene208::actions() { } else if (_action.isAction(VERB_TAKE, 0x1AA) && (!_globals[kLeavesStatus] || _game._trigger)) { subAction(1); if (_game._player._stepEnabled) - _vm->_dialogs->showPicture(OBJ_BIG_LEAVES, 0x326, 0); + _vm->_dialogs->showItem(OBJ_BIG_LEAVES, 0x326, 0); } else if (_action.isAction(VERB_PUT, 0x23, 0x19E) && (_globals[kLeavesStatus] == 1 || _game._trigger)) { subAction(2); } else if (_action.isAction(VERB_PUT, 0x17A, 0x1A9)) { @@ -1820,9 +1820,9 @@ void Scene209::handleLookStay() { _scene->_sequences.remove(_globals._sequenceIndexes[3]); _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 6); - if (!_dodgeFl) + if (!_dodgeFl) { _scene->_sequences.addTimer(90, 149); - else { + } else { _scene->_sequences.addTimer(1, 149); _shouldDodgeFl = true; } @@ -3137,7 +3137,7 @@ void Scene209::actions() { _game._player._visible = true; _game._player._stepEnabled = true; _scene->_sequences.addTimer(4, 3); - _vm->_dialogs->showPicture(OBJ_PLANT_STALK, 0x328); + _vm->_dialogs->showItem(OBJ_PLANT_STALK, 0x328); break; case 3: @@ -3173,7 +3173,7 @@ void Scene209::actions() { break; case 3: - _vm->_dialogs->showPicture (OBJ_BINOCULARS, 0x51AF); + _vm->_dialogs->showItem (OBJ_BINOCULARS, 0x51AF); _scene->_sprites.remove(_globals._spriteIndexes[10]); break; } @@ -4763,7 +4763,7 @@ void Scene214::actions() { case 3: _game._player._stepEnabled = true; - _vm->_dialogs->showPicture(OBJ_POISON_DARTS, 0x53A5); + _vm->_dialogs->showItem(OBJ_POISON_DARTS, 0x53A5); break; } } else if (_action.isAction(VERB_TAKE, 0x29) && (_game._trigger || _game._objects.isInRoom(OBJ_BLOWGUN))) { @@ -4792,7 +4792,7 @@ void Scene214::actions() { case 3: _game._player._stepEnabled = true; - _vm->_dialogs->showPicture(OBJ_BLOWGUN, 0x329); + _vm->_dialogs->showItem(OBJ_BLOWGUN, 0x329); break; } } else if (_action.isAction(VERB_LOOK, 0x197)) |