diff options
author | Paul Gilbert | 2016-07-26 19:48:14 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-26 19:48:14 -0400 |
commit | 504cf6ecb688a3f1c65a857bffd527d8b0e6ba63 (patch) | |
tree | 0c0d96d4061c11850c851f0fc981c75a58c20515 /engines/mads/rails.cpp | |
parent | d8c28d15ae553d047b7e571f98727fa79ee143f3 (diff) | |
parent | e19922d181e775791f9105b8be7ff410770ede51 (diff) | |
download | scummvm-rg350-504cf6ecb688a3f1c65a857bffd527d8b0e6ba63.tar.gz scummvm-rg350-504cf6ecb688a3f1c65a857bffd527d8b0e6ba63.tar.bz2 scummvm-rg350-504cf6ecb688a3f1c65a857bffd527d8b0e6ba63.zip |
Merge branch 'master' into xeen
Diffstat (limited to 'engines/mads/rails.cpp')
-rw-r--r-- | engines/mads/rails.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/engines/mads/rails.cpp b/engines/mads/rails.cpp index 9b2ec71de6..46d9e0ebd3 100644 --- a/engines/mads/rails.cpp +++ b/engines/mads/rails.cpp @@ -149,7 +149,7 @@ int Rails::scanPath(const Common::Point &srcPos, const Common::Point &destPos) { ++xDiff; ++yDiff; - const byte *srcP = _depthSurface->getBasePtr(srcPos.x, srcPos.y); + const byte *srcP = (const byte *)_depthSurface->getBasePtr(srcPos.x, srcPos.y); int index = xAmount; // Outer loop @@ -274,4 +274,18 @@ void Rails::synchronize(Common::Serializer &s) { } } +void Rails::disableNode(int nodeIndex) { + _nodes[nodeIndex]._active = false; + + for (uint16 i = 0; i < _nodes.size(); i++) { + if (i != nodeIndex) + disableLine(i, nodeIndex); + } +} + +void Rails::disableLine(int from, int to) { + _nodes[from]._distances[to] = 0x3FFF; + _nodes[to]._distances[from] = 0x3FFF; +} + } // End of namespace MADS |