aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-07-24 21:09:34 -0400
committerPaul Gilbert2014-07-24 21:09:34 -0400
commit7d4b05098d101cdb6918ec8a11017a7d03ea8814 (patch)
treefa090f8e328b38203c5cddba5d30889b253665fa
parent09cb06d1fa75f51a9967a15d96a5360b990afec4 (diff)
downloadscummvm-rg350-7d4b05098d101cdb6918ec8a11017a7d03ea8814.tar.gz
scummvm-rg350-7d4b05098d101cdb6918ec8a11017a7d03ea8814.tar.bz2
scummvm-rg350-7d4b05098d101cdb6918ec8a11017a7d03ea8814.zip
MADS: Clean up _depthStyle usage in DepthSurface class
-rw-r--r--engines/mads/msurface.cpp5
-rw-r--r--engines/mads/msurface.h5
-rw-r--r--engines/mads/scene_data.cpp1
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) {