[Scummvm-cvs-logs] scummvm master -> 45e82b55fc70ee88a7717e313e7ed0a0cdc13688

sev- sev at scummvm.org
Mon Aug 1 23:06:44 CEST 2016


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

Summary:
87818fe63a POSIX: Add $SNAP to search path if available.
45e82b55fc Merge pull request #795 from fuzzie/snap


Commit: 87818fe63ac851e89513c2fe49c9646d64566b31
    https://github.com/scummvm/scummvm/commit/87818fe63ac851e89513c2fe49c9646d64566b31
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2016-07-29T11:45:14+02:00

Commit Message:
POSIX: Add $SNAP to search path if available.

This allows ScummVM to find data files while running in a snap (e.g.
from the new Ubuntu store).

Changed paths:
    backends/platform/sdl/posix/posix.cpp
    backends/platform/sdl/posix/posix.h



diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index e2a642b..016a9d4 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -141,6 +141,22 @@ Common::String OSystem_POSIX::getDefaultConfigFileName() {
 	return configFile;
 }
 
+void OSystem_POSIX::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
+	const char *snap = getenv("SNAP");
+	if (snap) {
+		Common::String dataPath = Common::String(snap) + DATA_PATH;
+		Common::FSNode dataNode(dataPath);
+		if (dataNode.exists() && dataNode.isDirectory()) {
+			// This is the same priority which is used for the data path (below),
+			// but we insert this one first, so it will be searched first.
+			s.add(dataPath, new Common::FSDirectory(dataNode, 4), priority);
+		}
+	}
+
+	// For now, we always add the data path, just in case SNAP doesn't make sense.
+	OSystem_SDL::addSysArchivesToSearchSet(s, priority);
+}
+
 Common::WriteStream *OSystem_POSIX::createLogFile() {
 	// Start out by resetting _logFilePath, so that in case
 	// of a failure, we know that no log file is open.
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index 0514d30..050463c 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -38,6 +38,8 @@ public:
 	virtual void init();
 	virtual void initBackend();
 
+	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
+
 protected:
 	/**
 	 * Base string for creating the default path and filename for the


Commit: 45e82b55fc70ee88a7717e313e7ed0a0cdc13688
    https://github.com/scummvm/scummvm/commit/45e82b55fc70ee88a7717e313e7ed0a0cdc13688
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-02T00:06:41+03:00

Commit Message:
Merge pull request #795 from fuzzie/snap

POSIX: Add $SNAP to search path if available.

Changed paths:
    backends/platform/sdl/posix/posix.cpp
    backends/platform/sdl/posix/posix.h









More information about the Scummvm-git-logs mailing list