From 5484f36f38eddd9132e19e81c7b47e68f0c07846 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 6 Feb 2017 21:49:38 +0000 Subject: [PATCH 1/5] BUILD: Define SCUMM_64BITS on 64 bits platforms when not using configure This for example fixes the compilation of the fullpipe engine on 64 bits platforms when using create_project. --- common/scummsys.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/common/scummsys.h b/common/scummsys.h index 27fcb84505a..938770baa6d 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -309,6 +309,23 @@ #endif #endif +// +// Determine 64 bitness +// Reference: http://nadeausoftware.com/articles/2012/02/c_c_tip_how_detect_processor_type_using_compiler_predefined_macros +// +#if !defined(HAVE_CONFIG_H) + + #if defined(__x86_64__) || \ + defined(_M_X64) || \ + defined(__ppc64__) || \ + defined(__powerpc64__) || \ + defined(__LP64__) + + #define SCUMM_64BITS + + #endif + +#endif // // Some more system specific settings. From 5da09383dcead28ada62ff5a6ea4f1bf18e8401a Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 6 Feb 2017 21:51:40 +0000 Subject: [PATCH 2/5] CREATE_PROJECT: Fix linking with Xcode when not disabling curl --- devtools/create_project/xcode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 21fc25643f0..221f28bb8e2 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -950,6 +950,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { scummvmOSX_LdFlags.push_back("-lvorbis"); scummvmOSX_LdFlags.push_back("-lmad"); scummvmOSX_LdFlags.push_back("-lFLAC"); + scummvmOSX_LdFlags.push_back("-lcurl"); if (setup.useSDL2) { scummvmOSX_LdFlags.push_back("-lSDL2main"); scummvmOSX_LdFlags.push_back("-lSDL2"); From 7caeb6035067126f431bd1699ad47021bbfeda1b Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 6 Feb 2017 21:54:50 +0000 Subject: [PATCH 3/5] BASE: Ignore -NSDocumentRevisionDebugMode command line argument on OS X This is automatically added by Xcode when not toggling off the "Allow debugging when using document Versions Browser". Since this is on by default, and to avoid everybody having to google it, I have decided to just ignore it on OS X. --- base/commandLine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 2d7b9f2d9f9..51fee811d69 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -386,9 +386,15 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha } else { // On MacOS X prior to 10.9 the OS is sometimes adding a -psn_X_XXXXXX argument (where X are digits) // to pass the process serial number. We need to ignore it to avoid an error. + // When using XCode it also adds -NSDocumentRevisionsDebugMode YES argument if XCode option + // "Allow debugging when using document Versions Browser" is on (which is the default). #ifdef MACOSX if (strncmp(s, "-psn_", 5) == 0) continue; + if (strcmp(s, "-NSDocumentRevisionsDebugMode") == 0) { + ++i; // Also skip the YES that follows + continue; + } #endif bool isLongCmd = (s[0] == '-' && s[1] == '-'); From 14dcdb6103852be0ae716ee1aa84da07bbdc9638 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 6 Feb 2017 22:35:52 +0000 Subject: [PATCH 4/5] CREATE_PROJECT: Add highres feature --- devtools/create_project/create_project.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 6072120a150..9b171af8046 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -1024,6 +1024,7 @@ const Feature s_features[] = { { "scalers", "USE_SCALERS", "", true, "Scalers" }, { "hqscalers", "USE_HQ_SCALERS", "", true, "HQ scalers" }, { "16bit", "USE_RGB_COLOR", "", true, "16bit color support" }, + { "highres", "USE_HIGHRES", "", true, "high resolution" }, { "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" }, { "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling. { "opengl", "USE_OPENGL", "", true, "OpenGL support" }, From 2f4d14aba50ef437c24af905aeec6e95437eb8fa Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 6 Feb 2017 23:18:02 +0000 Subject: [PATCH 5/5] CREATE_PROJECT: Disable engines for which required features are not available --- devtools/create_project/create_project.cpp | 23 ++++++++++++++++++++-- devtools/create_project/create_project.h | 5 +++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 9b171af8046..2baaf91a719 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -300,6 +300,19 @@ int main(int argc, char *argv[]) { for (EngineDescList::iterator j = setup.engines.begin(); j != setup.engines.end(); ++j) j->enable = false; } + + // Disable engines for which we are missing dependencies + for (EngineDescList::const_iterator i = setup.engines.begin(); i != setup.engines.end(); ++i) { + if (i->enable) { + for (StringList::const_iterator ef = i->requiredFeatures.begin(); ef != i->requiredFeatures.end(); ++ef) { + FeatureList::iterator feature = std::find(setup.features.begin(), setup.features.end(), *ef); + if (feature != setup.features.end() && !feature->enable) { + setEngineBuildState(i->name, setup.engines, false); + break; + } + } + } + } // Print status cout << "Enabled engines:\n\n"; @@ -906,7 +919,7 @@ namespace { */ bool parseEngine(const std::string &line, EngineDesc &engine) { // Format: - // add_engine engine_name "Readable Description" enable_default ["SubEngineList"] + // add_engine engine_name "Readable Description" enable_default ["SubEngineList"] ["base games"] ["dependencies"] TokenList tokens = tokenize(line); if (tokens.size() < 4) @@ -921,8 +934,14 @@ bool parseEngine(const std::string &line, EngineDesc &engine) { engine.name = *token; ++token; engine.desc = *token; ++token; engine.enable = (*token == "yes"); ++token; - if (token != tokens.end()) + if (token != tokens.end()) { engine.subEngines = tokenize(*token); + ++token; + if (token != tokens.end()) + ++token; + if (token != tokens.end()) + engine.requiredFeatures = tokenize(*token); + } return true; } diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index bd0dcf6be9e..9f662ae8060 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -86,6 +86,11 @@ struct EngineDesc { * Whether the engine should be included in the build or not. */ bool enable; + + /** + * Features required for this engine. + */ + StringList requiredFeatures; /** * A list of all available sub engine names. Sub engines are engines