aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-29 13:38:52 -0400
committerPaul Gilbert2014-03-29 13:38:52 -0400
commitaddb3e2900ee417fb71a75f9afae08b00007daa5 (patch)
tree8bba0b061f6bead06c38edd001d6d71cbbc642f1 /engines
parent71b1343adf6e886cfd2e1a0040a12b5025672d14 (diff)
downloadscummvm-rg350-addb3e2900ee417fb71a75f9afae08b00007daa5.tar.gz
scummvm-rg350-addb3e2900ee417fb71a75f9afae08b00007daa5.tar.bz2
scummvm-rg350-addb3e2900ee417fb71a75f9afae08b00007daa5.zip
MADS: Minor renamings and added display of walk nodes to debugger
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/action.cpp2
-rw-r--r--engines/mads/debugger.cpp10
-rw-r--r--engines/mads/player.cpp10
-rw-r--r--engines/mads/scene.cpp4
4 files changed, 24 insertions, 2 deletions
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();