[Scummvm-git-logs] scummvm master -> 7155f143103dbeb86a90c5c8de6e4743b50041fb

bgK bastien.bouclet at gmail.com
Thu Sep 15 14:24:52 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:
4c7d3c1857 MOHAWK: Change the game ID for the making of Myst to lowercase
7155f14310 CREATE_PROJECT: Use SDL_Net2 when building with SDL2 for cmake


Commit: 4c7d3c1857ee282a49c0f500f2ef9ca65e72360c
    https://github.com/scummvm/scummvm/commit/4c7d3c1857ee282a49c0f500f2ef9ca65e72360c
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-09-15T12:44:57+02:00

Commit Message:
MOHAWK: Change the game ID for the making of Myst to lowercase

No target upgrade needed since it is not stored in the config file.

Changed paths:
    engines/mohawk/detection.cpp
    engines/mohawk/detection_tables.h



diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 246d3ec..439ea15 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -114,7 +114,7 @@ bool MohawkEngine_Riven::hasFeature(EngineFeature f) const {
 static const PlainGameDescriptor mohawkGames[] = {
 	{"mohawk", "Mohawk Game"},
 	{"myst", "Myst"},
-	{"MakingOfMyst", "The Making of Myst"},
+	{"makingofmyst", "The Making of Myst"},
 	{"riven", "Riven: The Sequel to Myst"},
 	{"zoombini", "Logical Journey of the Zoombinis"},
 	{"cstime", "Where in Time is Carmen Sandiego?"},
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index d9aba26..f481472 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -179,7 +179,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 	// From clone2727
 	{
 		{
-			"MakingOfMyst",
+			"makingofmyst",
 			"",
 			AD_ENTRY1("MAKING.DAT", "f6387e8f0f7b8a3e42c95294315d6a0e"),
 			Common::EN_ANY,
@@ -197,7 +197,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 	// From clone2727
 	{
 		{
-			"MakingOfMyst",
+			"makingofmyst",
 			"",
 			AD_ENTRY1("MAKING.DAT", "03ff62607e64419ab2b6ebf7b7bcdf63"),
 			Common::JA_JPN,
@@ -2764,7 +2764,7 @@ static const MohawkGameDescription fallbackDescs[] = {
 
 	{
 		{
-			"MakingOfMyst",
+			"makingofmyst",
 			"unknown",
 			AD_ENTRY1(0, 0),
 			Common::UNK_LANG,


Commit: 7155f143103dbeb86a90c5c8de6e4743b50041fb
    https://github.com/scummvm/scummvm/commit/7155f143103dbeb86a90c5c8de6e4743b50041fb
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-09-15T12:44:57+02:00

Commit Message:
CREATE_PROJECT: Use SDL_Net2 when building with SDL2 for cmake

Changed paths:
    devtools/create_project/cmake.cpp
    devtools/create_project/cmake.h



diff --git a/devtools/create_project/cmake.cpp b/devtools/create_project/cmake.cpp
index fad9a28..541e79e 100644
--- a/devtools/create_project/cmake.cpp
+++ b/devtools/create_project/cmake.cpp
@@ -34,27 +34,31 @@ CMakeProvider::CMakeProvider(StringList &global_warnings, std::map<std::string,
 	: ProjectProvider(global_warnings, project_warnings, version) {
 }
 
-const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *feature) const {
+const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *feature, bool useSDL2) const {
 	static const Library s_libraries[] = {
-		{ "sdl",       "FindSDL",      "SDL",      "SDL_INCLUDE_DIR",       "SDL_LIBRARY",         0            },
-		{ "sdl2",      0,              "SDL2",     "SDL2_INCLUDE_DIRS",     "SDL2_LIBRARIES",      0            },
-		{ "freetype",  "FindFreetype", "Freetype", "FREETYPE_INCLUDE_DIRS", "FREETYPE_LIBRARIES",  0            },
-		{ "libz",      "FindZLIB",     "ZLIB",     "ZLIB_INCLUDE_DIRS",     "ZLIB_LIBRARIES",      0            },
-		{ "png",       "FindPNG",      "PNG",      "PNG_INCLUDE_DIRS",      "PNG_LIBRARIES",       0            },
-		{ "jpeg",      "FindJPEG",     "JPEG",     "JPEG_INCLUDE_DIRS",     "JPEG_LIBRARIES",      0            },
-		{ "mpeg2",     "FindMPEG2",    "MPEG2",    "MPEG2_INCLUDE_DIRS",    "MPEG2_mpeg2_LIBRARY", 0            },
-		{ "flac",      0,              0,          0,                       0,                     "FLAC"       },
-		{ "mad",       0,              0,          0,                       0,                     "mad"        },
-		{ "vorbis",    0,              0,          0,                       0,                     "vorbisfile vorbis ogg" },
-		{ "theora",    0,              0,          0,                       0,                     "theoradec"  },
-		{ "fluidsynth",0,              0,          0,                       0,                     "fluidsynth" },
-		{ "faad",      0,              0,          0,                       0,                     "faad"       },
-		{ "libcurl",   "FindCURL",     "CURL",     "CURL_INCLUDE_DIRS",     "CURL_LIBRARIES",      0            },
-		{ "sdlnet",    "FindSDL_net",  "SDL_net",  "SDL_NET_INCLUDE_DIRS",  "SDL_NET_LIBRARIES",   0            }
+		{ "sdl",       kSDLVersion1,   "FindSDL",      "SDL",      "SDL_INCLUDE_DIR",       "SDL_LIBRARY",         0            },
+		{ "sdl",       kSDLVersion2,   0,              "SDL2",     "SDL2_INCLUDE_DIRS",     "SDL2_LIBRARIES",      0            },
+		{ "freetype",  kSDLVersionAny, "FindFreetype", "Freetype", "FREETYPE_INCLUDE_DIRS", "FREETYPE_LIBRARIES",  0            },
+		{ "libz",      kSDLVersionAny, "FindZLIB",     "ZLIB",     "ZLIB_INCLUDE_DIRS",     "ZLIB_LIBRARIES",      0            },
+		{ "png",       kSDLVersionAny, "FindPNG",      "PNG",      "PNG_INCLUDE_DIRS",      "PNG_LIBRARIES",       0            },
+		{ "jpeg",      kSDLVersionAny, "FindJPEG",     "JPEG",     "JPEG_INCLUDE_DIRS",     "JPEG_LIBRARIES",      0            },
+		{ "mpeg2",     kSDLVersionAny, "FindMPEG2",    "MPEG2",    "MPEG2_INCLUDE_DIRS",    "MPEG2_mpeg2_LIBRARY", 0            },
+		{ "flac",      kSDLVersionAny, 0,              0,          0,                       0,                     "FLAC"       },
+		{ "mad",       kSDLVersionAny, 0,              0,          0,                       0,                     "mad"        },
+		{ "vorbis",    kSDLVersionAny, 0,              0,          0,                       0,                     "vorbisfile vorbis ogg" },
+		{ "theora",    kSDLVersionAny, 0,              0,          0,                       0,                     "theoradec"  },
+		{ "fluidsynth",kSDLVersionAny, 0,              0,          0,                       0,                     "fluidsynth" },
+		{ "faad",      kSDLVersionAny, 0,              0,          0,                       0,                     "faad"       },
+		{ "libcurl",   kSDLVersionAny, "FindCURL",     "CURL",     "CURL_INCLUDE_DIRS",     "CURL_LIBRARIES",      0            },
+		{ "sdlnet",    kSDLVersion1,   "FindSDL_net",  "SDL_net",  "SDL_NET_INCLUDE_DIRS",  "SDL_NET_LIBRARIES",   0            },
+		{ "sdlnet",    kSDLVersion2,   0,              0,          0,                       0,                     "SDL2_net"   }
 	};
 
 	for (unsigned int i = 0; i < sizeof(s_libraries) / sizeof(s_libraries[0]); i++) {
-		if (std::strcmp(feature, s_libraries[i].feature) == 0) {
+		bool matchingSDL = (s_libraries[i].sdlVersion == kSDLVersionAny)
+		                   || (useSDL2 && s_libraries[i].sdlVersion == kSDLVersion2)
+		                   || (!useSDL2 && s_libraries[i].sdlVersion == kSDLVersion1);
+		if (std::strcmp(feature, s_libraries[i].feature) == 0 && matchingSDL) {
 			return &s_libraries[i];
 		}
 	}
@@ -81,11 +85,11 @@ void CMakeProvider::createWorkspace(const BuildSetup &setup) {
 			"$ENV{"<<LIBS_DEFINE<<"}/include)\n\n";
 
 	workspace << "# Libraries and features\n";
-	writeFeatureLibSearch(workspace, setup.useSDL2 ? "sdl2" : "sdl");
+	writeFeatureLibSearch(setup, workspace, "sdl");
 	for (FeatureList::const_iterator i = setup.features.begin(), end = setup.features.end(); i != end; ++i) {
 		if (!i->enable || featureExcluded(i->name)) continue;
 
-		writeFeatureLibSearch(workspace, i->name);
+		writeFeatureLibSearch(setup, workspace, i->name);
 		workspace << "add_definitions(-D" << i->define << ")\n";
 	}
 	workspace << "\n";
@@ -99,8 +103,8 @@ void CMakeProvider::createWorkspace(const BuildSetup &setup) {
 	writeGeneratePluginsTable(workspace);
 }
 
-void CMakeProvider::writeFeatureLibSearch(std::ofstream &workspace, const char *feature) const {
-	const Library *library = getLibraryFromFeature(feature);
+void CMakeProvider::writeFeatureLibSearch(const BuildSetup &setup, std::ofstream &workspace, const char *feature) const {
+	const Library *library = getLibraryFromFeature(feature, setup.useSDL2);
 	if (library) {
 		if (library->module) {
 			workspace << "Include(" << library->module << ")\n";
@@ -194,13 +198,13 @@ void CMakeProvider::createProjectFile(const std::string &name, const std::string
 
 	project << "# Libraries\n";
 	if (name == setup.projectName) {
-		const Library *sdlLibrary = getLibraryFromFeature(setup.useSDL2 ? "sdl2" : "sdl");
+		const Library *sdlLibrary = getLibraryFromFeature("sdl", setup.useSDL2);
 		project << "target_link_libraries(" << name << " ${" << sdlLibrary->librariesVar << "})\n";
 
 		for (FeatureList::const_iterator i = setup.features.begin(), end = setup.features.end(); i != end; ++i) {
 			if (!i->enable || featureExcluded(i->name)) continue;
 
-			const Library *library = getLibraryFromFeature(i->name);
+			const Library *library = getLibraryFromFeature(i->name, setup.useSDL2);
 			if (!library) continue;
 
 			if (library->librariesVar) {
diff --git a/devtools/create_project/cmake.h b/devtools/create_project/cmake.h
index ec7ff56..4d8663e 100644
--- a/devtools/create_project/cmake.h
+++ b/devtools/create_project/cmake.h
@@ -53,11 +53,18 @@ protected:
 	const char *getProjectExtension();
 
 private:
+	enum SDLVersion {
+		kSDLVersionAny,
+		kSDLVersion1,
+		kSDLVersion2
+	};
+
 	/**
 	 * CMake properties for a library required by a feature
 	 */
 	struct Library {
 		const char *feature;
+		SDLVersion sdlVersion;
 		const char *module;
 		const char *package;
 		const char *includesVar;
@@ -65,7 +72,7 @@ private:
 		const char *libraries;
 	};
 
-	const Library *getLibraryFromFeature(const char *feature) const;
+	const Library *getLibraryFromFeature(const char *feature, bool useSDL2) const;
 
 	void writeWarnings(std::ofstream &output) const;
 	void writeDefines(const BuildSetup &setup, std::ofstream &output) const;
@@ -75,7 +82,7 @@ private:
 	void writeGeneratePluginsTable(std::ofstream &workspace) const;
 	void writeEnginesLibrariesHandling(const BuildSetup &setup, std::ofstream &workspace) const;
 	void writeEngineDefinitions(std::ofstream &workspace) const;
-	void writeFeatureLibSearch(std::ofstream &workspace, const char *feature) const;
+	void writeFeatureLibSearch(const BuildSetup &setup, std::ofstream &workspace, const char *feature) const;
 	bool featureExcluded(const char *name) const;
 	const EngineDesc &findEngineDesc(const std::string &name, const EngineDescList &engines) const;
 };





More information about the Scummvm-git-logs mailing list