aboutsummaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorVincent Bénony2015-12-02 11:46:25 +0100
committerVincent Bénony2016-01-06 15:35:34 +0100
commit2bffce5e72b679f187554bfc00398d7666b3a948 (patch)
tree689a4732e07b41daaf3ed2143819258ff6fcc7ff /devtools
parentc4cb84d2fbd681e963628cd77a25e4d6b48656f6 (diff)
downloadscummvm-rg350-2bffce5e72b679f187554bfc00398d7666b3a948.tar.gz
scummvm-rg350-2bffce5e72b679f187554bfc00398d7666b3a948.tar.bz2
scummvm-rg350-2bffce5e72b679f187554bfc00398d7666b3a948.zip
IOS: Adds the image asset catalog to the iOS targer
Diffstat (limited to 'devtools')
-rw-r--r--devtools/create_project/xcode.cpp24
-rw-r--r--devtools/create_project/xcode.h11
2 files changed, 32 insertions, 3 deletions
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index ff1ea9984a..6398bae741 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -258,7 +258,6 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::map<std::string,
}
void XcodeProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
- includeList.push_back(setup.srcDir + "/dists/iphone/Images.xcassets");
includeList.push_back(setup.srcDir + "/dists/iphone/Info.plist");
StringList td;
@@ -282,6 +281,7 @@ void XcodeProvider::createWorkspace(const BuildSetup &setup) {
setupProject();
setupResourcesBuildPhase();
setupBuildConfiguration(setup);
+ setupImageAssetCatalog(setup);
}
// We are done with constructing all the object graph and we got through every project, output the main project file
@@ -627,7 +627,6 @@ void XcodeProvider::setupResourcesBuildPhase() {
properties["teenagent.dat"] = FileProperty("file", "", "teenagent.dat", "\"<group>\"");
properties["toon.dat"] = FileProperty("file", "", "toon.dat", "\"<group>\"");
- properties["Images.xcassets"] = FileProperty("Images.xcassets", "", "Images.xcassets", "\"<group>\"");
properties["Default.png"] = FileProperty("image.png", "", "Default.png", "\"<group>\"");
properties["icon.png"] = FileProperty("image.png", "", "icon.png", "\"<group>\"");
properties["icon-72.png"] = FileProperty("image.png", "", "icon-72.png", "\"<group>\"");
@@ -659,7 +658,6 @@ void XcodeProvider::setupResourcesBuildPhase() {
files_list.push_back("hugo.dat");
files_list.push_back("teenagent.dat");
files_list.push_back("toon.dat");
- files_list.push_back("Images.xcassets");
int order = 0;
for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) {
@@ -719,6 +717,8 @@ void XcodeProvider::setupSourcesBuildPhase() {
ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->id), comment, order++);
}
+ addAdditionalSources(targetName, files, order);
+
source->properties["files"] = files;
source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
@@ -791,6 +791,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_DEFINE(scummvmIOS_defines, "IPHONE");
ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL");
ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon");
+ ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "LaunchImage");
iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug;
@@ -961,6 +963,22 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
}
}
+void XcodeProvider::setupImageAssetCatalog(const BuildSetup &setup) {
+ const std::string filename = "Images.xcassets";
+ const std::string absoluteCatalogPath = _projectRoot + "/dists/iphone/" + filename;
+ const std::string id = "FileReference_" + absoluteCatalogPath;
+ Group *group = touchGroupsForPath(absoluteCatalogPath);
+ group->addChildFile(filename);
+ addBuildFile(absoluteCatalogPath, filename, getHash(id), "Image Asset Catalog");
+}
+
+void XcodeProvider::addAdditionalSources(std::string targetName, Property &files, int &order) {
+ if (targetIsIOS(targetName)) {
+ const std::string absoluteCatalogPath = _projectRoot + "/dists/iphone/Images.xcassets";
+ ADD_SETTING_ORDER_NOVALUE(files, getHash(absoluteCatalogPath), "Image Asset Catalog", order++);
+ }
+}
+
//////////////////////////////////////////////////////////////////////////
// Misc
//////////////////////////////////////////////////////////////////////////
diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h
index a5f0fc1cf0..a4aedb0fac 100644
--- a/devtools/create_project/xcode.h
+++ b/devtools/create_project/xcode.h
@@ -244,6 +244,15 @@ private:
objectMap[obj->id] = true;
}
+ Object *find(std::string id) {
+ for (std::vector<Object *>::iterator it = objects.begin(); it != objects.end(); ++it) {
+ if ((*it)->id == id) {
+ return *it;
+ }
+ }
+ return NULL;
+ }
+
std::string toString() {
std::string output;
@@ -320,6 +329,8 @@ private:
void setupResourcesBuildPhase();
void setupSourcesBuildPhase();
void setupBuildConfiguration(const BuildSetup &setup);
+ void setupImageAssetCatalog(const BuildSetup &setup);
+ void addAdditionalSources(std::string targetName, Property &files, int &order);
// Misc
void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations