[Scummvm-git-logs] scummvm master -> c4fac4e2b7310332875193b9b9b2a33b9017f76f

ysj1173886760 42030331+ysj1173886760 at users.noreply.github.com
Fri Aug 20 11:21:56 UTC 2021


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:
c4fac4e2b7 DIRECTOR: move warnings to deeper debug levels.


Commit: c4fac4e2b7310332875193b9b9b2a33b9017f76f
    https://github.com/scummvm/scummvm/commit/c4fac4e2b7310332875193b9b9b2a33b9017f76f
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-20T19:21:28+08:00

Commit Message:
DIRECTOR: move warnings to deeper debug levels.

Changed paths:
    engines/director/sprite.cpp
    engines/director/util.cpp
    engines/director/window.cpp


diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index d5bd078d6d..95d5d92f75 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -255,7 +255,8 @@ bool Sprite::checkSpriteType() {
 	// if it doesn't match, then we treat it as transparent
 	// this happens in warlock-mac data/stambul/c up
 	if (_spriteType == kBitmapSprite && _cast->_type != kCastBitmap) {
-		warning("Sprite::checkSpriteType: Didn't render sprite due to the sprite type mismatch with cast type");
+		if (debugChannelSet(2, kDebugImages))
+			warning("Sprite::checkSpriteType: Didn't render sprite due to the sprite type mismatch with cast type");
 		return false;
 	}
 	return true;
@@ -315,7 +316,7 @@ void Sprite::setCast(CastMemberID memberID) {
 		}
 
 	} else {
-		if (_castId.member != 0)
+		if (_castId.member != 0 && debugChannelSet(kDebugImages, 2))
 			warning("Sprite::setCast(): %s is null", memberID.asString().c_str());
 	}
 }
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 185ac6f995..0367a2bc6f 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -433,12 +433,12 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
 	if (recursive) // first level
 		initialPath = convertPath(initialPath);
 
-	debug(2, "pathMakeRelative(): s1 %s -> %s", path.c_str(), initialPath.c_str());
+	debug(9, "pathMakeRelative(): s1 %s -> %s", path.c_str(), initialPath.c_str());
 
 	initialPath = Common::normalizePath(g_director->getCurrentPath() + initialPath, g_director->_dirSeparator);
 	Common::String convPath = initialPath;
 
-	debug(2, "pathMakeRelative(): s2 %s", convPath.c_str());
+	debug(9, "pathMakeRelative(): s2 %s", convPath.c_str());
 
 	// Strip the leading whitespace from the path
 	initialPath.trim();
@@ -453,12 +453,12 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
 		int pos = convPath.find(g_director->_dirSeparator);
 		convPath = Common::String(&convPath.c_str()[pos + 1]);
 
-		debug(2, "pathMakeRelative(): s3 try %s", convPath.c_str());
+		debug(9, "pathMakeRelative(): s3 try %s", convPath.c_str());
 
 		if (!testPath(convPath, directory))
 			continue;
 
-		debug(2, "pathMakeRelative(): s3 converted %s -> %s", path.c_str(), convPath.c_str());
+		debug(9, "pathMakeRelative(): s3 converted %s -> %s", path.c_str(), convPath.c_str());
 
 		opened = true;
 
@@ -469,7 +469,7 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
 		// Try stripping all of the characters not allowed in FAT
 		convPath = stripMacPath(initialPath.c_str());
 
-		debug(2, "pathMakeRelative(): s4 %s", convPath.c_str());
+		debug(9, "pathMakeRelative(): s4 %s", convPath.c_str());
 
 		if (testPath(initialPath, directory))
 			return initialPath;
@@ -479,12 +479,12 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
 			int pos = convPath.find(g_director->_dirSeparator);
 			convPath = Common::String(&convPath.c_str()[pos + 1]);
 
-			debug(2, "pathMakeRelative(): s5 try %s", convPath.c_str());
+			debug(9, "pathMakeRelative(): s5 try %s", convPath.c_str());
 
 			if (!testPath(convPath, directory))
 				continue;
 
-			debug(2, "pathMakeRelative(): s5 converted %s -> %s", path.c_str(), convPath.c_str());
+			debug(9, "pathMakeRelative(): s5 converted %s -> %s", path.c_str(), convPath.c_str());
 
 			opened = true;
 
@@ -524,7 +524,7 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
 				Common::String ext = component.substr(component.size() - 4);
 				Common::String newpath = convPath + convertMacFilename(nameWithoutExt.c_str()) + ext;
 
-				debug(2, "pathMakeRelative(): s6 %s -> try %s", initialPath.c_str(), newpath.c_str());
+				debug(9, "pathMakeRelative(): s6 %s -> try %s", initialPath.c_str(), newpath.c_str());
 				Common::String res = pathMakeRelative(newpath, false, false);
 
 				if (testPath(res))
@@ -567,7 +567,7 @@ Common::String testExtensions(Common::String component, Common::String initialPa
 	for (int i = 0; exts[i]; ++i) {
 		Common::String newpath = convPath + convertMacFilename(component.c_str()) + exts[i];
 
-		debug(2, "pathMakeRelative(): s6 %s -> try %s", initialPath.c_str(), newpath.c_str());
+		debug(9, "pathMakeRelative(): s6 %s -> try %s", initialPath.c_str(), newpath.c_str());
 		Common::String res = pathMakeRelative(newpath, false, false);
 
 		if (testPath(res))
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index cb7197bc4c..0bdcc0784f 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -207,7 +207,8 @@ void Window::inkBlitFrom(Channel *channel, Common::Rect destRect, Graphics::Mana
 			inkBlitSurface(&pd, srcRect, channel->getMask());
 		}
 	} else {
-		warning("Window::inkBlitFrom: No source surface: spriteType: %d, castType: %d, castId: %s", channel->_sprite->_spriteType, channel->_sprite->_cast ? channel->_sprite->_cast->_type : 0, channel->_sprite->_castId.asString().c_str());
+		if (debugChannelSet(kDebugImages, 2))
+			warning("Window::inkBlitFrom: No source surface: spriteType: %d, castType: %d, castId: %s", channel->_sprite->_spriteType, channel->_sprite->_cast ? channel->_sprite->_cast->_type : 0, channel->_sprite->_castId.asString().c_str());
 	}
 }
 




More information about the Scummvm-git-logs mailing list