[Scummvm-cvs-logs] scummvm master -> 7d4b05098d101cdb6918ec8a11017a7d03ea8814

dreammaster dreammaster at scummvm.org
Fri Jul 25 03:10:38 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7d4b05098d MADS: Clean up _depthStyle usage in DepthSurface class


Commit: 7d4b05098d101cdb6918ec8a11017a7d03ea8814
    https://github.com/scummvm/scummvm/commit/7d4b05098d101cdb6918ec8a11017a7d03ea8814
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-07-24T21:09:34-04:00

Commit Message:
MADS: Clean up _depthStyle usage in DepthSurface class

Changed paths:
    engines/mads/msurface.cpp
    engines/mads/msurface.h
    engines/mads/scene_data.cpp



diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp
index 18a9a4f..349f4a5 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 ef2bbd6..23e0a03 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 36aa831..e874468 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) {






More information about the Scummvm-git-logs mailing list