From a77ed90618664e50705b3e59dd2111faec2f5f39 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 6 Mar 2014 22:31:41 -0500 Subject: MADS: Implementing support methods needed for scene 804 initialisation --- engines/mads/msurface.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'engines/mads/msurface.cpp') diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index 754fea851d..74043bf91f 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -497,4 +497,17 @@ MSurface *MSurface::flipHorizontal() const { return dest; } +/*------------------------------------------------------------------------*/ + +int DepthSurface::getDepth(const Common::Point &pt) { + + if (_vm->_game->_scene._sceneInfo->_depthStyle == 2) { + int bits = (3 - (pt.x % 4)) * 2; + byte v = *getBasePtr(pt.x >> 2, pt.y); + return v >> bits; + } else { + return *getBasePtr(pt.x, pt.y) & 0xF; + } +} + } // End of namespace MADS -- cgit v1.2.3