From addb3e2900ee417fb71a75f9afae08b00007daa5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 29 Mar 2014 13:38:52 -0400 Subject: MADS: Minor renamings and added display of walk nodes to debugger --- engines/mads/action.cpp | 2 +- engines/mads/debugger.cpp | 10 ++++++++++ engines/mads/player.cpp | 10 +++++++++- engines/mads/scene.cpp | 4 ++++ 4 files changed, 24 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index c2cc05e917..c762b9b993 100644 --- a/engines/mads/action.cpp +++ b/engines/mads/action.cpp @@ -78,7 +78,7 @@ void MADSAction::checkCustomDest(int v) { Player &player = _vm->_game->_player; if (_v86F4A && (v == -3 || _savedFields._selectedRow < 0)) { - _vm->_game->_player._needToWalk = true; + player._needToWalk = true; player._prepareWalkPos = scene._customDest; } } diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp index 3bc4ed2c16..58bf8388e4 100644 --- a/engines/mads/debugger.cpp +++ b/engines/mads/debugger.cpp @@ -125,9 +125,19 @@ bool Debugger::Cmd_PlaySound(int argc, const char **argv) { bool Debugger::Cmd_ShowCodes(int argc, const char **argv) { Scene &scene = _vm->_game->_scene; + // Copy the depth/walk surface to the background and flag for screen refresh scene._depthSurface.copyTo(&scene._backgroundSurface); scene._spriteSlots.fullRefresh(); + // Draw the locations of scene nodes onto the background + int color = _vm->getRandomNumber(255); + for (int i = 0; i < (int)scene._sceneInfo->_nodes.size(); ++i) { + Common::Point &pt = scene._sceneInfo->_nodes[i]._walkPos; + + scene._backgroundSurface.hLine(pt.x - 2, pt.y, pt.x + 2, color); + scene._backgroundSurface.vLine(pt.x, pt.y - 2, pt.y + 2, color); + } + return false; } diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index 3625493657..1705b117ba 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -768,7 +768,15 @@ void Player::newWalk() { } void Player::addWalker(int walker, int trigger) { - warning("TODO: Player::addWalker"); + Scene &scene = _vm->_game->_scene; + SpriteAsset &spriteSet = *scene._sprites[_spritesStart + _spritesIdx]; + assert(spriteSet._charInfo); + + if (walker < spriteSet._charInfo->_numEntries && _stopWalkerIndex < 11) { + ++_stopWalkerIndex; + _stopWalkerList[_stopWalkerIndex] = walker; + _stopWalkerTrigger[_stopWalkerIndex] = trigger; + } } } // End of namespace MADS diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index f61928f6d0..b8b8888e53 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -136,6 +136,10 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) { for (uint i = 0; i < _sceneInfo->_nodes.size(); ++i) _nodes.push_back(_sceneInfo->_nodes[i]); + // Add two more empty nodes for the start and end points of any walk sequence + _nodes.push_back(SceneNode()); + _nodes.push_back(SceneNode()); + // Load hotspots loadHotspots(); -- cgit v1.2.3