diff options
-rw-r--r-- | engines/mads/msurface.cpp | 5 | ||||
-rw-r--r-- | engines/mads/msurface.h | 5 | ||||
-rw-r--r-- | engines/mads/scene_data.cpp | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index 18a9a4f547..349f4a5f23 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -527,7 +527,7 @@ MSurface *MSurface::flipHorizontal() const { /*------------------------------------------------------------------------*/ int DepthSurface::getDepth(const Common::Point &pt) { - if (_vm->_game->_scene._sceneInfo->_depthStyle == 2) { + if (_depthStyle == 2) { int bits = (3 - (pt.x % 4)) * 2; byte v = *getBasePtr(pt.x >> 2, pt.y); return v >> bits; @@ -540,7 +540,7 @@ int DepthSurface::getDepth(const Common::Point &pt) { } int DepthSurface::getDepthHighBit(const Common::Point &pt) { - if (_vm->_game->_scene._sceneInfo->_depthStyle == 2) { + if (_depthStyle == 2) { int bits = (3 - (pt.x % 4)) * 2; byte v = *getBasePtr(pt.x >> 2, pt.y); return (v >> bits) & 2; @@ -552,5 +552,4 @@ int DepthSurface::getDepthHighBit(const Common::Point &pt) { } } - } // End of namespace MADS diff --git a/engines/mads/msurface.h b/engines/mads/msurface.h index ef2bbd6784..23e0a03985 100644 --- a/engines/mads/msurface.h +++ b/engines/mads/msurface.h @@ -223,6 +223,11 @@ private: MADSEngine *_vm; public: /** + * Depth style + */ + int _depthStyle; + + /** * Constructor */ DepthSurface(MADSEngine *vm) : _vm(vm) {} diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index 36aa831c0b..e874468345 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -228,6 +228,7 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName, } loadCodes(depthSurface, variant); + depthSurface._depthStyle = _depthStyle; infoFile.close(); if (_vm->getGameID() == GType_RexNebular) { |