[Scummvm-git-logs] scummvm master -> 315378af35d7616ae18a9a36b4b52d9c4e5ef814

sev- noreply at scummvm.org
Sun Apr 2 23:32:40 UTC 2023


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:
315378af35 DIRECTOR: Dump screenshots in a special hierarchy if executed on buildbot


Commit: 315378af35d7616ae18a9a36b4b52d9c4e5ef814
    https://github.com/scummvm/scummvm/commit/315378af35d7616ae18a9a36b4b52d9c4e5ef814
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-04-03T01:32:23+02:00

Commit Message:
DIRECTOR: Dump screenshots in a special hierarchy if executed on buildbot

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 3db5485fed1..77a9e44dc11 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -19,6 +19,8 @@
  *
  */
 
+#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
+
 #include "common/config-manager.h"
 #include "common/file.h"
 #include "common/memstream.h"
@@ -1076,8 +1078,20 @@ void Score::screenShot() {
 	Common::String prefix = Common::String::format("%s%s", currentPath.c_str(), Common::punycode_encodefilename(_movie->getMacName()).c_str());
 	Common::String filename = dumpScriptName(prefix.c_str(), kMovieScript, g_director->_framesRan, "png");
 
+	const char *buildNumber = getenv("BUILD_NUMBER");
+
+	// If we are running inside of buildbot
+	if (buildNumber) {
+		// ./dumps/theapartment/25/xn--Main Menu-zd0e-19.png
+		if (ConfMan.hasKey("screenshotpath"))
+			filename = Common::String::format("%s/%s/%s/%s-%d.png", ConfMan.get("screenshotpath").c_str(),
+				g_director->getTargetName().c_str(), buildNumber, prefix.c_str(), g_director->_framesRan);
+	}
+
+	debug("Dumping screenshot to %s", filename.c_str());
+
 	Common::DumpFile screenshotFile;
-	if (screenshotFile.open(filename)) {
+	if (screenshotFile.open(filename, true)) {
 #ifdef USE_PNG
 		Image::writePNG(screenshotFile, *newSurface);
 #else




More information about the Scummvm-git-logs mailing list