From 7d4b05098d101cdb6918ec8a11017a7d03ea8814 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 24 Jul 2014 21:09:34 -0400 Subject: MADS: Clean up _depthStyle usage in DepthSurface class --- engines/mads/msurface.cpp | 5 ++--- engines/mads/msurface.h | 5 +++++ 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 @@ -222,6 +222,11 @@ class DepthSurface : public MSurface { private: MADSEngine *_vm; public: + /** + * Depth style + */ + int _depthStyle; + /** * Constructor */ 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) { -- cgit v1.2.3