ALL: Sync with ScummVM
This commit is contained in:
parent
ac0e6b0668
commit
6c960b1d33
66 changed files with 10852 additions and 7937 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -101,6 +101,7 @@ Thumbs.db
|
||||||
*.sbr
|
*.sbr
|
||||||
*.sdf
|
*.sdf
|
||||||
*.opensdf
|
*.opensdf
|
||||||
|
*.opendb
|
||||||
obj/
|
obj/
|
||||||
_ReSharper*/
|
_ReSharper*/
|
||||||
ipch/
|
ipch/
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
#include "audio/musicplugin.h"
|
#include "audio/musicplugin.h"
|
||||||
#include "audio/mpu401.h"
|
#include "audio/mpu401.h"
|
||||||
#include "audio/softsynth/emumidi.h"
|
#include "audio/softsynth/emumidi.h"
|
||||||
|
#if defined(IPHONE_IOS7) && defined(IPHONE_SANDBOXED)
|
||||||
|
#include "backends/platform/ios7/ios7_common.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <fluidsynth.h>
|
#include <fluidsynth.h>
|
||||||
|
|
||||||
|
@ -179,7 +182,18 @@ int MidiDriver_FluidSynth::open() {
|
||||||
|
|
||||||
const char *soundfont = ConfMan.get("soundfont").c_str();
|
const char *soundfont = ConfMan.get("soundfont").c_str();
|
||||||
|
|
||||||
|
#if defined(IPHONE_IOS7) && defined(IPHONE_SANDBOXED)
|
||||||
|
// HACK: Due to the sandbox on non-jailbroken iOS devices, we need to deal
|
||||||
|
// with the chroot filesystem. All the path selected by the user are
|
||||||
|
// relative to the Document directory. So, we need to adjust the path to
|
||||||
|
// reflect that.
|
||||||
|
Common::String soundfont_fullpath = iOS7_getDocumentsDir();
|
||||||
|
soundfont_fullpath += soundfont;
|
||||||
|
_soundFont = fluid_synth_sfload(_synth, soundfont_fullpath.c_str(), 1);
|
||||||
|
#else
|
||||||
_soundFont = fluid_synth_sfload(_synth, soundfont, 1);
|
_soundFont = fluid_synth_sfload(_synth, soundfont, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (_soundFont == -1)
|
if (_soundFont == -1)
|
||||||
error("Failed loading custom sound font '%s'", soundfont);
|
error("Failed loading custom sound font '%s'", soundfont);
|
||||||
|
|
||||||
|
|
|
@ -97,8 +97,8 @@ void OPL::generateSamples(int16 *buffer, int length) {
|
||||||
|
|
||||||
/* final output shift , limit minimum and maximum */
|
/* final output shift , limit minimum and maximum */
|
||||||
#define OPL_OUTSB (TL_BITS+3-16) /* OPL output final shift 16bit */
|
#define OPL_OUTSB (TL_BITS+3-16) /* OPL output final shift 16bit */
|
||||||
#define OPL_MAXOUT (0x7fff<<OPL_OUTSB)
|
#define OPL_MAXOUT (0x7fff<<OPL_OUTSB)
|
||||||
#define OPL_MINOUT (-0x8000<<OPL_OUTSB)
|
#define OPL_MINOUT (-(0x8000<<OPL_OUTSB))
|
||||||
|
|
||||||
/* -------------------- quality selection --------------------- */
|
/* -------------------- quality selection --------------------- */
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,20 @@ protected:
|
||||||
static const char *lastPathComponent(const Common::String &str, const char sep);
|
static const char *lastPathComponent(const Common::String &str, const char sep);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Construct a FSNode object from an AbstractFSNode object.
|
||||||
|
*
|
||||||
|
* This is a helper to create Common::FSNode objects when the backend's
|
||||||
|
* FileSystemFactory cannot create the given AbstractFSNode object itself.
|
||||||
|
* All other code is supposed to use Common::FSNode's constructor itself.
|
||||||
|
*
|
||||||
|
* @param realNode Pointer to a heap allocated instance. FSNode will take
|
||||||
|
* ownership of the pointer.
|
||||||
|
*/
|
||||||
|
static Common::FSNode makeFSNode(AbstractFSNode *realNode) {
|
||||||
|
return Common::FSNode(realNode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
59
backends/fs/chroot/chroot-fs-factory.cpp
Normal file
59
backends/fs/chroot/chroot-fs-factory.cpp
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
/* ScummVM - Graphic Adventure Engine
|
||||||
|
*
|
||||||
|
* ScummVM is the legal property of its developers, whose names
|
||||||
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||||
|
* file distributed with this source distribution.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(POSIX)
|
||||||
|
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit //Needed for IRIX's unistd.h
|
||||||
|
|
||||||
|
#include "backends/fs/chroot/chroot-fs-factory.h"
|
||||||
|
#include "backends/fs/chroot/chroot-fs.h"
|
||||||
|
|
||||||
|
ChRootFilesystemFactory::ChRootFilesystemFactory(const Common::String &root)
|
||||||
|
: _root(root) {
|
||||||
|
}
|
||||||
|
|
||||||
|
AbstractFSNode *ChRootFilesystemFactory::makeRootFileNode() const {
|
||||||
|
return new ChRootFilesystemNode(_root, "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
AbstractFSNode *ChRootFilesystemFactory::makeCurrentDirectoryFileNode() const {
|
||||||
|
char buf[MAXPATHLEN];
|
||||||
|
if (getcwd(buf, MAXPATHLEN) == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Common::String(buf).hasPrefix(_root + Common::String("/"))) {
|
||||||
|
return new ChRootFilesystemNode(_root, buf + _root.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ChRootFilesystemNode(_root, "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
AbstractFSNode *ChRootFilesystemFactory::makeFileNodePath(const Common::String &path) const {
|
||||||
|
assert(!path.empty());
|
||||||
|
return new ChRootFilesystemNode(_root, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
46
backends/fs/chroot/chroot-fs-factory.h
Normal file
46
backends/fs/chroot/chroot-fs-factory.h
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
/* ScummVM - Graphic Adventure Engine
|
||||||
|
*
|
||||||
|
* ScummVM is the legal property of its developers, whose names
|
||||||
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||||
|
* file distributed with this source distribution.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BACKENDS_FS_CHROOT_CHROOT_FS_FACTORY_H
|
||||||
|
#define BACKENDS_FS_CHROOT_CHROOT_FS_FACTORY_H
|
||||||
|
|
||||||
|
#include "backends/fs/fs-factory.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FIXME: Warning, using this factory in your backend may silently break some
|
||||||
|
* features. Instances are, for example, the FluidSynth code, and the POSIX
|
||||||
|
* plugin code.
|
||||||
|
*/
|
||||||
|
class ChRootFilesystemFactory : public FilesystemFactory {
|
||||||
|
public:
|
||||||
|
explicit ChRootFilesystemFactory(const Common::String &root);
|
||||||
|
|
||||||
|
virtual AbstractFSNode *makeRootFileNode() const;
|
||||||
|
virtual AbstractFSNode *makeCurrentDirectoryFileNode() const;
|
||||||
|
virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const Common::String _root;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* BACKENDS_FS_CHROOT_CHROOT_FS_FACTORY_H */
|
124
backends/fs/chroot/chroot-fs.cpp
Normal file
124
backends/fs/chroot/chroot-fs.cpp
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
/* ScummVM - Graphic Adventure Engine
|
||||||
|
*
|
||||||
|
* ScummVM is the legal property of its developers, whose names
|
||||||
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||||
|
* file distributed with this source distribution.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(POSIX)
|
||||||
|
|
||||||
|
// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
|
||||||
|
// Also with clock() in sys/time.h in some Mac OS X SDKs.
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit //Needed for IRIX's unistd.h
|
||||||
|
|
||||||
|
#include "backends/fs/chroot/chroot-fs.h"
|
||||||
|
|
||||||
|
ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *node) {
|
||||||
|
_root = Common::normalizePath(root, '/');
|
||||||
|
_realNode = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, const Common::String &path) {
|
||||||
|
_root = Common::normalizePath(root, '/');
|
||||||
|
_realNode = new POSIXFilesystemNode(addPathComponent(root, path));
|
||||||
|
}
|
||||||
|
|
||||||
|
ChRootFilesystemNode::~ChRootFilesystemNode() {
|
||||||
|
delete _realNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ChRootFilesystemNode::exists() const {
|
||||||
|
return _realNode->exists();
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::String ChRootFilesystemNode::getDisplayName() const {
|
||||||
|
return getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::String ChRootFilesystemNode::getName() const {
|
||||||
|
return _realNode->AbstractFSNode::getDisplayName();
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::String ChRootFilesystemNode::getPath() const {
|
||||||
|
Common::String path = _realNode->getPath();
|
||||||
|
if (path.size() > _root.size()) {
|
||||||
|
return Common::String(path.c_str() + _root.size());
|
||||||
|
}
|
||||||
|
return Common::String("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ChRootFilesystemNode::isDirectory() const {
|
||||||
|
return _realNode->isDirectory();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ChRootFilesystemNode::isReadable() const {
|
||||||
|
return _realNode->isReadable();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ChRootFilesystemNode::isWritable() const {
|
||||||
|
return _realNode->isWritable();
|
||||||
|
}
|
||||||
|
|
||||||
|
AbstractFSNode *ChRootFilesystemNode::getChild(const Common::String &n) const {
|
||||||
|
return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *)_realNode->getChild(n));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ChRootFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const {
|
||||||
|
AbstractFSList tmp;
|
||||||
|
if (!_realNode->getChildren(tmp, mode, hidden)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (AbstractFSList::iterator i=tmp.begin(); i!=tmp.end(); ++i) {
|
||||||
|
list.push_back(new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) *i));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
AbstractFSNode *ChRootFilesystemNode::getParent() const {
|
||||||
|
if (getPath() == "/") return 0;
|
||||||
|
return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *)_realNode->getParent());
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::SeekableReadStream *ChRootFilesystemNode::createReadStream() {
|
||||||
|
return _realNode->createReadStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::WriteStream *ChRootFilesystemNode::createWriteStream() {
|
||||||
|
return _realNode->createWriteStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::String ChRootFilesystemNode::addPathComponent(const Common::String &path, const Common::String &component) {
|
||||||
|
const char sep = '/';
|
||||||
|
if (path.lastChar() == sep && component.firstChar() == sep) {
|
||||||
|
return Common::String::format("%s%s", path.c_str(), component.c_str() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path.lastChar() == sep || component.firstChar() == sep) {
|
||||||
|
return Common::String::format("%s%s", path.c_str(), component.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
return Common::String::format("%s%c%s", path.c_str(), sep, component.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
57
backends/fs/chroot/chroot-fs.h
Normal file
57
backends/fs/chroot/chroot-fs.h
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
/* ScummVM - Graphic Adventure Engine
|
||||||
|
*
|
||||||
|
* ScummVM is the legal property of its developers, whose names
|
||||||
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||||
|
* file distributed with this source distribution.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BACKENDS_FS_CHROOT_CHROOT_FS_H
|
||||||
|
#define BACKENDS_FS_CHROOT_CHROOT_FS_H
|
||||||
|
|
||||||
|
#include "backends/fs/posix/posix-fs.h"
|
||||||
|
|
||||||
|
class ChRootFilesystemNode : public AbstractFSNode {
|
||||||
|
Common::String _root;
|
||||||
|
POSIXFilesystemNode *_realNode;
|
||||||
|
|
||||||
|
ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *);
|
||||||
|
|
||||||
|
public:
|
||||||
|
ChRootFilesystemNode(const Common::String &root, const Common::String &path);
|
||||||
|
virtual ~ChRootFilesystemNode();
|
||||||
|
|
||||||
|
virtual bool exists() const;
|
||||||
|
virtual Common::String getDisplayName() const;
|
||||||
|
virtual Common::String getName() const;
|
||||||
|
virtual Common::String getPath() const;
|
||||||
|
virtual bool isDirectory() const;
|
||||||
|
virtual bool isReadable() const;
|
||||||
|
virtual bool isWritable() const;
|
||||||
|
|
||||||
|
virtual AbstractFSNode *getChild(const Common::String &n) const;
|
||||||
|
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
|
||||||
|
virtual AbstractFSNode *getParent() const;
|
||||||
|
|
||||||
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
|
virtual Common::WriteStream *createWriteStream();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static Common::String addPathComponent(const Common::String &path, const Common::String &component);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* BACKENDS_FS_CHROOT_CHROOT_FS_H */
|
|
@ -75,6 +75,8 @@ ifdef POSIX
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
fs/posix/posix-fs.o \
|
fs/posix/posix-fs.o \
|
||||||
fs/posix/posix-fs-factory.o \
|
fs/posix/posix-fs-factory.o \
|
||||||
|
fs/chroot/chroot-fs-factory.o \
|
||||||
|
fs/chroot/chroot-fs.o \
|
||||||
plugins/posix/posix-provider.o \
|
plugins/posix/posix-provider.o \
|
||||||
saves/posix/posix-saves.o \
|
saves/posix/posix-saves.o \
|
||||||
taskbar/unity/unity-taskbar.o
|
taskbar/unity/unity-taskbar.o
|
||||||
|
|
|
@ -139,8 +139,17 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
|
||||||
err = Common::kPathNotDirectory;
|
err = Common::kPathNotDirectory;
|
||||||
|
|
||||||
// Create the game engine
|
// Create the game engine
|
||||||
if (err.getCode() == Common::kNoError)
|
if (err.getCode() == Common::kNoError) {
|
||||||
|
// Set default values for all of the custom engine options
|
||||||
|
// Appareantly some engines query them in their constructor, thus we
|
||||||
|
// need to set this up before instance creation.
|
||||||
|
const ExtraGuiOptions engineOptions = (*plugin)->getExtraGuiOptions(Common::String());
|
||||||
|
for (uint i = 0; i < engineOptions.size(); i++) {
|
||||||
|
ConfMan.registerDefault(engineOptions[i].configOption, engineOptions[i].defaultState);
|
||||||
|
}
|
||||||
|
|
||||||
err = (*plugin)->createInstance(&system, &engine);
|
err = (*plugin)->createInstance(&system, &engine);
|
||||||
|
}
|
||||||
|
|
||||||
// Check for errors
|
// Check for errors
|
||||||
if (!engine || err.getCode() != Common::kNoError) {
|
if (!engine || err.getCode() != Common::kNoError) {
|
||||||
|
@ -218,12 +227,6 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
|
||||||
// Initialize any game-specific keymaps
|
// Initialize any game-specific keymaps
|
||||||
engine->initKeymap();
|
engine->initKeymap();
|
||||||
|
|
||||||
// Set default values for all of the custom engine options
|
|
||||||
const ExtraGuiOptions engineOptions = (*plugin)->getExtraGuiOptions(Common::String());
|
|
||||||
for (uint i = 0; i < engineOptions.size(); i++) {
|
|
||||||
ConfMan.registerDefault(engineOptions[i].configOption, engineOptions[i].defaultState);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inform backend that the engine is about to be run
|
// Inform backend that the engine is about to be run
|
||||||
system.engineInit();
|
system.engineInit();
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,14 @@ class FSList : public Array<FSNode> {};
|
||||||
*/
|
*/
|
||||||
class FSNode : public ArchiveMember {
|
class FSNode : public ArchiveMember {
|
||||||
private:
|
private:
|
||||||
|
friend class ::AbstractFSNode;
|
||||||
SharedPtr<AbstractFSNode> _realNode;
|
SharedPtr<AbstractFSNode> _realNode;
|
||||||
|
/**
|
||||||
|
* Construct a FSNode from a backend's AbstractFSNode implementation.
|
||||||
|
*
|
||||||
|
* @param realNode Pointer to a heap allocated instance. FSNode will take
|
||||||
|
* ownership of the pointer.
|
||||||
|
*/
|
||||||
FSNode(AbstractFSNode *realNode);
|
FSNode(AbstractFSNode *realNode);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -53,15 +53,17 @@ const struct GameOpt {
|
||||||
|
|
||||||
{ GUIO_NOASPECT, "noAspect" },
|
{ GUIO_NOASPECT, "noAspect" },
|
||||||
|
|
||||||
{ GUIO_RENDERHERCGREEN, "hercGreen" },
|
{ GUIO_RENDERHERCGREEN, "hercGreen" },
|
||||||
{ GUIO_RENDERHERCAMBER, "hercAmber" },
|
{ GUIO_RENDERHERCAMBER, "hercAmber" },
|
||||||
{ GUIO_RENDERCGA, "cga" },
|
{ GUIO_RENDERCGA, "cga" },
|
||||||
{ GUIO_RENDEREGA, "ega" },
|
{ GUIO_RENDEREGA, "ega" },
|
||||||
{ GUIO_RENDERVGA, "vga" },
|
{ GUIO_RENDERVGA, "vga" },
|
||||||
{ GUIO_RENDERAMIGA, "amiga" },
|
{ GUIO_RENDERAMIGA, "amiga" },
|
||||||
{ GUIO_RENDERFMTOWNS, "fmtowns" },
|
{ GUIO_RENDERFMTOWNS, "fmtowns" },
|
||||||
{ GUIO_RENDERPC9821, "pc9821" },
|
{ GUIO_RENDERPC9821, "pc9821" },
|
||||||
{ GUIO_RENDERPC9801, "pc9801" },
|
{ GUIO_RENDERPC9801, "pc9801" },
|
||||||
|
{ GUIO_RENDERAPPLE2GS, "2gs" },
|
||||||
|
{ GUIO_RENDERATARIST, "atari" },
|
||||||
|
|
||||||
{ GUIO_GAMEOPTIONS1, "gameOption1" },
|
{ GUIO_GAMEOPTIONS1, "gameOption1" },
|
||||||
{ GUIO_GAMEOPTIONS2, "gameOption2" },
|
{ GUIO_GAMEOPTIONS2, "gameOption2" },
|
||||||
|
@ -70,6 +72,7 @@ const struct GameOpt {
|
||||||
{ GUIO_GAMEOPTIONS5, "gameOption5" },
|
{ GUIO_GAMEOPTIONS5, "gameOption5" },
|
||||||
{ GUIO_GAMEOPTIONS6, "gameOption6" },
|
{ GUIO_GAMEOPTIONS6, "gameOption6" },
|
||||||
{ GUIO_GAMEOPTIONS7, "gameOption7" },
|
{ GUIO_GAMEOPTIONS7, "gameOption7" },
|
||||||
|
{ GUIO_GAMEOPTIONS8, "gameOption8" },
|
||||||
|
|
||||||
{ GUIO_NONE, 0 }
|
{ GUIO_NONE, 0 }
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,47 +23,50 @@
|
||||||
#ifndef COMMON_GUI_OPTIONS_H
|
#ifndef COMMON_GUI_OPTIONS_H
|
||||||
#define COMMON_GUI_OPTIONS_H
|
#define COMMON_GUI_OPTIONS_H
|
||||||
|
|
||||||
#define GUIO_NONE "\000"
|
#define GUIO_NONE "\000"
|
||||||
#define GUIO_NOSUBTITLES "\001"
|
#define GUIO_NOSUBTITLES "\001"
|
||||||
#define GUIO_NOMUSIC "\002"
|
#define GUIO_NOMUSIC "\002"
|
||||||
#define GUIO_NOSPEECH "\003"
|
#define GUIO_NOSPEECH "\003"
|
||||||
#define GUIO_NOSFX "\004"
|
#define GUIO_NOSFX "\004"
|
||||||
#define GUIO_NOMIDI "\005"
|
#define GUIO_NOMIDI "\005"
|
||||||
#define GUIO_NOLAUNCHLOAD "\006"
|
#define GUIO_NOLAUNCHLOAD "\006"
|
||||||
|
|
||||||
#define GUIO_MIDIPCSPK "\007"
|
#define GUIO_MIDIPCSPK "\007"
|
||||||
#define GUIO_MIDICMS "\010"
|
#define GUIO_MIDICMS "\010"
|
||||||
#define GUIO_MIDIPCJR "\011"
|
#define GUIO_MIDIPCJR "\011"
|
||||||
#define GUIO_MIDIADLIB "\012"
|
#define GUIO_MIDIADLIB "\012"
|
||||||
#define GUIO_MIDIC64 "\013"
|
#define GUIO_MIDIC64 "\013"
|
||||||
#define GUIO_MIDIAMIGA "\014"
|
#define GUIO_MIDIAMIGA "\014"
|
||||||
#define GUIO_MIDIAPPLEIIGS "\015"
|
#define GUIO_MIDIAPPLEIIGS "\015"
|
||||||
#define GUIO_MIDITOWNS "\016"
|
#define GUIO_MIDITOWNS "\016"
|
||||||
#define GUIO_MIDIPC98 "\017"
|
#define GUIO_MIDIPC98 "\017"
|
||||||
#define GUIO_MIDIMT32 "\020"
|
#define GUIO_MIDIMT32 "\020"
|
||||||
#define GUIO_MIDIGM "\021"
|
#define GUIO_MIDIGM "\021"
|
||||||
|
|
||||||
#define GUIO_NOASPECT "\022"
|
#define GUIO_NOASPECT "\022"
|
||||||
|
|
||||||
#define GUIO_RENDERHERCGREEN "\030"
|
#define GUIO_RENDERHERCGREEN "\030"
|
||||||
#define GUIO_RENDERHERCAMBER "\031"
|
#define GUIO_RENDERHERCAMBER "\031"
|
||||||
#define GUIO_RENDERCGA "\032"
|
#define GUIO_RENDERCGA "\032"
|
||||||
#define GUIO_RENDEREGA "\033"
|
#define GUIO_RENDEREGA "\033"
|
||||||
#define GUIO_RENDERVGA "\034"
|
#define GUIO_RENDERVGA "\034"
|
||||||
#define GUIO_RENDERAMIGA "\035"
|
#define GUIO_RENDERAMIGA "\035"
|
||||||
#define GUIO_RENDERFMTOWNS "\036"
|
#define GUIO_RENDERFMTOWNS "\036"
|
||||||
#define GUIO_RENDERPC9821 "\037"
|
#define GUIO_RENDERPC9821 "\037"
|
||||||
#define GUIO_RENDERPC9801 "\040"
|
#define GUIO_RENDERPC9801 "\040"
|
||||||
|
#define GUIO_RENDERAPPLE2GS "\041"
|
||||||
|
#define GUIO_RENDERATARIST "\042"
|
||||||
|
|
||||||
// Special GUIO flags for the AdvancedDetector's caching of game specific
|
// Special GUIO flags for the AdvancedDetector's caching of game specific
|
||||||
// options.
|
// options.
|
||||||
#define GUIO_GAMEOPTIONS1 "\041"
|
#define GUIO_GAMEOPTIONS1 "\050"
|
||||||
#define GUIO_GAMEOPTIONS2 "\042"
|
#define GUIO_GAMEOPTIONS2 "\051"
|
||||||
#define GUIO_GAMEOPTIONS3 "\043"
|
#define GUIO_GAMEOPTIONS3 "\052"
|
||||||
#define GUIO_GAMEOPTIONS4 "\044"
|
#define GUIO_GAMEOPTIONS4 "\053"
|
||||||
#define GUIO_GAMEOPTIONS5 "\045"
|
#define GUIO_GAMEOPTIONS5 "\054"
|
||||||
#define GUIO_GAMEOPTIONS6 "\046"
|
#define GUIO_GAMEOPTIONS6 "\055"
|
||||||
#define GUIO_GAMEOPTIONS7 "\047"
|
#define GUIO_GAMEOPTIONS7 "\056"
|
||||||
|
#define GUIO_GAMEOPTIONS8 "\057"
|
||||||
|
|
||||||
#define GUIO0() (GUIO_NONE)
|
#define GUIO0() (GUIO_NONE)
|
||||||
#define GUIO1(a) (a)
|
#define GUIO1(a) (a)
|
||||||
|
|
|
@ -38,9 +38,11 @@ const RenderModeDescription g_renderModes[] = {
|
||||||
{ "ega", "EGA", kRenderEGA },
|
{ "ega", "EGA", kRenderEGA },
|
||||||
{ "vga", "VGA", kRenderVGA },
|
{ "vga", "VGA", kRenderVGA },
|
||||||
{ "amiga", "Amiga", kRenderAmiga },
|
{ "amiga", "Amiga", kRenderAmiga },
|
||||||
{ "fmtowns", "FM-Towns", kRenderFMTowns },
|
{ "fmtowns", "FM-TOWNS", kRenderFMTowns },
|
||||||
{ "pc9821", "PC-9821 (256 Colors)", kRenderPC9821 },
|
{ "pc9821", _s("PC-9821 (256 Colors)"), kRenderPC9821 },
|
||||||
{ "pc9801", "PC-9801 (16 Colors)", kRenderPC9801 },
|
{ "pc9801", _s("PC-9801 (16 Colors)"), kRenderPC9801 },
|
||||||
|
{ "2gs", "Apple IIgs", kRenderApple2GS },
|
||||||
|
{ "atari", "Atari ST", kRenderAtariST },
|
||||||
{0, 0, kRenderDefault}
|
{0, 0, kRenderDefault}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,15 +55,17 @@ struct RenderGUIOMapping {
|
||||||
// could be used to indicate "any" mode when passed to renderMode2GUIO (if
|
// could be used to indicate "any" mode when passed to renderMode2GUIO (if
|
||||||
// we wanted to merge allRenderModesGUIOs back into)
|
// we wanted to merge allRenderModesGUIOs back into)
|
||||||
static const RenderGUIOMapping s_renderGUIOMapping[] = {
|
static const RenderGUIOMapping s_renderGUIOMapping[] = {
|
||||||
{ kRenderHercG, GUIO_RENDERHERCGREEN },
|
{ kRenderHercG, GUIO_RENDERHERCGREEN },
|
||||||
{ kRenderHercA, GUIO_RENDERHERCAMBER },
|
{ kRenderHercA, GUIO_RENDERHERCAMBER },
|
||||||
{ kRenderCGA, GUIO_RENDERCGA },
|
{ kRenderCGA, GUIO_RENDERCGA },
|
||||||
{ kRenderEGA, GUIO_RENDEREGA },
|
{ kRenderEGA, GUIO_RENDEREGA },
|
||||||
{ kRenderVGA, GUIO_RENDERVGA },
|
{ kRenderVGA, GUIO_RENDERVGA },
|
||||||
{ kRenderAmiga, GUIO_RENDERAMIGA },
|
{ kRenderAmiga, GUIO_RENDERAMIGA },
|
||||||
{ kRenderFMTowns, GUIO_RENDERFMTOWNS },
|
{ kRenderFMTowns, GUIO_RENDERFMTOWNS },
|
||||||
{ kRenderPC9821, GUIO_RENDERPC9821 },
|
{ kRenderPC9821, GUIO_RENDERPC9821 },
|
||||||
{ kRenderPC9801, GUIO_RENDERPC9801 }
|
{ kRenderPC9801, GUIO_RENDERPC9801 },
|
||||||
|
{ kRenderApple2GS, GUIO_RENDERAPPLE2GS },
|
||||||
|
{ kRenderAtariST, GUIO_RENDERATARIST }
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Hercules Green", "lowres")
|
DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Hercules Green", "lowres")
|
||||||
|
|
|
@ -45,7 +45,9 @@ enum RenderMode {
|
||||||
kRenderAmiga = 6,
|
kRenderAmiga = 6,
|
||||||
kRenderFMTowns = 7,
|
kRenderFMTowns = 7,
|
||||||
kRenderPC9821 = 8,
|
kRenderPC9821 = 8,
|
||||||
kRenderPC9801 = 9
|
kRenderPC9801 = 9,
|
||||||
|
kRenderApple2GS = 10,
|
||||||
|
kRenderAtariST = 11
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RenderModeDescription {
|
struct RenderModeDescription {
|
||||||
|
|
|
@ -751,6 +751,13 @@ bool matchString(const char *str, const char *pat, bool ignoreCase, bool pathMod
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case '#':
|
||||||
|
if (!isDigit(*str))
|
||||||
|
return false;
|
||||||
|
pat++;
|
||||||
|
str++;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ((!ignoreCase && *pat != *str) ||
|
if ((!ignoreCase && *pat != *str) ||
|
||||||
(ignoreCase && tolower(*pat) != tolower(*str))) {
|
(ignoreCase && tolower(*pat) != tolower(*str))) {
|
||||||
|
|
|
@ -158,6 +158,7 @@ public:
|
||||||
* Token meaning:
|
* Token meaning:
|
||||||
* "*": any character, any amount of times.
|
* "*": any character, any amount of times.
|
||||||
* "?": any character, only once.
|
* "?": any character, only once.
|
||||||
|
* "#": any decimal digit, only once.
|
||||||
*
|
*
|
||||||
* Example strings/patterns:
|
* Example strings/patterns:
|
||||||
* String: monkey.s01 Pattern: monkey.s?? => true
|
* String: monkey.s01 Pattern: monkey.s?? => true
|
||||||
|
@ -165,6 +166,8 @@ public:
|
||||||
* String: monkey.s99 Pattern: monkey.s?1 => false
|
* String: monkey.s99 Pattern: monkey.s?1 => false
|
||||||
* String: monkey.s101 Pattern: monkey.s* => true
|
* String: monkey.s101 Pattern: monkey.s* => true
|
||||||
* String: monkey.s99 Pattern: monkey.s*1 => false
|
* String: monkey.s99 Pattern: monkey.s*1 => false
|
||||||
|
* String: monkey.s01 Pattern: monkey.s## => true
|
||||||
|
* String: monkey.s01 Pattern: monkey.### => false
|
||||||
*
|
*
|
||||||
* @param pat Glob pattern.
|
* @param pat Glob pattern.
|
||||||
* @param ignoreCase Whether to ignore the case when doing pattern match
|
* @param ignoreCase Whether to ignore the case when doing pattern match
|
||||||
|
@ -180,6 +183,7 @@ public:
|
||||||
inline uint size() const { return _size; }
|
inline uint size() const { return _size; }
|
||||||
|
|
||||||
inline bool empty() const { return (_size == 0); }
|
inline bool empty() const { return (_size == 0); }
|
||||||
|
char firstChar() const { return (_size > 0) ? _str[0] : 0; }
|
||||||
char lastChar() const { return (_size > 0) ? _str[_size - 1] : 0; }
|
char lastChar() const { return (_size > 0) ? _str[_size - 1] : 0; }
|
||||||
|
|
||||||
char operator[](int idx) const {
|
char operator[](int idx) const {
|
||||||
|
@ -329,6 +333,7 @@ String normalizePath(const String &path, const char sep);
|
||||||
* Token meaning:
|
* Token meaning:
|
||||||
* "*": any character, any amount of times.
|
* "*": any character, any amount of times.
|
||||||
* "?": any character, only once.
|
* "?": any character, only once.
|
||||||
|
* "#": any decimal digit, only once.
|
||||||
*
|
*
|
||||||
* Example strings/patterns:
|
* Example strings/patterns:
|
||||||
* String: monkey.s01 Pattern: monkey.s?? => true
|
* String: monkey.s01 Pattern: monkey.s?? => true
|
||||||
|
@ -336,6 +341,8 @@ String normalizePath(const String &path, const char sep);
|
||||||
* String: monkey.s99 Pattern: monkey.s?1 => false
|
* String: monkey.s99 Pattern: monkey.s?1 => false
|
||||||
* String: monkey.s101 Pattern: monkey.s* => true
|
* String: monkey.s101 Pattern: monkey.s* => true
|
||||||
* String: monkey.s99 Pattern: monkey.s*1 => false
|
* String: monkey.s99 Pattern: monkey.s*1 => false
|
||||||
|
* String: monkey.s01 Pattern: monkey.s## => true
|
||||||
|
* String: monkey.s01 Pattern: monkey.### => false
|
||||||
*
|
*
|
||||||
* @param str Text to be matched against the given pattern.
|
* @param str Text to be matched against the given pattern.
|
||||||
* @param pat Glob pattern.
|
* @param pat Glob pattern.
|
||||||
|
|
130
configure
vendored
130
configure
vendored
|
@ -1357,6 +1357,11 @@ iphone)
|
||||||
_host_cpu=arm
|
_host_cpu=arm
|
||||||
_host_alias=arm-apple-darwin9
|
_host_alias=arm-apple-darwin9
|
||||||
;;
|
;;
|
||||||
|
ios7)
|
||||||
|
_host_os=iphone
|
||||||
|
_host_cpu=arm
|
||||||
|
_host_alias=arm-apple-darwin11
|
||||||
|
;;
|
||||||
linupy)
|
linupy)
|
||||||
_host_os=linux
|
_host_os=linux
|
||||||
_host_cpu=arm
|
_host_cpu=arm
|
||||||
|
@ -2061,18 +2066,31 @@ echo_n "Checking host CPU architecture... "
|
||||||
case $_host_cpu in
|
case $_host_cpu in
|
||||||
arm*)
|
arm*)
|
||||||
echo "ARM"
|
echo "ARM"
|
||||||
define_in_config_if_yes yes 'USE_ARM_SCALER_ASM'
|
case $_host_alias in
|
||||||
# FIXME: The following feature exhibits a bug. It produces distorted
|
# Apple's as does not support the syntax we use in our ARM
|
||||||
# sound since 9003ce517ff9906b0288f9f7c02197fd091d4554. The ARM
|
# assembly. We simply do not enable it.
|
||||||
# assembly will need to be properly adapted to the changes to the C
|
arm-apple-darwin9)
|
||||||
# code in 8f5a7cde2f99de9fef849b0ff688906f05f4643e.
|
;;
|
||||||
# See bug #6957: "AUDIO: ARM ASM sound code causes distorted audio on 32 bit armv6"
|
arm-apple-darwin10)
|
||||||
#define_in_config_if_yes yes 'USE_ARM_SOUND_ASM'
|
;;
|
||||||
define_in_config_if_yes yes 'USE_ARM_SMUSH_ASM'
|
arm-apple-darwin11)
|
||||||
define_in_config_if_yes yes 'USE_ARM_GFX_ASM'
|
;;
|
||||||
# FIXME: The following feature exhibits a bug during the intro scene of Indy 4
|
|
||||||
# (on Pandora and iPhone at least)
|
*)
|
||||||
#define_in_config_if_yes yes 'USE_ARM_COSTUME_ASM'
|
define_in_config_if_yes yes 'USE_ARM_SCALER_ASM'
|
||||||
|
# FIXME: The following feature exhibits a bug. It produces distorted
|
||||||
|
# sound since 9003ce517ff9906b0288f9f7c02197fd091d4554. The ARM
|
||||||
|
# assembly will need to be properly adapted to the changes to the C
|
||||||
|
# code in 8f5a7cde2f99de9fef849b0ff688906f05f4643e.
|
||||||
|
# See bug #6957: "AUDIO: ARM ASM sound code causes distorted audio on 32 bit armv6"
|
||||||
|
#define_in_config_if_yes yes 'USE_ARM_SOUND_ASM'
|
||||||
|
define_in_config_if_yes yes 'USE_ARM_SMUSH_ASM'
|
||||||
|
define_in_config_if_yes yes 'USE_ARM_GFX_ASM'
|
||||||
|
# FIXME: The following feature exhibits a bug during the intro scene of Indy 4
|
||||||
|
# (on Pandora and iPhone at least)
|
||||||
|
#define_in_config_if_yes yes 'USE_ARM_COSTUME_ASM'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
append_var DEFINES "-DARM_TARGET"
|
append_var DEFINES "-DARM_TARGET"
|
||||||
;;
|
;;
|
||||||
|
@ -2105,7 +2123,7 @@ echo_n "Checking hosttype... "
|
||||||
echo $_host_os
|
echo $_host_os
|
||||||
case $_host_os in
|
case $_host_os in
|
||||||
amigaos*)
|
amigaos*)
|
||||||
append_var LDFLAGS "-use-dynld -Wl,--export-dynamic"
|
append_var LDFLAGS "-Wl,--export-dynamic"
|
||||||
append_var LDFLAGS "-L/sdk/local/newlib/lib"
|
append_var LDFLAGS "-L/sdk/local/newlib/lib"
|
||||||
# We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32
|
# We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32
|
||||||
# as (unsigned) long, and consequently we'd get a compiler error otherwise.
|
# as (unsigned) long, and consequently we'd get a compiler error otherwise.
|
||||||
|
@ -2722,6 +2740,16 @@ if test -n "$_host"; then
|
||||||
_seq_midi=no
|
_seq_midi=no
|
||||||
_timidity=no
|
_timidity=no
|
||||||
;;
|
;;
|
||||||
|
ios7)
|
||||||
|
append_var DEFINES "-DIPHONE"
|
||||||
|
append_var CFLAGS "-Wno-shift-count-overflow"
|
||||||
|
append_var CXXFLAGS "-Wno-shift-count-overflow"
|
||||||
|
_backend="ios7"
|
||||||
|
_build_scalers=no
|
||||||
|
_mt32emu=no
|
||||||
|
_seq_midi=no
|
||||||
|
_timidity=no
|
||||||
|
;;
|
||||||
m68k-atari-mint)
|
m68k-atari-mint)
|
||||||
append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
||||||
_ranlib=m68k-atari-mint-ranlib
|
_ranlib=m68k-atari-mint-ranlib
|
||||||
|
@ -3015,6 +3043,19 @@ case $_backend in
|
||||||
append_var LIBS "-framework QuartzCore -framework CoreFoundation -framework Foundation"
|
append_var LIBS "-framework QuartzCore -framework CoreFoundation -framework Foundation"
|
||||||
append_var LIBS "-framework AudioToolbox -framework CoreAudio"
|
append_var LIBS "-framework AudioToolbox -framework CoreAudio"
|
||||||
;;
|
;;
|
||||||
|
ios7)
|
||||||
|
append_var LIBS "-lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES"
|
||||||
|
append_var LIBS "-framework QuartzCore -framework CoreFoundation -framework Foundation"
|
||||||
|
append_var LIBS "-framework AudioToolbox -framework CoreAudio"
|
||||||
|
append_var LDFLAGS "-miphoneos-version-min=7.1 -arch armv7"
|
||||||
|
append_var CFLAGS "-miphoneos-version-min=7.1 -arch armv7"
|
||||||
|
append_var CXXFLAGS "-miphoneos-version-min=7.1 -arch armv7"
|
||||||
|
if test -n "$SDKROOT"; then
|
||||||
|
append_var LDFLAGS "-mlinker-version=134.9 -B/usr/local/bin/arm-apple-darwin11-"
|
||||||
|
append_var CFLAGS "-isysroot $SDKROOT -F$SDKROOT/System/Library/Frameworks"
|
||||||
|
append_var CXXFLAGS "-isysroot $SDKROOT -I$SDKROOT/usr/include/c++/4.2.1 -F$SDKROOT/System/Library/Frameworks"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
linuxmoto)
|
linuxmoto)
|
||||||
append_var DEFINES "-DLINUXMOTO"
|
append_var DEFINES "-DLINUXMOTO"
|
||||||
;;
|
;;
|
||||||
|
@ -3146,7 +3187,7 @@ esac
|
||||||
# Enable 16bit support only for backends which support it
|
# Enable 16bit support only for backends which support it
|
||||||
#
|
#
|
||||||
case $_backend in
|
case $_backend in
|
||||||
android | dingux | dc | gph | iphone | maemo | openpandora | psp | samsungtv | sdl | tizen | webos | wii)
|
android | dingux | dc | gph | iphone | ios7 | maemo | openpandora | psp | samsungtv | sdl | tizen | webos | wii)
|
||||||
if test "$_16bit" = auto ; then
|
if test "$_16bit" = auto ; then
|
||||||
_16bit=yes
|
_16bit=yes
|
||||||
else
|
else
|
||||||
|
@ -3205,7 +3246,7 @@ case $_host_os in
|
||||||
amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince)
|
amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince)
|
||||||
_posix=no
|
_posix=no
|
||||||
;;
|
;;
|
||||||
android | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos)
|
android | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | ios7 | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos)
|
||||||
_posix=yes
|
_posix=yes
|
||||||
;;
|
;;
|
||||||
os2-emx*)
|
os2-emx*)
|
||||||
|
@ -3850,26 +3891,47 @@ fi
|
||||||
echo "$_sparkle"
|
echo "$_sparkle"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for libfluidsynth
|
# Check for FluidSynth
|
||||||
#
|
#
|
||||||
echocheck "libfluidsynth"
|
echocheck "FluidSynth"
|
||||||
if test "$_fluidsynth" = auto ; then
|
|
||||||
|
append_var FLUIDSYNTH_LIBS "-lfluidsynth"
|
||||||
|
case $_host_os in
|
||||||
|
mingw*)
|
||||||
|
# NOTE: Windows builds use an older FluidSynth version (1.0.9)
|
||||||
|
# which doesn't require glib, to avoid bundling the complete glib
|
||||||
|
# libraries with Windows builds.
|
||||||
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -ldsound -lwinmm"
|
||||||
|
;;
|
||||||
|
|
||||||
|
darwin*)
|
||||||
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreMIDI -framework CoreAudio -lglib-2.0 -lintl -liconv -lreadline"
|
||||||
|
;;
|
||||||
|
|
||||||
|
iphone)
|
||||||
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreMIDI -lglib-2.0 -lintl -liconv"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lglib-2.0 -lintl -liconv"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test "$_fluidsynth" = auto; then
|
||||||
_fluidsynth=no
|
_fluidsynth=no
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
#include <fluidsynth.h>
|
#include <fluidsynth.h>
|
||||||
int main(void) { return 0; }
|
int main(void) { delete_fluid_settings(new_fluid_settings()); return 0; }
|
||||||
EOF
|
EOF
|
||||||
cc_check $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS -lfluidsynth && _fluidsynth=yes
|
cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes
|
||||||
|
if test "$_fluidsynth" != yes; then
|
||||||
|
FLUIDSYNTH_LIBS="$FLUIDSYNTH_STATIC_LIBS"
|
||||||
|
cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes
|
||||||
|
fi
|
||||||
|
cc_check_clean
|
||||||
fi
|
fi
|
||||||
if test "$_fluidsynth" = yes ; then
|
if test "$_fluidsynth" = yes; then
|
||||||
case $_host_os in
|
append_var LIBS "$FLUIDSYNTH_LIBS"
|
||||||
mingw*)
|
|
||||||
append_var LIBS "$FLUIDSYNTH_LIBS -lfluidsynth -ldsound -lwinmm"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
append_var LIBS "$FLUIDSYNTH_LIBS -lfluidsynth"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
append_var INCLUDES "$FLUIDSYNTH_CFLAGS"
|
append_var INCLUDES "$FLUIDSYNTH_CFLAGS"
|
||||||
fi
|
fi
|
||||||
define_in_config_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'
|
define_in_config_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'
|
||||||
|
@ -4001,7 +4063,15 @@ int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cc_check $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes
|
cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes
|
||||||
|
# Modern freetype-config scripts accept --static to get all
|
||||||
|
# required flags for static linking. We abuse this to detect
|
||||||
|
# FreeType2 builds which are static themselves.
|
||||||
|
if test "$_freetype2" != "yes"; then
|
||||||
|
FREETYPE2_LIBS=`$_freetypeconfig --prefix="$_freetypepath" --static --libs 2>/dev/null`
|
||||||
|
cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes
|
||||||
|
fi
|
||||||
|
cc_check_clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$_freetype2" = "yes"; then
|
if test "$_freetype2" = "yes"; then
|
||||||
|
|
|
@ -200,6 +200,11 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CodeBlocksProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
|
||||||
|
includeList.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico");
|
||||||
|
includeList.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc");
|
||||||
|
}
|
||||||
|
|
||||||
void CodeBlocksProvider::writeWarnings(const std::string &name, std::ofstream &output) const {
|
void CodeBlocksProvider::writeWarnings(const std::string &name, std::ofstream &output) const {
|
||||||
|
|
||||||
// Global warnings
|
// Global warnings
|
||||||
|
|
|
@ -37,6 +37,8 @@ protected:
|
||||||
|
|
||||||
void createOtherBuildFiles(const BuildSetup &) {}
|
void createOtherBuildFiles(const BuildSetup &) {}
|
||||||
|
|
||||||
|
void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList);
|
||||||
|
|
||||||
void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
|
void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
|
||||||
const StringList &includeList, const StringList &excludeList);
|
const StringList &includeList, const StringList &excludeList);
|
||||||
|
|
||||||
|
|
|
@ -340,7 +340,13 @@ int main(int argc, char *argv[]) {
|
||||||
setup.defines.push_back("WIN32");
|
setup.defines.push_back("WIN32");
|
||||||
} else {
|
} else {
|
||||||
setup.defines.push_back("POSIX");
|
setup.defines.push_back("POSIX");
|
||||||
setup.defines.push_back("MACOSX"); // This will break iOS, but allows OS X to catch up on browser_osx.
|
// Define both MACOSX, and IPHONE, but only one of them will be associated to the
|
||||||
|
// correct target by the Xcode project provider.
|
||||||
|
// This define will help catching up target dependend files, like "browser_osx.mm"
|
||||||
|
// The suffix ("_osx", or "_ios") will be used by the project provider to filter out
|
||||||
|
// the files, according to the target.
|
||||||
|
setup.defines.push_back("MACOSX");
|
||||||
|
setup.defines.push_back("IPHONE");
|
||||||
}
|
}
|
||||||
setup.defines.push_back("SDL_BACKEND");
|
setup.defines.push_back("SDL_BACKEND");
|
||||||
if (!useSDL2) {
|
if (!useSDL2) {
|
||||||
|
@ -929,16 +935,17 @@ TokenList tokenize(const std::string &input, char separator) {
|
||||||
namespace {
|
namespace {
|
||||||
const Feature s_features[] = {
|
const Feature s_features[] = {
|
||||||
// Libraries
|
// Libraries
|
||||||
{ "libz", "USE_ZLIB", "zlib", true, "zlib (compression) support" },
|
{ "libz", "USE_ZLIB", "zlib", true, "zlib (compression) support" },
|
||||||
{ "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" },
|
{ "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" },
|
||||||
{ "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", false, "Ogg Vorbis support" },
|
{ "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", false, "Ogg Vorbis support" },
|
||||||
{ "flac", "USE_FLAC", "libFLAC_static win_utf8_io_static", false, "FLAC support" },
|
{ "flac", "USE_FLAC", "libFLAC_static win_utf8_io_static", false, "FLAC support" },
|
||||||
{ "png", "USE_PNG", "libpng", false, "libpng support" },
|
{ "png", "USE_PNG", "libpng", false, "libpng support" },
|
||||||
{ "faad", "USE_FAAD", "libfaad", false, "AAC support" },
|
{ "faad", "USE_FAAD", "libfaad", false, "AAC support" },
|
||||||
{ "mpeg2", "USE_MPEG2", "libmpeg2", true, "MPEG-2 support" },
|
{ "mpeg2", "USE_MPEG2", "libmpeg2", true, "MPEG-2 support" },
|
||||||
{ "theora", "USE_THEORADEC", "libtheora_static", false, "Theora decoding support" },
|
{ "theora", "USE_THEORADEC", "libtheora_static", false, "Theora decoding support" },
|
||||||
{"freetype", "USE_FREETYPE2", "freetype", true, "FreeType support" },
|
{ "freetype", "USE_FREETYPE2", "freetype", true, "FreeType support" },
|
||||||
{ "jpeg", "USE_JPEG", "jpeg-static", true, "libjpeg support" },
|
{ "jpeg", "USE_JPEG", "jpeg-static", true, "libjpeg support" },
|
||||||
|
{"fluidsynth", "USE_FLUIDSYNTH", "libfluidsynth", true, "FluidSynth support" },
|
||||||
|
|
||||||
// Feature flags
|
// Feature flags
|
||||||
{ "bink", "USE_BINK", "", true, "Bink video support" },
|
{ "bink", "USE_BINK", "", true, "Bink video support" },
|
||||||
|
@ -1050,6 +1057,12 @@ void splitFilename(const std::string &fileName, std::string &name, std::string &
|
||||||
ext = (dot == std::string::npos) ? std::string() : fileName.substr(dot + 1);
|
ext = (dot == std::string::npos) ? std::string() : fileName.substr(dot + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string basename(const std::string &fileName) {
|
||||||
|
const std::string::size_type slash = fileName.find_last_of('/');
|
||||||
|
if (slash == std::string::npos) return fileName;
|
||||||
|
return fileName.substr(slash + 1);
|
||||||
|
}
|
||||||
|
|
||||||
bool producesObjectFile(const std::string &fileName) {
|
bool producesObjectFile(const std::string &fileName) {
|
||||||
std::string n, ext;
|
std::string n, ext;
|
||||||
splitFilename(fileName, n, ext);
|
splitFilename(fileName, n, ext);
|
||||||
|
@ -1336,8 +1349,7 @@ void ProjectProvider::createProject(BuildSetup &setup) {
|
||||||
createModuleList(setup.srcDir + "/math", setup.defines, setup.testDirs, in, ex);
|
createModuleList(setup.srcDir + "/math", setup.defines, setup.testDirs, in, ex);
|
||||||
|
|
||||||
// Resource files
|
// Resource files
|
||||||
in.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico");
|
addResourceFiles(setup, in, ex);
|
||||||
in.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc");
|
|
||||||
|
|
||||||
// Various text files
|
// Various text files
|
||||||
in.push_back(setup.srcDir + "/AUTHORS");
|
in.push_back(setup.srcDir + "/AUTHORS");
|
||||||
|
|
|
@ -315,6 +315,17 @@ std::string convertPathToWin(const std::string &path);
|
||||||
*/
|
*/
|
||||||
void splitFilename(const std::string &fileName, std::string &name, std::string &ext);
|
void splitFilename(const std::string &fileName, std::string &name, std::string &ext);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the basename of a path.
|
||||||
|
* examples:
|
||||||
|
* a/b/c/d.ext -> d.ext
|
||||||
|
* d.ext -> d.ext
|
||||||
|
*
|
||||||
|
* @param fileName Filename
|
||||||
|
* @return The basename
|
||||||
|
*/
|
||||||
|
std::string basename(const std::string &fileName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the given file will produce an object file or not.
|
* Checks whether the given file will produce an object file or not.
|
||||||
*
|
*
|
||||||
|
@ -418,6 +429,13 @@ protected:
|
||||||
*/
|
*/
|
||||||
virtual void createOtherBuildFiles(const BuildSetup &setup) = 0;
|
virtual void createOtherBuildFiles(const BuildSetup &setup) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add resources to the project
|
||||||
|
*
|
||||||
|
* @param setup Description of the desired build setup.
|
||||||
|
*/
|
||||||
|
virtual void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a project file for the specified list of files.
|
* Create a project file for the specified list of files.
|
||||||
*
|
*
|
||||||
|
|
|
@ -130,6 +130,11 @@ void MSVCProvider::createOtherBuildFiles(const BuildSetup &setup) {
|
||||||
createBuildProp(setup, false, true, "LLVM");
|
createBuildProp(setup, false, true, "LLVM");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MSVCProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
|
||||||
|
includeList.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico");
|
||||||
|
includeList.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc");
|
||||||
|
}
|
||||||
|
|
||||||
void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
|
void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
|
||||||
std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_Global" + getPropertiesExtension()).c_str());
|
std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_Global" + getPropertiesExtension()).c_str());
|
||||||
if (!properties)
|
if (!properties)
|
||||||
|
|
|
@ -39,6 +39,8 @@ protected:
|
||||||
|
|
||||||
void createOtherBuildFiles(const BuildSetup &setup);
|
void createOtherBuildFiles(const BuildSetup &setup);
|
||||||
|
|
||||||
|
void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the global project properties.
|
* Create the global project properties.
|
||||||
*
|
*
|
||||||
|
|
|
@ -26,26 +26,33 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#ifdef MACOSX
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <CommonCrypto/CommonCrypto.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace CreateProjectTool {
|
namespace CreateProjectTool {
|
||||||
|
|
||||||
#define DEBUG_XCODE_HASH 0
|
#define DEBUG_XCODE_HASH 0
|
||||||
|
|
||||||
#ifdef ENABLE_IOS
|
|
||||||
#define IOS_TARGET 0
|
#define IOS_TARGET 0
|
||||||
#define OSX_TARGET 1
|
#define OSX_TARGET 1
|
||||||
#define SIM_TARGET 2
|
|
||||||
#else
|
|
||||||
#define OSX_TARGET 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ADD_DEFINE(defines, name) \
|
#define ADD_DEFINE(defines, name) \
|
||||||
defines.push_back(name);
|
defines.push_back(name);
|
||||||
|
|
||||||
|
#define REMOVE_DEFINE(defines, name) \
|
||||||
|
{ ValueList::iterator i = std::find(defines.begin(), defines.end(), name); if (i != defines.end()) defines.erase(i); }
|
||||||
|
|
||||||
|
#define CONTAINS_DEFINE(defines, name) \
|
||||||
|
(std::find(defines.begin(), defines.end(), name) != defines.end())
|
||||||
|
|
||||||
#define ADD_SETTING(config, key, value) \
|
#define ADD_SETTING(config, key, value) \
|
||||||
config._settings[key] = Setting(value, "", kSettingsNoQuote);
|
config._settings[key] = Setting(value, "", kSettingsNoQuote);
|
||||||
|
|
||||||
#define ADD_SETTING_ORDER(config, key, value, order) \
|
#define ADD_SETTING_ORDER(config, key, value, order) \
|
||||||
config._settings[key] = Setting(value, "", kSettingsNoQuote, 0, order);
|
config.settings[key] = Setting(value, "", kSettingsNoQuote, 0, order);
|
||||||
|
|
||||||
#define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \
|
#define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \
|
||||||
config._settings[key] = Setting("", comment, kSettingsNoValue, 0, order);
|
config._settings[key] = Setting("", comment, kSettingsNoValue, 0, order);
|
||||||
|
@ -69,6 +76,17 @@ namespace CreateProjectTool {
|
||||||
_buildFile._flags = kSettingsSingleItem; \
|
_buildFile._flags = kSettingsSingleItem; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define ADD_FILE_REFERENCE(id, name, properties) { \
|
||||||
|
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); \
|
||||||
|
if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", kSettingsNoValue); \
|
||||||
|
if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", kSettingsNoValue|kSettingsQuoteVariable); \
|
||||||
|
if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", kSettingsNoValue|kSettingsQuoteVariable); \
|
||||||
|
if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", kSettingsNoValue|kSettingsQuoteVariable); \
|
||||||
|
if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", kSettingsNoValue); \
|
||||||
|
_fileReference.add(fileRef); \
|
||||||
|
_fileReference._flags = kSettingsSingleItem; \
|
||||||
|
}
|
||||||
|
|
||||||
bool producesObjectFileOnOSX(const std::string &fileName) {
|
bool producesObjectFileOnOSX(const std::string &fileName) {
|
||||||
std::string n, ext;
|
std::string n, ext;
|
||||||
splitFilename(fileName, n, ext);
|
splitFilename(fileName, n, ext);
|
||||||
|
@ -81,9 +99,61 @@ bool producesObjectFileOnOSX(const std::string &fileName) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool targetIsIOS(const std::string &targetName) {
|
||||||
|
return targetName.length() > 4 && targetName.substr(targetName.length() - 4) == "-iOS";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targetName, const std::string &fileName) {
|
||||||
|
// Rules:
|
||||||
|
// - if the parent directory is "backends/platform/ios7", the file belongs to the iOS target.
|
||||||
|
// - if the parent directory is "/sdl", the file belongs to the OS X target.
|
||||||
|
// - if the file has a suffix, like "_osx", or "_ios", the file belongs to one of the target.
|
||||||
|
// - if the file is an OS X icon file (icns), it belongs to the OS X target.
|
||||||
|
std::string name, ext;
|
||||||
|
splitFilename(fileName, name, ext);
|
||||||
|
if (targetIsIOS(targetName)) {
|
||||||
|
// iOS target: we skip all files with the "_osx" suffix
|
||||||
|
if (name.length() > 4 && name.substr(name.length() - 4) == "_osx") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// We don't need SDL for the iOS target
|
||||||
|
static const std::string sdl_directory = "/sdl/";
|
||||||
|
static const std::string surfacesdl_directory = "/surfacesdl/";
|
||||||
|
static const std::string doublebufferdl_directory = "/doublebuffersdl/";
|
||||||
|
if (fileID.find(sdl_directory) != std::string::npos
|
||||||
|
|| fileID.find(surfacesdl_directory) != std::string::npos
|
||||||
|
|| fileID.find(doublebufferdl_directory) != std::string::npos) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (ext == "icns") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Ugly hack: explicitly remove the browser.cpp file.
|
||||||
|
// The problem is that we have only one project for two different targets,
|
||||||
|
// and the parsing of the "mk" files added this file for both targets...
|
||||||
|
if (fileID.length() > 12 && fileID.substr(fileID.length() - 12) == "/browser.cpp") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// OS X target: we skip all files with the "_ios" suffix
|
||||||
|
if (name.length() > 4 && name.substr(name.length() - 4) == "_ios") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// parent directory
|
||||||
|
const std::string directory = fileID.substr(0, fileID.length() - fileName.length());
|
||||||
|
static const std::string iphone_directory = "backends/platform/ios7";
|
||||||
|
if (directory.length() > iphone_directory.length() && directory.substr(directory.length() - iphone_directory.length()) == iphone_directory) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) {
|
XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) {
|
||||||
|
bool path_is_absolute = (path.length() > 0 && path.at(0) == '/');
|
||||||
addProperty("name", _name, "", kSettingsNoValue | kSettingsQuoteVariable);
|
addProperty("name", _name, "", kSettingsNoValue | kSettingsQuoteVariable);
|
||||||
addProperty("sourceTree", "<group>", "", kSettingsNoValue | kSettingsQuoteVariable);
|
addProperty("sourceTree", path_is_absolute ? "<absolute>" : "<group>", "", kSettingsNoValue | kSettingsQuoteVariable);
|
||||||
|
|
||||||
if (path != "") {
|
if (path != "") {
|
||||||
addProperty("path", path, "", kSettingsNoValue | kSettingsQuoteVariable);
|
addProperty("path", path, "", kSettingsNoValue | kSettingsQuoteVariable);
|
||||||
|
@ -93,7 +163,7 @@ XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &grou
|
||||||
}
|
}
|
||||||
|
|
||||||
void XcodeProvider::Group::ensureChildExists(const std::string &name) {
|
void XcodeProvider::Group::ensureChildExists(const std::string &name) {
|
||||||
std::map<std::string, Group *>::iterator it = _childGroups.find(name);
|
std::map<std::string, Group*>::iterator it = _childGroups.find(name);
|
||||||
if (it == _childGroups.end()) {
|
if (it == _childGroups.end()) {
|
||||||
Group *child = new Group(_parent, name, this->_treeName + '/' + name, name);
|
Group *child = new Group(_parent, name, this->_treeName + '/' + name, name);
|
||||||
_childGroups[name] = child;
|
_childGroups[name] = child;
|
||||||
|
@ -180,7 +250,7 @@ void XcodeProvider::addFileReference(const std::string &id, const std::string &n
|
||||||
|
|
||||||
void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) {
|
void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) {
|
||||||
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name);
|
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name);
|
||||||
fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", kSettingsNoValue | kSettingsQuoteVariable);
|
fileRef->addProperty("explicitFileType", "wrapper.application", "", kSettingsNoValue | kSettingsQuoteVariable);
|
||||||
fileRef->addProperty("includeInIndex", "0", "", kSettingsNoValue);
|
fileRef->addProperty("includeInIndex", "0", "", kSettingsNoValue);
|
||||||
fileRef->addProperty("path", name, "", kSettingsNoValue | kSettingsQuoteVariable);
|
fileRef->addProperty("path", name, "", kSettingsNoValue | kSettingsQuoteVariable);
|
||||||
fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", kSettingsNoValue);
|
fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", kSettingsNoValue);
|
||||||
|
@ -201,6 +271,18 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::map<std::string,
|
||||||
_rootSourceGroup = NULL;
|
_rootSourceGroup = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XcodeProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) {
|
||||||
|
includeList.push_back(setup.srcDir + "/dists/ios7/Info.plist");
|
||||||
|
|
||||||
|
ValueList &resources = getResourceFiles();
|
||||||
|
for (ValueList::iterator it = resources.begin(); it != resources.end(); ++it) {
|
||||||
|
includeList.push_back(setup.srcDir + "/" + *it);
|
||||||
|
}
|
||||||
|
|
||||||
|
StringList td;
|
||||||
|
createModuleList(setup.srcDir + "/backends/platform/ios7", setup.defines, td, includeList, excludeList);
|
||||||
|
}
|
||||||
|
|
||||||
void XcodeProvider::createWorkspace(const BuildSetup &setup) {
|
void XcodeProvider::createWorkspace(const BuildSetup &setup) {
|
||||||
// Create project folder
|
// Create project folder
|
||||||
std::string workspace = setup.outputDir + '/' + PROJECT_NAME ".xcodeproj";
|
std::string workspace = setup.outputDir + '/' + PROJECT_NAME ".xcodeproj";
|
||||||
|
@ -210,19 +292,15 @@ void XcodeProvider::createWorkspace(const BuildSetup &setup) {
|
||||||
|
|
||||||
// Setup global objects
|
// Setup global objects
|
||||||
setupDefines(setup);
|
setupDefines(setup);
|
||||||
#ifdef ENABLE_IOS
|
_targets.push_back(PROJECT_DESCRIPTION "-iOS");
|
||||||
_targets.push_back(PROJECT_DESCRIPTION "-iPhone");
|
|
||||||
#endif
|
|
||||||
_targets.push_back(PROJECT_DESCRIPTION "-OS X");
|
_targets.push_back(PROJECT_DESCRIPTION "-OS X");
|
||||||
#ifdef ENABLE_IOS
|
|
||||||
_targets.push_back(PROJECT_DESCRIPTION "-Simulator");
|
|
||||||
#endif
|
|
||||||
setupCopyFilesBuildPhase();
|
setupCopyFilesBuildPhase();
|
||||||
setupFrameworksBuildPhase();
|
setupFrameworksBuildPhase(setup);
|
||||||
setupNativeTarget();
|
setupNativeTarget();
|
||||||
setupProject();
|
setupProject();
|
||||||
setupResourcesBuildPhase();
|
setupResourcesBuildPhase();
|
||||||
setupBuildConfiguration();
|
setupBuildConfiguration(setup);
|
||||||
|
setupImageAssetCatalog(setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are done with constructing all the object graph and we got through every project, output the main project file
|
// We are done with constructing all the object graph and we got through every project, output the main project file
|
||||||
|
@ -323,15 +401,21 @@ void XcodeProvider::setupCopyFilesBuildPhase() {
|
||||||
#define DEF_SYSFRAMEWORK(framework) properties[framework".framework"] = FileProperty("wrapper.framework", framework".framework", "System/Library/Frameworks/" framework ".framework", "SDKROOT"); \
|
#define DEF_SYSFRAMEWORK(framework) properties[framework".framework"] = FileProperty("wrapper.framework", framework".framework", "System/Library/Frameworks/" framework ".framework", "SDKROOT"); \
|
||||||
ADD_SETTING_ORDER_NOVALUE(children, getHash(framework".framework"), framework".framework", fwOrder++);
|
ADD_SETTING_ORDER_NOVALUE(children, getHash(framework".framework"), framework".framework", fwOrder++);
|
||||||
|
|
||||||
#define DEF_LOCALLIB_STATIC(lib) properties[lib".a"] = FileProperty("archive.ar", lib".a", "/opt/local/lib/" lib ".a", "\"<group>\""); \
|
#define DEF_SYSTBD(lib) properties[lib".tbd"] = FileProperty("sourcecode.text-based-dylib-definition", lib".tbd", "usr/lib/" lib ".tbd", "SDKROOT"); \
|
||||||
|
ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".tbd"), lib".tbd", fwOrder++);
|
||||||
|
|
||||||
|
#define DEF_LOCALLIB_STATIC_PATH(path,lib,absolute) properties[lib".a"] = FileProperty("archive.ar", lib ".a", path, (absolute ? "\"<absolute>\"" : "\"<group>\"")); \
|
||||||
ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++);
|
ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++);
|
||||||
|
|
||||||
|
#define DEF_LOCALLIB_STATIC(lib) DEF_LOCALLIB_STATIC_PATH("/opt/local/lib/" lib ".a", lib, true)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the frameworks build phase.
|
* Sets up the frameworks build phase.
|
||||||
*
|
*
|
||||||
* (each native target has different build rules)
|
* (each native target has different build rules)
|
||||||
*/
|
*/
|
||||||
void XcodeProvider::setupFrameworksBuildPhase() {
|
void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
|
||||||
_frameworksBuildPhase._comment = "PBXFrameworksBuildPhase";
|
_frameworksBuildPhase._comment = "PBXFrameworksBuildPhase";
|
||||||
|
|
||||||
// Just use a hardcoded id for the Frameworks-group
|
// Just use a hardcoded id for the Frameworks-group
|
||||||
|
@ -351,6 +435,8 @@ void XcodeProvider::setupFrameworksBuildPhase() {
|
||||||
DEF_SYSFRAMEWORK("Carbon");
|
DEF_SYSFRAMEWORK("Carbon");
|
||||||
DEF_SYSFRAMEWORK("Cocoa");
|
DEF_SYSFRAMEWORK("Cocoa");
|
||||||
DEF_SYSFRAMEWORK("CoreAudio");
|
DEF_SYSFRAMEWORK("CoreAudio");
|
||||||
|
DEF_SYSFRAMEWORK("CoreMIDI");
|
||||||
|
DEF_SYSFRAMEWORK("CoreGraphics");
|
||||||
DEF_SYSFRAMEWORK("CoreFoundation");
|
DEF_SYSFRAMEWORK("CoreFoundation");
|
||||||
DEF_SYSFRAMEWORK("CoreMIDI");
|
DEF_SYSFRAMEWORK("CoreMIDI");
|
||||||
DEF_SYSFRAMEWORK("Foundation");
|
DEF_SYSFRAMEWORK("Foundation");
|
||||||
|
@ -359,6 +445,8 @@ void XcodeProvider::setupFrameworksBuildPhase() {
|
||||||
DEF_SYSFRAMEWORK("QuartzCore");
|
DEF_SYSFRAMEWORK("QuartzCore");
|
||||||
DEF_SYSFRAMEWORK("QuickTime");
|
DEF_SYSFRAMEWORK("QuickTime");
|
||||||
DEF_SYSFRAMEWORK("UIKit");
|
DEF_SYSFRAMEWORK("UIKit");
|
||||||
|
DEF_SYSTBD("libiconv");
|
||||||
|
|
||||||
// Optionals:
|
// Optionals:
|
||||||
DEF_SYSFRAMEWORK("OpenGL");
|
DEF_SYSFRAMEWORK("OpenGL");
|
||||||
|
|
||||||
|
@ -369,53 +457,94 @@ void XcodeProvider::setupFrameworksBuildPhase() {
|
||||||
DEF_LOCALLIB_STATIC("libfreetype");
|
DEF_LOCALLIB_STATIC("libfreetype");
|
||||||
// DEF_LOCALLIB_STATIC("libmpeg2");
|
// DEF_LOCALLIB_STATIC("libmpeg2");
|
||||||
|
|
||||||
|
std::string absoluteOutputDir;
|
||||||
|
#ifdef POSIX
|
||||||
|
char *c_path = realpath(setup.outputDir.c_str(), NULL);
|
||||||
|
absoluteOutputDir = c_path;
|
||||||
|
absoluteOutputDir += "/lib";
|
||||||
|
free(c_path);
|
||||||
|
#else
|
||||||
|
absoluteOutputDir = "lib";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFLAC.a", "libFLAC", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libfreetype.a", "libfreetype", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libogg.a", "libogg", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libpng.a", "libpng", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libvorbis.a", "libvorbis", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libmad.a", "libmad", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libfluidsynth.a", "libfluidsynth", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libglib.a", "libglib", true);
|
||||||
|
DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libffi.a", "libffi", true);
|
||||||
|
|
||||||
frameworksGroup->_properties["children"] = children;
|
frameworksGroup->_properties["children"] = children;
|
||||||
_groups.add(frameworksGroup);
|
_groups.add(frameworksGroup);
|
||||||
// Force this to be added as a sub-group in the root.
|
// Force this to be added as a sub-group in the root.
|
||||||
_rootSourceGroup->addChildGroup(frameworksGroup);
|
_rootSourceGroup->addChildGroup(frameworksGroup);
|
||||||
|
|
||||||
|
|
||||||
// Declare this here, as it's used across the three targets
|
// Declare this here, as it's used across all the targets
|
||||||
int order = 0;
|
int order = 0;
|
||||||
#ifdef ENABLE_IOS
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// iPhone
|
// ScummVM-iOS
|
||||||
Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[IOS_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
|
Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[IOS_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
|
||||||
|
|
||||||
framework_iPhone->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
|
framework_iPhone->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
|
||||||
framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
|
framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
|
||||||
|
|
||||||
// List of frameworks
|
// List of frameworks
|
||||||
Property iPhone_files;
|
Property iOS_files;
|
||||||
iPhone_files._hasOrder = true;
|
iOS_files._hasOrder = true;
|
||||||
iPhone_files._flags = kSettingsAsList;
|
iOS_files._flags = kSettingsAsList;
|
||||||
|
|
||||||
ValueList frameworks_iPhone;
|
ValueList frameworks_iOS;
|
||||||
frameworks_iPhone.push_back("CoreAudio.framework");
|
frameworks_iOS.push_back("CoreAudio.framework");
|
||||||
frameworks_iPhone.push_back("CoreFoundation.framework");
|
frameworks_iOS.push_back("CoreGraphics.framework");
|
||||||
frameworks_iPhone.push_back("Foundation.framework");
|
frameworks_iOS.push_back("CoreFoundation.framework");
|
||||||
frameworks_iPhone.push_back("UIKit.framework");
|
frameworks_iOS.push_back("Foundation.framework");
|
||||||
frameworks_iPhone.push_back("AudioToolbox.framework");
|
frameworks_iOS.push_back("UIKit.framework");
|
||||||
frameworks_iPhone.push_back("QuartzCore.framework");
|
frameworks_iOS.push_back("AudioToolbox.framework");
|
||||||
frameworks_iPhone.push_back("libmad.a");
|
frameworks_iOS.push_back("QuartzCore.framework");
|
||||||
//frameworks_iPhone.push_back("libmpeg2.a");
|
frameworks_iOS.push_back("OpenGLES.framework");
|
||||||
frameworks_iPhone.push_back("libFLAC.a");
|
|
||||||
frameworks_iPhone.push_back("libvorbisidec.a");
|
|
||||||
frameworks_iPhone.push_back("OpenGLES.framework");
|
|
||||||
|
|
||||||
for (ValueList::iterator framework = frameworks_iPhone.begin(); framework != frameworks_iPhone.end(); framework++) {
|
if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) {
|
||||||
|
frameworks_iOS.push_back("libFLAC.a");
|
||||||
|
}
|
||||||
|
if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) {
|
||||||
|
frameworks_iOS.push_back("libfreetype.a");
|
||||||
|
}
|
||||||
|
if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
|
||||||
|
frameworks_iOS.push_back("libpng.a");
|
||||||
|
}
|
||||||
|
if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
|
||||||
|
frameworks_iOS.push_back("libogg.a");
|
||||||
|
frameworks_iOS.push_back("libvorbis.a");
|
||||||
|
}
|
||||||
|
if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) {
|
||||||
|
frameworks_iOS.push_back("libmad.a");
|
||||||
|
}
|
||||||
|
if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDSYNTH")) {
|
||||||
|
frameworks_iOS.push_back("libfluidsynth.a");
|
||||||
|
frameworks_iOS.push_back("libglib.a");
|
||||||
|
frameworks_iOS.push_back("libffi.a");
|
||||||
|
frameworks_iOS.push_back("CoreMIDI.framework");
|
||||||
|
frameworks_iOS.push_back("libiconv.tbd");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ValueList::iterator framework = frameworks_iOS.begin(); framework != frameworks_iOS.end(); framework++) {
|
||||||
std::string id = "Frameworks_" + *framework + "_iphone";
|
std::string id = "Frameworks_" + *framework + "_iphone";
|
||||||
std::string comment = *framework + " in Frameworks";
|
std::string comment = *framework + " in Frameworks";
|
||||||
|
|
||||||
ADD_SETTING_ORDER_NOVALUE(iPhone_files, getHash(id), comment, order++);
|
ADD_SETTING_ORDER_NOVALUE(iOS_files, getHash(id), comment, order++);
|
||||||
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
|
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
|
||||||
addFileReference(*framework, *framework, properties[*framework]);
|
ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
|
||||||
}
|
}
|
||||||
|
|
||||||
framework_iPhone->_properties["files"] = iPhone_files;
|
framework_iPhone->_properties["files"] = iOS_files;
|
||||||
|
|
||||||
_frameworksBuildPhase.add(framework_iPhone);
|
_frameworksBuildPhase.add(framework_iPhone);
|
||||||
#endif
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// ScummVM-OS X
|
// ScummVM-OS X
|
||||||
Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[OSX_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
|
Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[OSX_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
|
||||||
|
@ -451,48 +580,12 @@ void XcodeProvider::setupFrameworksBuildPhase() {
|
||||||
|
|
||||||
ADD_SETTING_ORDER_NOVALUE(osx_files, getHash(id), comment, order++);
|
ADD_SETTING_ORDER_NOVALUE(osx_files, getHash(id), comment, order++);
|
||||||
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
|
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
|
||||||
addFileReference(*framework, *framework, properties[*framework]);
|
ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
|
||||||
}
|
}
|
||||||
|
|
||||||
framework_OSX->_properties["files"] = osx_files;
|
framework_OSX->_properties["files"] = osx_files;
|
||||||
|
|
||||||
_frameworksBuildPhase.add(framework_OSX);
|
_frameworksBuildPhase.add(framework_OSX);
|
||||||
#ifdef ENABLE_IOS
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// Simulator
|
|
||||||
Object *framework_simulator = new Object(this, "PBXFrameworksBuildPhase_" + _targets[SIM_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
|
|
||||||
|
|
||||||
framework_simulator->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
|
|
||||||
framework_simulator->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
|
|
||||||
|
|
||||||
// List of frameworks
|
|
||||||
Property simulator_files;
|
|
||||||
simulator_files._hasOrder = true;
|
|
||||||
simulator_files._flags = kSettingsAsList;
|
|
||||||
|
|
||||||
ValueList frameworks_simulator;
|
|
||||||
frameworks_simulator.push_back("CoreAudio.framework");
|
|
||||||
frameworks_simulator.push_back("CoreFoundation.framework");
|
|
||||||
frameworks_simulator.push_back("Foundation.framework");
|
|
||||||
frameworks_simulator.push_back("UIKit.framework");
|
|
||||||
frameworks_simulator.push_back("AudioToolbox.framework");
|
|
||||||
frameworks_simulator.push_back("QuartzCore.framework");
|
|
||||||
frameworks_simulator.push_back("OpenGLES.framework");
|
|
||||||
|
|
||||||
order = 0;
|
|
||||||
for (ValueList::iterator framework = frameworks_simulator.begin(); framework != frameworks_simulator.end(); framework++) {
|
|
||||||
std::string id = "Frameworks_" + *framework + "_simulator";
|
|
||||||
std::string comment = *framework + " in Frameworks";
|
|
||||||
|
|
||||||
ADD_SETTING_ORDER_NOVALUE(simulator_files, getHash(id), comment, order++);
|
|
||||||
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
|
|
||||||
addFileReference(*framework, *framework, properties[*framework]);
|
|
||||||
}
|
|
||||||
|
|
||||||
framework_simulator->_properties["files"] = simulator_files;
|
|
||||||
|
|
||||||
_frameworksBuildPhase.add(framework_simulator);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XcodeProvider::setupNativeTarget() {
|
void XcodeProvider::setupNativeTarget() {
|
||||||
|
@ -502,11 +595,6 @@ void XcodeProvider::setupNativeTarget() {
|
||||||
Group *productsGroup = new Group(this, "Products", "PBXGroup_CustomTemplate_Products_" , "");
|
Group *productsGroup = new Group(this, "Products", "PBXGroup_CustomTemplate_Products_" , "");
|
||||||
// Output native target section
|
// Output native target section
|
||||||
for (unsigned int i = 0; i < _targets.size(); i++) {
|
for (unsigned int i = 0; i < _targets.size(); i++) {
|
||||||
#ifndef ENABLE_IOS
|
|
||||||
if (i != OSX_TARGET) { // TODO: Fix iOS-targets, for now just disable them.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
Object *target = new Object(this, "PBXNativeTarget_" + _targets[i], "PBXNativeTarget", "PBXNativeTarget", "", _targets[i]);
|
Object *target = new Object(this, "PBXNativeTarget_" + _targets[i], "PBXNativeTarget", "PBXNativeTarget", "", _targets[i]);
|
||||||
|
|
||||||
target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", kSettingsNoValue);
|
target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", kSettingsNoValue);
|
||||||
|
@ -556,49 +644,51 @@ void XcodeProvider::setupProject() {
|
||||||
project->_properties["knownRegions"] = regions;
|
project->_properties["knownRegions"] = regions;
|
||||||
|
|
||||||
project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", kSettingsNoValue);
|
project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", kSettingsNoValue);
|
||||||
|
project->addProperty("productRefGroup", getHash("PBXGroup_CustomTemplate_Products_"), "" , kSettingsNoValue);
|
||||||
project->addProperty("projectDirPath", _projectRoot, "", kSettingsNoValue | kSettingsQuoteVariable);
|
project->addProperty("projectDirPath", _projectRoot, "", kSettingsNoValue | kSettingsQuoteVariable);
|
||||||
project->addProperty("projectRoot", "", "", kSettingsNoValue | kSettingsQuoteVariable);
|
project->addProperty("projectRoot", "", "", kSettingsNoValue | kSettingsQuoteVariable);
|
||||||
|
|
||||||
// List of targets
|
// List of targets
|
||||||
Property targets;
|
Property targets;
|
||||||
targets._flags = kSettingsAsList;
|
targets._flags = kSettingsAsList;
|
||||||
#ifdef ENABLE_IOS
|
|
||||||
targets._settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], kSettingsNoValue, 0, 0);
|
targets._settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], kSettingsNoValue, 0, 0);
|
||||||
#endif
|
|
||||||
targets._settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], kSettingsNoValue, 0, 1);
|
targets._settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], kSettingsNoValue, 0, 1);
|
||||||
#ifdef ENABLE_IOS
|
|
||||||
targets._settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], kSettingsNoValue, 0, 2);
|
|
||||||
#endif
|
|
||||||
project->_properties["targets"] = targets;
|
project->_properties["targets"] = targets;
|
||||||
#ifndef ENABLE_IOS
|
|
||||||
// Force list even when there is only a single target
|
// Force list even when there is only a single target
|
||||||
project->_properties["targets"]._flags |= kSettingsSingleItem;
|
project->_properties["targets"]._flags |= kSettingsSingleItem;
|
||||||
#endif
|
|
||||||
|
|
||||||
_project.add(project);
|
_project.add(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XcodeProvider::ValueList& XcodeProvider::getResourceFiles() const {
|
||||||
|
static ValueList files;
|
||||||
|
if (files.empty()) {
|
||||||
|
files.push_back("gui/themes/scummclassic.zip");
|
||||||
|
files.push_back("gui/themes/scummmodern.zip");
|
||||||
|
files.push_back("gui/themes/translations.dat");
|
||||||
|
files.push_back("dists/engine-data/drascula.dat");
|
||||||
|
files.push_back("dists/engine-data/hugo.dat");
|
||||||
|
files.push_back("dists/engine-data/kyra.dat");
|
||||||
|
files.push_back("dists/engine-data/lure.dat");
|
||||||
|
files.push_back("dists/engine-data/mort.dat");
|
||||||
|
files.push_back("dists/engine-data/neverhood.dat");
|
||||||
|
files.push_back("dists/engine-data/queen.tbl");
|
||||||
|
files.push_back("dists/engine-data/sky.cpt");
|
||||||
|
files.push_back("dists/engine-data/teenagent.dat");
|
||||||
|
files.push_back("dists/engine-data/tony.dat");
|
||||||
|
files.push_back("dists/engine-data/toon.dat");
|
||||||
|
files.push_back("dists/engine-data/wintermute.zip");
|
||||||
|
files.push_back("dists/pred.dic");
|
||||||
|
files.push_back("icons/scummvm.icns");
|
||||||
|
}
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
void XcodeProvider::setupResourcesBuildPhase() {
|
void XcodeProvider::setupResourcesBuildPhase() {
|
||||||
_resourcesBuildPhase._comment = "PBXResourcesBuildPhase";
|
_resourcesBuildPhase._comment = "PBXResourcesBuildPhase";
|
||||||
|
|
||||||
// Setup resource file properties
|
ValueList &files_list = getResourceFiles();
|
||||||
std::map<std::string, FileProperty> properties;
|
|
||||||
properties["scummclassic.zip"] = FileProperty("archive.zip", "", "scummclassic.zip", "\"<group>\"");
|
|
||||||
properties["scummmodern.zip"] = FileProperty("archive.zip", "", "scummmodern.zip", "\"<group>\"");
|
|
||||||
|
|
||||||
properties["kyra.dat"] = FileProperty("file", "", "kyra.dat", "\"<group>\"");
|
|
||||||
properties["lure.dat"] = FileProperty("file", "", "lure.dat", "\"<group>\"");
|
|
||||||
properties["queen.tbl"] = FileProperty("file", "", "queen.tbl", "\"<group>\"");
|
|
||||||
properties["sky.cpt"] = FileProperty("file", "", "sky.cpt", "\"<group>\"");
|
|
||||||
properties["drascula.dat"] = FileProperty("file", "", "drascula.dat", "\"<group>\"");
|
|
||||||
properties["hugo.dat"] = FileProperty("file", "", "hugo.dat", "\"<group>\"");
|
|
||||||
properties["teenagent.dat"] = FileProperty("file", "", "teenagent.dat", "\"<group>\"");
|
|
||||||
properties["toon.dat"] = FileProperty("file", "", "toon.dat", "\"<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>\"");
|
|
||||||
properties["icon4.png"] = FileProperty("image.png", "", "icon4.png", "\"<group>\"");
|
|
||||||
|
|
||||||
// Same as for containers: a rule for each native target
|
// Same as for containers: a rule for each native target
|
||||||
for (unsigned int i = 0; i < _targets.size(); i++) {
|
for (unsigned int i = 0; i < _targets.size(); i++) {
|
||||||
|
@ -611,40 +701,17 @@ void XcodeProvider::setupResourcesBuildPhase() {
|
||||||
files._hasOrder = true;
|
files._hasOrder = true;
|
||||||
files._flags = kSettingsAsList;
|
files._flags = kSettingsAsList;
|
||||||
|
|
||||||
ValueList files_list;
|
|
||||||
files_list.push_back("scummclassic.zip");
|
|
||||||
files_list.push_back("scummmodern.zip");
|
|
||||||
files_list.push_back("kyra.dat");
|
|
||||||
files_list.push_back("lure.dat");
|
|
||||||
files_list.push_back("queen.tbl");
|
|
||||||
files_list.push_back("sky.cpt");
|
|
||||||
files_list.push_back("Default.png");
|
|
||||||
files_list.push_back("icon.png");
|
|
||||||
files_list.push_back("icon-72.png");
|
|
||||||
files_list.push_back("icon4.png");
|
|
||||||
files_list.push_back("drascula.dat");
|
|
||||||
files_list.push_back("hugo.dat");
|
|
||||||
files_list.push_back("teenagent.dat");
|
|
||||||
files_list.push_back("toon.dat");
|
|
||||||
|
|
||||||
int order = 0;
|
int order = 0;
|
||||||
for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) {
|
for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) {
|
||||||
std::string id = "PBXResources_" + *file;
|
if (shouldSkipFileForTarget(*file, _targets[i], *file)) {
|
||||||
std::string comment = *file + " in Resources";
|
continue;
|
||||||
|
}
|
||||||
ADD_SETTING_ORDER_NOVALUE(files, getHash(id), comment, order++);
|
std::string resourceAbsolutePath = _projectRoot + "/" + *file;
|
||||||
// TODO Fix crash when adding build file for data
|
std::string file_id = "FileReference_" + resourceAbsolutePath;
|
||||||
//ADD_BUILD_FILE(id, *file, comment);
|
std::string base = basename(*file);
|
||||||
addFileReference(*file, *file, properties[*file]);
|
std::string comment = base + " in Resources";
|
||||||
}
|
addBuildFile(resourceAbsolutePath, base, getHash(file_id), comment);
|
||||||
|
ADD_SETTING_ORDER_NOVALUE(files, getHash(resourceAbsolutePath), comment, order++);
|
||||||
// Add custom files depending on the target
|
|
||||||
if (_targets[i] == PROJECT_DESCRIPTION "-OS X") {
|
|
||||||
files._settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", kSettingsNoValue, 0, 6);
|
|
||||||
|
|
||||||
// Remove 2 iphone icon files
|
|
||||||
files._settings.erase(getHash("PBXResources_Default.png"));
|
|
||||||
files._settings.erase(getHash("PBXResources_icon.png"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource->_properties["files"] = files;
|
resource->_properties["files"] = files;
|
||||||
|
@ -658,11 +725,9 @@ void XcodeProvider::setupResourcesBuildPhase() {
|
||||||
void XcodeProvider::setupSourcesBuildPhase() {
|
void XcodeProvider::setupSourcesBuildPhase() {
|
||||||
_sourcesBuildPhase._comment = "PBXSourcesBuildPhase";
|
_sourcesBuildPhase._comment = "PBXSourcesBuildPhase";
|
||||||
|
|
||||||
// Setup source file properties
|
|
||||||
std::map<std::string, FileProperty> properties;
|
|
||||||
|
|
||||||
// Same as for containers: a rule for each native target
|
// Same as for containers: a rule for each native target
|
||||||
for (unsigned int i = 0; i < _targets.size(); i++) {
|
for (unsigned int i = 0; i < _targets.size(); i++) {
|
||||||
|
const std::string &targetName = _targets[i];
|
||||||
Object *source = new Object(this, "PBXSourcesBuildPhase_" + _targets[i], "PBXSourcesBuildPhase", "PBXSourcesBuildPhase", "", "Sources");
|
Object *source = new Object(this, "PBXSourcesBuildPhase_" + _targets[i], "PBXSourcesBuildPhase", "PBXSourcesBuildPhase", "", "Sources");
|
||||||
|
|
||||||
source->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
|
source->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
|
||||||
|
@ -673,13 +738,19 @@ void XcodeProvider::setupSourcesBuildPhase() {
|
||||||
|
|
||||||
int order = 0;
|
int order = 0;
|
||||||
for (std::vector<Object *>::iterator file = _buildFile._objects.begin(); file != _buildFile._objects.end(); ++file) {
|
for (std::vector<Object *>::iterator file = _buildFile._objects.begin(); file != _buildFile._objects.end(); ++file) {
|
||||||
if (!producesObjectFileOnOSX((*file)->_name)) {
|
const std::string &fileName = (*file)->_name;
|
||||||
|
if (shouldSkipFileForTarget((*file)->_id, targetName, fileName)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string comment = (*file)->_name + " in Sources";
|
if (!producesObjectFileOnOSX(fileName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
std::string comment = fileName + " in Sources";
|
||||||
ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->_id), comment, order++);
|
ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->_id), comment, order++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setupAdditionalSources(targetName, files, order);
|
||||||
|
|
||||||
source->_properties["files"] = files;
|
source->_properties["files"] = files;
|
||||||
|
|
||||||
source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
|
source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
|
||||||
|
@ -689,73 +760,20 @@ void XcodeProvider::setupSourcesBuildPhase() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup all build configurations
|
// Setup all build configurations
|
||||||
void XcodeProvider::setupBuildConfiguration() {
|
void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
|
||||||
|
|
||||||
_buildConfiguration._comment = "XCBuildConfiguration";
|
_buildConfiguration._comment = "XCBuildConfiguration";
|
||||||
_buildConfiguration._flags = kSettingsAsList;
|
_buildConfiguration._flags = kSettingsAsList;
|
||||||
|
|
||||||
///****************************************
|
std::string projectOutputDirectory;
|
||||||
// * iPhone
|
#ifdef POSIX
|
||||||
// ****************************************/
|
char *rp = realpath(setup.outputDir.c_str(), NULL);
|
||||||
#ifdef ENABLE_IOS
|
projectOutputDirectory = rp;
|
||||||
// Debug
|
free(rp);
|
||||||
Object *iPhone_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Debug", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Debug");
|
|
||||||
Property iPhone_Debug;
|
|
||||||
ADD_SETTING_QUOTE(iPhone_Debug, "ARCHS", "$(ARCHS_UNIVERSAL_IPHONE_OS)");
|
|
||||||
ADD_SETTING_QUOTE(iPhone_Debug, "CODE_SIGN_IDENTITY", "iPhone Developer");
|
|
||||||
ADD_SETTING_QUOTE_VAR(iPhone_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer");
|
|
||||||
ADD_SETTING(iPhone_Debug, "COMPRESS_PNG_FILES", "NO");
|
|
||||||
ADD_SETTING(iPhone_Debug, "COPY_PHASE_STRIP", "NO");
|
|
||||||
ADD_SETTING_QUOTE(iPhone_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
|
|
||||||
ValueList iPhone_FrameworkSearchPaths;
|
|
||||||
iPhone_FrameworkSearchPaths.push_back("$(inherited)");
|
|
||||||
iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"");
|
|
||||||
ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, kSettingsAsList, 5);
|
|
||||||
ADD_SETTING(iPhone_Debug, "GCC_DYNAMIC_NO_PIC", "NO");
|
|
||||||
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO");
|
|
||||||
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO");
|
|
||||||
ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0");
|
|
||||||
ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO");
|
|
||||||
ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", "");
|
|
||||||
ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO");
|
|
||||||
ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES");
|
|
||||||
ValueList iPhone_HeaderSearchPaths;
|
|
||||||
iPhone_HeaderSearchPaths.push_back("$(SRCROOT)/engines/");
|
|
||||||
iPhone_HeaderSearchPaths.push_back("$(SRCROOT)");
|
|
||||||
iPhone_HeaderSearchPaths.push_back("include/");
|
|
||||||
ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, kSettingsAsList | kSettingsQuoteVariable, 5);
|
|
||||||
ADD_SETTING(iPhone_Debug, "INFOPLIST_FILE", "Info.plist");
|
|
||||||
ValueList iPhone_LibPaths;
|
|
||||||
iPhone_LibPaths.push_back("$(inherited)");
|
|
||||||
iPhone_LibPaths.push_back("\"$(SRCROOT)/lib\"");
|
|
||||||
ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, kSettingsAsList, 5);
|
|
||||||
ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES");
|
|
||||||
ADD_SETTING(iPhone_Debug, "PREBINDING", "NO");
|
|
||||||
ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION);
|
|
||||||
ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8");
|
|
||||||
ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", "");
|
|
||||||
ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos4.0");
|
|
||||||
ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2");
|
|
||||||
|
|
||||||
iPhone_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
|
|
||||||
iPhone_Debug_Object->_properties["buildSettings"] = iPhone_Debug;
|
|
||||||
|
|
||||||
// Release
|
|
||||||
Object *iPhone_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Release", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
|
|
||||||
Property iPhone_Release(iPhone_Debug);
|
|
||||||
ADD_SETTING(iPhone_Release, "GCC_OPTIMIZATION_LEVEL", "3");
|
|
||||||
ADD_SETTING(iPhone_Release, "COPY_PHASE_STRIP", "YES");
|
|
||||||
REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC");
|
|
||||||
ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app");
|
|
||||||
|
|
||||||
iPhone_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
|
|
||||||
iPhone_Release_Object->_properties["buildSettings"] = iPhone_Release;
|
|
||||||
|
|
||||||
_buildConfiguration.add(iPhone_Debug_Object);
|
|
||||||
_buildConfiguration.add(iPhone_Release_Object);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************
|
/****************************************
|
||||||
* scummvm
|
* ScummVM - Project Level
|
||||||
****************************************/
|
****************************************/
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
|
@ -763,7 +781,6 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
Property scummvm_Debug;
|
Property scummvm_Debug;
|
||||||
ADD_SETTING(scummvm_Debug, "ALWAYS_SEARCH_USER_PATHS", "NO");
|
ADD_SETTING(scummvm_Debug, "ALWAYS_SEARCH_USER_PATHS", "NO");
|
||||||
ADD_SETTING_QUOTE(scummvm_Debug, "USER_HEADER_SEARCH_PATHS", "$(SRCROOT) $(SRCROOT)/engines");
|
ADD_SETTING_QUOTE(scummvm_Debug, "USER_HEADER_SEARCH_PATHS", "$(SRCROOT) $(SRCROOT)/engines");
|
||||||
ADD_SETTING_QUOTE(scummvm_Debug, "ARCHS", "$(ARCHS_STANDARD_32_BIT)");
|
|
||||||
ADD_SETTING_QUOTE(scummvm_Debug, "CODE_SIGN_IDENTITY", "Don't Code Sign");
|
ADD_SETTING_QUOTE(scummvm_Debug, "CODE_SIGN_IDENTITY", "Don't Code Sign");
|
||||||
ADD_SETTING_QUOTE_VAR(scummvm_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "Don't Code Sign");
|
ADD_SETTING_QUOTE_VAR(scummvm_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "Don't Code Sign");
|
||||||
ADD_SETTING_QUOTE(scummvm_Debug, "FRAMEWORK_SEARCH_PATHS", "");
|
ADD_SETTING_QUOTE(scummvm_Debug, "FRAMEWORK_SEARCH_PATHS", "");
|
||||||
|
@ -773,9 +790,11 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
ADD_SETTING(scummvm_Debug, "GCC_INPUT_FILETYPE", "automatic");
|
ADD_SETTING(scummvm_Debug, "GCC_INPUT_FILETYPE", "automatic");
|
||||||
ADD_SETTING(scummvm_Debug, "GCC_OPTIMIZATION_LEVEL", "0");
|
ADD_SETTING(scummvm_Debug, "GCC_OPTIMIZATION_LEVEL", "0");
|
||||||
ValueList scummvm_defines(_defines);
|
ValueList scummvm_defines(_defines);
|
||||||
ADD_DEFINE(scummvm_defines, "IPHONE");
|
REMOVE_DEFINE(scummvm_defines, "MACOSX");
|
||||||
ADD_DEFINE(scummvm_defines, "XCODE");
|
REMOVE_DEFINE(scummvm_defines, "IPHONE");
|
||||||
ADD_DEFINE(scummvm_defines, "IPHONE_OFFICIAL");
|
REMOVE_DEFINE(scummvm_defines, "IPHONE_IOS7");
|
||||||
|
REMOVE_DEFINE(scummvm_defines, "IPHONE_SANDBOXED");
|
||||||
|
REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND");
|
||||||
ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5);
|
ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5);
|
||||||
ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO");
|
ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO");
|
||||||
ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO");
|
ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO");
|
||||||
|
@ -791,7 +810,7 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", "");
|
ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", "");
|
||||||
ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_LDFLAGS", "-lz");
|
ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_LDFLAGS", "-lz");
|
||||||
ADD_SETTING(scummvm_Debug, "PREBINDING", "NO");
|
ADD_SETTING(scummvm_Debug, "PREBINDING", "NO");
|
||||||
ADD_SETTING(scummvm_Debug, "SDKROOT", "macosx");
|
ADD_SETTING(scummvm_Debug, "ENABLE_TESTABILITY", "YES");
|
||||||
|
|
||||||
scummvm_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
|
scummvm_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
|
||||||
scummvm_Debug_Object->_properties["buildSettings"] = scummvm_Debug;
|
scummvm_Debug_Object->_properties["buildSettings"] = scummvm_Debug;
|
||||||
|
@ -803,6 +822,7 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
REMOVE_SETTING(scummvm_Release, "GCC_WARN_ABOUT_RETURN_TYPE");
|
REMOVE_SETTING(scummvm_Release, "GCC_WARN_ABOUT_RETURN_TYPE");
|
||||||
REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE");
|
REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE");
|
||||||
REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH");
|
REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH");
|
||||||
|
REMOVE_SETTING(scummvm_Release, "ENABLE_TESTABILITY");
|
||||||
|
|
||||||
scummvm_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
|
scummvm_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
|
||||||
scummvm_Release_Object->_properties["buildSettings"] = scummvm_Release;
|
scummvm_Release_Object->_properties["buildSettings"] = scummvm_Release;
|
||||||
|
@ -810,17 +830,92 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
_buildConfiguration.add(scummvm_Debug_Object);
|
_buildConfiguration.add(scummvm_Debug_Object);
|
||||||
_buildConfiguration.add(scummvm_Release_Object);
|
_buildConfiguration.add(scummvm_Release_Object);
|
||||||
|
|
||||||
|
///****************************************
|
||||||
|
// * ScummVM - iOS Target
|
||||||
|
// ****************************************/
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
Object *iPhone_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Debug", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Debug");
|
||||||
|
Property iPhone_Debug;
|
||||||
|
ADD_SETTING_QUOTE(iPhone_Debug, "CODE_SIGN_IDENTITY", "iPhone Developer");
|
||||||
|
ADD_SETTING_QUOTE_VAR(iPhone_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer");
|
||||||
|
ADD_SETTING(iPhone_Debug, "COMPRESS_PNG_FILES", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "COPY_PHASE_STRIP", "NO");
|
||||||
|
ADD_SETTING_QUOTE(iPhone_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf");
|
||||||
|
ValueList iPhone_FrameworkSearchPaths;
|
||||||
|
iPhone_FrameworkSearchPaths.push_back("$(inherited)");
|
||||||
|
iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"");
|
||||||
|
ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, kSettingsAsList, 5);
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_DYNAMIC_NO_PIC", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0");
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_WARN_64_TO_32_BIT_CONVERSION", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "WARNING_CFLAGS", "-Wno-multichar");
|
||||||
|
ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", "");
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES");
|
||||||
|
ValueList iPhone_HeaderSearchPaths;
|
||||||
|
iPhone_HeaderSearchPaths.push_back("$(SRCROOT)/engines/");
|
||||||
|
iPhone_HeaderSearchPaths.push_back("$(SRCROOT)");
|
||||||
|
iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "\"");
|
||||||
|
iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "/include\"");
|
||||||
|
ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, kSettingsAsList | kSettingsQuoteVariable, 5);
|
||||||
|
ADD_SETTING_QUOTE(iPhone_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/ios7/Info.plist");
|
||||||
|
ValueList iPhone_LibPaths;
|
||||||
|
iPhone_LibPaths.push_back("$(inherited)");
|
||||||
|
iPhone_LibPaths.push_back("\"" + projectOutputDirectory + "/lib\"");
|
||||||
|
ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, kSettingsAsList, 5);
|
||||||
|
ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES");
|
||||||
|
ADD_SETTING(iPhone_Debug, "PREBINDING", "NO");
|
||||||
|
ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_NAME);
|
||||||
|
ADD_SETTING(iPhone_Debug, "PRODUCT_BUNDLE_IDENTIFIER", "\"org.scummvm.${PRODUCT_NAME}\"");
|
||||||
|
ADD_SETTING(iPhone_Debug, "IPHONEOS_DEPLOYMENT_TARGET", "7.1");
|
||||||
|
//ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8");
|
||||||
|
ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", "");
|
||||||
|
ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos");
|
||||||
|
ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2");
|
||||||
|
ValueList scummvmIOS_defines;
|
||||||
|
ADD_DEFINE(scummvmIOS_defines, "\"$(inherited)\"");
|
||||||
|
ADD_DEFINE(scummvmIOS_defines, "IPHONE");
|
||||||
|
ADD_DEFINE(scummvmIOS_defines, "IPHONE_IOS7");
|
||||||
|
ADD_DEFINE(scummvmIOS_defines, "IPHONE_SANDBOXED");
|
||||||
|
ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, kSettingsNoQuote | kSettingsAsList, 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", "", kSettingsNoValue);
|
||||||
|
iPhone_Debug_Object->_properties["buildSettings"] = iPhone_Debug;
|
||||||
|
|
||||||
|
// Release
|
||||||
|
Object *iPhone_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Release", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
|
||||||
|
Property iPhone_Release(iPhone_Debug);
|
||||||
|
ADD_SETTING(iPhone_Release, "GCC_OPTIMIZATION_LEVEL", "3");
|
||||||
|
ADD_SETTING(iPhone_Release, "COPY_PHASE_STRIP", "YES");
|
||||||
|
REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC");
|
||||||
|
ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app");
|
||||||
|
REMOVE_SETTING(iPhone_Release, "DEBUG_INFORMATION_FORMAT");
|
||||||
|
ADD_SETTING_QUOTE(iPhone_Release, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
|
||||||
|
|
||||||
|
iPhone_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
|
||||||
|
iPhone_Release_Object->_properties["buildSettings"] = iPhone_Release;
|
||||||
|
|
||||||
|
_buildConfiguration.add(iPhone_Debug_Object);
|
||||||
|
_buildConfiguration.add(iPhone_Release_Object);
|
||||||
|
|
||||||
/****************************************
|
/****************************************
|
||||||
* ScummVM-OS X
|
* ScummVM - OS X Target
|
||||||
****************************************/
|
****************************************/
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
Object *scummvmOSX_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-OSX_Debug", _targets[OSX_TARGET] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Debug");
|
Object *scummvmOSX_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-OSX_Debug", _targets[OSX_TARGET] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Debug");
|
||||||
Property scummvmOSX_Debug;
|
Property scummvmOSX_Debug;
|
||||||
ADD_SETTING_QUOTE(scummvmOSX_Debug, "ARCHS", "$(NATIVE_ARCH)");
|
ADD_SETTING(scummvmOSX_Debug, "COMBINE_HIDPI_IMAGES", "YES");
|
||||||
|
ADD_SETTING(scummvmOSX_Debug, "SDKROOT", "macosx");
|
||||||
ADD_SETTING(scummvmOSX_Debug, "COMPRESS_PNG_FILES", "NO");
|
ADD_SETTING(scummvmOSX_Debug, "COMPRESS_PNG_FILES", "NO");
|
||||||
ADD_SETTING(scummvmOSX_Debug, "COPY_PHASE_STRIP", "NO");
|
ADD_SETTING(scummvmOSX_Debug, "COPY_PHASE_STRIP", "NO");
|
||||||
ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
|
ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf");
|
||||||
ADD_SETTING_QUOTE(scummvmOSX_Debug, "FRAMEWORK_SEARCH_PATHS", "");
|
ADD_SETTING_QUOTE(scummvmOSX_Debug, "FRAMEWORK_SEARCH_PATHS", "");
|
||||||
ADD_SETTING(scummvmOSX_Debug, "GCC_C_LANGUAGE_STANDARD", "c99");
|
ADD_SETTING(scummvmOSX_Debug, "GCC_C_LANGUAGE_STANDARD", "c99");
|
||||||
ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO");
|
ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO");
|
||||||
|
@ -830,7 +925,8 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
ADD_SETTING(scummvmOSX_Debug, "GCC_OPTIMIZATION_LEVEL", "0");
|
ADD_SETTING(scummvmOSX_Debug, "GCC_OPTIMIZATION_LEVEL", "0");
|
||||||
ADD_SETTING(scummvmOSX_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO");
|
ADD_SETTING(scummvmOSX_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO");
|
||||||
ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_PREFIX_HEADER", "");
|
ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_PREFIX_HEADER", "");
|
||||||
ValueList scummvmOSX_defines(_defines);
|
ValueList scummvmOSX_defines;
|
||||||
|
ADD_DEFINE(scummvmOSX_defines, "\"$(inherited)\"");
|
||||||
ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND");
|
ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND");
|
||||||
ADD_DEFINE(scummvmOSX_defines, "MACOSX");
|
ADD_DEFINE(scummvmOSX_defines, "MACOSX");
|
||||||
ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, kSettingsNoQuote | kSettingsAsList, 5);
|
ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, kSettingsNoQuote | kSettingsAsList, 5);
|
||||||
|
@ -866,7 +962,7 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
scummvmOSX_LdFlags.push_back("-lz");
|
scummvmOSX_LdFlags.push_back("-lz");
|
||||||
ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, kSettingsAsList, 5);
|
ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, kSettingsAsList, 5);
|
||||||
ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO");
|
ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO");
|
||||||
ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION);
|
ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_NAME);
|
||||||
|
|
||||||
scummvmOSX_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
|
scummvmOSX_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
|
||||||
scummvmOSX_Debug_Object->_properties["buildSettings"] = scummvmOSX_Debug;
|
scummvmOSX_Debug_Object->_properties["buildSettings"] = scummvmOSX_Debug;
|
||||||
|
@ -878,48 +974,15 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
REMOVE_SETTING(scummvmOSX_Release, "GCC_DYNAMIC_NO_PIC");
|
REMOVE_SETTING(scummvmOSX_Release, "GCC_DYNAMIC_NO_PIC");
|
||||||
REMOVE_SETTING(scummvmOSX_Release, "GCC_OPTIMIZATION_LEVEL");
|
REMOVE_SETTING(scummvmOSX_Release, "GCC_OPTIMIZATION_LEVEL");
|
||||||
ADD_SETTING(scummvmOSX_Release, "WRAPPER_EXTENSION", "app");
|
ADD_SETTING(scummvmOSX_Release, "WRAPPER_EXTENSION", "app");
|
||||||
|
REMOVE_SETTING(scummvmOSX_Release, "DEBUG_INFORMATION_FORMAT");
|
||||||
|
ADD_SETTING_QUOTE(scummvmOSX_Release, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
|
||||||
|
|
||||||
scummvmOSX_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
|
scummvmOSX_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
|
||||||
scummvmOSX_Release_Object->_properties["buildSettings"] = scummvmOSX_Release;
|
scummvmOSX_Release_Object->_properties["buildSettings"] = scummvmOSX_Release;
|
||||||
|
|
||||||
_buildConfiguration.add(scummvmOSX_Debug_Object);
|
_buildConfiguration.add(scummvmOSX_Debug_Object);
|
||||||
_buildConfiguration.add(scummvmOSX_Release_Object);
|
_buildConfiguration.add(scummvmOSX_Release_Object);
|
||||||
#ifdef ENABLE_IOS
|
|
||||||
/****************************************
|
|
||||||
* ScummVM-Simulator
|
|
||||||
****************************************/
|
|
||||||
|
|
||||||
// Debug
|
|
||||||
Object *scummvmSimulator_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Debug", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Debug");
|
|
||||||
Property scummvmSimulator_Debug(iPhone_Debug);
|
|
||||||
ADD_SETTING_QUOTE(scummvmSimulator_Debug, "FRAMEWORK_SEARCH_PATHS", "$(inherited)");
|
|
||||||
ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5);
|
|
||||||
ADD_SETTING(scummvmSimulator_Debug, "SDKROOT", "iphonesimulator3.2");
|
|
||||||
ADD_SETTING_QUOTE(scummvmSimulator_Debug, "VALID_ARCHS", "i386 x86_64");
|
|
||||||
REMOVE_SETTING(scummvmSimulator_Debug, "TARGETED_DEVICE_FAMILY");
|
|
||||||
|
|
||||||
scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
|
|
||||||
scummvmSimulator_Debug_Object->_properties["buildSettings"] = scummvmSimulator_Debug;
|
|
||||||
|
|
||||||
// Release
|
|
||||||
Object *scummvmSimulator_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Release", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
|
|
||||||
Property scummvmSimulator_Release(scummvmSimulator_Debug);
|
|
||||||
ADD_SETTING(scummvmSimulator_Release, "COPY_PHASE_STRIP", "YES");
|
|
||||||
ADD_SETTING(scummvmSimulator_Release, "GCC_OPTIMIZATION_LEVEL", "3");
|
|
||||||
REMOVE_SETTING(scummvmSimulator_Release, "GCC_DYNAMIC_NO_PIC");
|
|
||||||
ADD_SETTING(scummvmSimulator_Release, "WRAPPER_EXTENSION", "app");
|
|
||||||
|
|
||||||
scummvmSimulator_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
|
|
||||||
scummvmSimulator_Release_Object->_properties["buildSettings"] = scummvmSimulator_Release;
|
|
||||||
|
|
||||||
_buildConfiguration.add(scummvmSimulator_Debug_Object);
|
|
||||||
_buildConfiguration.add(scummvmSimulator_Release_Object);
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// Configuration List
|
|
||||||
_configurationList._comment = "XCConfigurationList";
|
|
||||||
_configurationList._flags = kSettingsAsList;
|
|
||||||
#endif
|
|
||||||
// Warning: This assumes we have all configurations with a Debug & Release pair
|
// Warning: This assumes we have all configurations with a Debug & Release pair
|
||||||
for (std::vector<Object *>::iterator config = _buildConfiguration._objects.begin(); config != _buildConfiguration._objects.end(); config++) {
|
for (std::vector<Object *>::iterator config = _buildConfiguration._objects.begin(); config != _buildConfiguration._objects.end(); config++) {
|
||||||
|
|
||||||
|
@ -940,6 +1003,22 @@ void XcodeProvider::setupBuildConfiguration() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XcodeProvider::setupImageAssetCatalog(const BuildSetup &setup) {
|
||||||
|
const std::string filename = "Images.xcassets";
|
||||||
|
const std::string absoluteCatalogPath = _projectRoot + "/dists/ios7/" + filename;
|
||||||
|
const std::string id = "FileReference_" + absoluteCatalogPath;
|
||||||
|
Group *group = touchGroupsForPath(absoluteCatalogPath);
|
||||||
|
group->addChildFile(filename);
|
||||||
|
addBuildFile(absoluteCatalogPath, filename, getHash(id), "Image Asset Catalog");
|
||||||
|
}
|
||||||
|
|
||||||
|
void XcodeProvider::setupAdditionalSources(std::string targetName, Property &files, int &order) {
|
||||||
|
if (targetIsIOS(targetName)) {
|
||||||
|
const std::string absoluteCatalogPath = _projectRoot + "/dists/ios7/Images.xcassets";
|
||||||
|
ADD_SETTING_ORDER_NOVALUE(files, getHash(absoluteCatalogPath), "Image Asset Catalog", order++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// Misc
|
// Misc
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -954,9 +1033,12 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) {
|
||||||
ADD_DEFINE(_defines, *i);
|
ADD_DEFINE(_defines, *i);
|
||||||
}
|
}
|
||||||
// Add special defines for Mac support
|
// Add special defines for Mac support
|
||||||
|
REMOVE_DEFINE(_defines, "MACOSX");
|
||||||
|
REMOVE_DEFINE(_defines, "IPHONE");
|
||||||
|
REMOVE_DEFINE(_defines, "IPHONE_IOS7");
|
||||||
|
REMOVE_DEFINE(_defines, "IPHONE_SANDBOXED");
|
||||||
|
REMOVE_DEFINE(_defines, "SDL_BACKEND");
|
||||||
ADD_DEFINE(_defines, "CONFIG_H");
|
ADD_DEFINE(_defines, "CONFIG_H");
|
||||||
ADD_DEFINE(_defines, "SCUMM_NEED_ALIGNMENT");
|
|
||||||
ADD_DEFINE(_defines, "SCUMM_LITTLE_ENDIAN");
|
|
||||||
ADD_DEFINE(_defines, "UNIX");
|
ADD_DEFINE(_defines, "UNIX");
|
||||||
ADD_DEFINE(_defines, "SCUMMVM");
|
ADD_DEFINE(_defines, "SCUMMVM");
|
||||||
}
|
}
|
||||||
|
@ -965,7 +1047,6 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) {
|
||||||
// Object hash
|
// Object hash
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// TODO use md5 to compute a file hash (and fall back to standard key generation if not passed a file)
|
|
||||||
std::string XcodeProvider::getHash(std::string key) {
|
std::string XcodeProvider::getHash(std::string key) {
|
||||||
|
|
||||||
#if DEBUG_XCODE_HASH
|
#if DEBUG_XCODE_HASH
|
||||||
|
@ -977,7 +1058,12 @@ std::string XcodeProvider::getHash(std::string key) {
|
||||||
return hashIterator->second;
|
return hashIterator->second;
|
||||||
|
|
||||||
// Generate a new key from the file hash and insert it into the dictionary
|
// Generate a new key from the file hash and insert it into the dictionary
|
||||||
|
#ifdef MACOSX
|
||||||
|
std::string hash = md5(key);
|
||||||
|
#else
|
||||||
std::string hash = newHash();
|
std::string hash = newHash();
|
||||||
|
#endif
|
||||||
|
|
||||||
_hashDictionnary[key] = hash;
|
_hashDictionnary[key] = hash;
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
|
@ -986,6 +1072,19 @@ std::string XcodeProvider::getHash(std::string key) {
|
||||||
|
|
||||||
bool isSeparator(char s) { return (s == '-'); }
|
bool isSeparator(char s) { return (s == '-'); }
|
||||||
|
|
||||||
|
#ifdef MACOSX
|
||||||
|
std::string XcodeProvider::md5(std::string key) {
|
||||||
|
unsigned char md[CC_MD5_DIGEST_LENGTH];
|
||||||
|
CC_MD5(key.c_str(), (CC_LONG) key.length(), md);
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << std::hex << std::setfill('0') << std::setw(2);
|
||||||
|
for (int i=0; i<CC_MD5_DIGEST_LENGTH; i++) {
|
||||||
|
stream << (unsigned int) md[i];
|
||||||
|
}
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string XcodeProvider::newHash() const {
|
std::string XcodeProvider::newHash() const {
|
||||||
std::string hash = createUUID();
|
std::string hash = createUUID();
|
||||||
|
|
||||||
|
@ -1070,7 +1169,6 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti
|
||||||
|
|
||||||
// Output a list
|
// Output a list
|
||||||
if (setting._flags & kSettingsAsList) {
|
if (setting._flags & kSettingsAsList) {
|
||||||
|
|
||||||
output += var + ((setting._flags & kSettingsNoValue) ? "(" : " = (") + newline;
|
output += var + ((setting._flags & kSettingsNoValue) ? "(" : " = (") + newline;
|
||||||
|
|
||||||
for (unsigned int i = 0, count = 0; i < setting._entries.size(); ++i) {
|
for (unsigned int i = 0, count = 0; i < setting._entries.size(); ++i) {
|
||||||
|
|
|
@ -40,6 +40,8 @@ protected:
|
||||||
|
|
||||||
void createOtherBuildFiles(const BuildSetup &setup);
|
void createOtherBuildFiles(const BuildSetup &setup);
|
||||||
|
|
||||||
|
void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList);
|
||||||
|
|
||||||
void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
|
void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
|
||||||
const StringList &includeList, const StringList &excludeList);
|
const StringList &includeList, const StringList &excludeList);
|
||||||
|
|
||||||
|
@ -63,7 +65,7 @@ private:
|
||||||
std::string _sourceTree;
|
std::string _sourceTree;
|
||||||
|
|
||||||
FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "")
|
FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "")
|
||||||
: _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) {
|
: _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -208,6 +210,7 @@ private:
|
||||||
assert(!_properties["isa"]._settings.empty());
|
assert(!_properties["isa"]._settings.empty());
|
||||||
|
|
||||||
SettingList::iterator it = _properties["isa"]._settings.begin();
|
SettingList::iterator it = _properties["isa"]._settings.begin();
|
||||||
|
|
||||||
return it->first;
|
return it->first;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -230,6 +233,15 @@ private:
|
||||||
_objectMap[obj->_id] = true;
|
_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 toString() {
|
||||||
std::string output;
|
std::string output;
|
||||||
|
|
||||||
|
@ -300,18 +312,26 @@ private:
|
||||||
|
|
||||||
// Setup objects
|
// Setup objects
|
||||||
void setupCopyFilesBuildPhase();
|
void setupCopyFilesBuildPhase();
|
||||||
void setupFrameworksBuildPhase();
|
void setupFrameworksBuildPhase(const BuildSetup &setup);
|
||||||
void setupNativeTarget();
|
void setupNativeTarget();
|
||||||
void setupProject();
|
void setupProject();
|
||||||
void setupResourcesBuildPhase();
|
void setupResourcesBuildPhase();
|
||||||
void setupSourcesBuildPhase();
|
void setupSourcesBuildPhase();
|
||||||
void setupBuildConfiguration();
|
void setupBuildConfiguration(const BuildSetup &setup);
|
||||||
|
void setupImageAssetCatalog(const BuildSetup &setup);
|
||||||
|
void setupAdditionalSources(std::string targetName, Property &files, int &order);
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations
|
void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations
|
||||||
|
|
||||||
|
// Retrieve information
|
||||||
|
ValueList& getResourceFiles() const;
|
||||||
|
|
||||||
// Hash generation
|
// Hash generation
|
||||||
std::string getHash(std::string key);
|
std::string getHash(std::string key);
|
||||||
|
#ifdef MACOSX
|
||||||
|
std::string md5(std::string key);
|
||||||
|
#endif
|
||||||
std::string newHash() const;
|
std::string newHash() const;
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
|
|
|
@ -140,6 +140,9 @@
|
||||||
/* Begin PBXProject section */
|
/* Begin PBXProject section */
|
||||||
F9A66C1E1396D36100CEE494 /* Project object */ = {
|
F9A66C1E1396D36100CEE494 /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 0720;
|
||||||
|
};
|
||||||
buildConfigurationList = F9A66C211396D36100CEE494 /* Build configuration list for PBXProject "create_project" */;
|
buildConfigurationList = F9A66C211396D36100CEE494 /* Build configuration list for PBXProject "create_project" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
developmentRegion = English;
|
developmentRegion = English;
|
||||||
|
@ -177,12 +180,14 @@
|
||||||
F9A66C2E1396D36100CEE494 /* Debug */ = {
|
F9A66C2E1396D36100CEE494 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
ENABLE_TESTABILITY = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
POSIX,
|
||||||
|
MACOSX,
|
||||||
|
);
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
@ -195,9 +200,11 @@
|
||||||
F9A66C2F1396D36100CEE494 /* Release */ = {
|
F9A66C2F1396D36100CEE494 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
POSIX,
|
||||||
|
MACOSX,
|
||||||
|
);
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
@ -213,6 +220,10 @@
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"$(inherited)",
|
||||||
|
DEBUG,
|
||||||
|
);
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
|
@ -224,6 +235,7 @@
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
|
|
@ -38,7 +38,6 @@ my @subs_files = qw(
|
||||||
dists/macosx/Info.plist
|
dists/macosx/Info.plist
|
||||||
dists/irix/residualvm.spec
|
dists/irix/residualvm.spec
|
||||||
dists/android/AndroidManifest.xml
|
dists/android/AndroidManifest.xml
|
||||||
dists/android/plugin-manifest.xml
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my %subs = (
|
my %subs = (
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
#include "common/error.h"
|
#include "common/error.h"
|
||||||
#include "common/list.h"
|
#include "common/list.h"
|
||||||
#include "common/list_intern.h"
|
|
||||||
#include "common/memstream.h"
|
#include "common/memstream.h"
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
#include "common/taskbar.h"
|
#include "common/taskbar.h"
|
||||||
|
|
|
@ -277,7 +277,7 @@ bool TTFFont::load(Common::SeekableReadStream &stream, int size, TTFSizeMode siz
|
||||||
}
|
}
|
||||||
|
|
||||||
int TTFFont::computePointSize(int size, TTFSizeMode sizeMode) const {
|
int TTFFont::computePointSize(int size, TTFSizeMode sizeMode) const {
|
||||||
int ptSize;
|
int ptSize = 0;
|
||||||
switch (sizeMode) {
|
switch (sizeMode) {
|
||||||
case kTTFSizeModeCell: {
|
case kTTFSizeModeCell: {
|
||||||
ptSize = readPointSizeFromVDMXTable(size);
|
ptSize = readPointSizeFromVDMXTable(size);
|
||||||
|
|
|
@ -44,21 +44,21 @@
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
const char * const ThemeEngine::kImageLogo = "logo.bmp";
|
const char *const ThemeEngine::kImageLogo = "logo.bmp";
|
||||||
const char * const ThemeEngine::kImageLogoSmall = "logo_small.bmp";
|
const char *const ThemeEngine::kImageLogoSmall = "logo_small.bmp";
|
||||||
const char * const ThemeEngine::kImageSearch = "search.bmp";
|
const char *const ThemeEngine::kImageSearch = "search.bmp";
|
||||||
const char * const ThemeEngine::kImageEraser = "eraser.bmp";
|
const char *const ThemeEngine::kImageEraser = "eraser.bmp";
|
||||||
const char * const ThemeEngine::kImageDelbtn = "delbtn.bmp";
|
const char *const ThemeEngine::kImageDelButton = "delbtn.bmp";
|
||||||
const char * const ThemeEngine::kImageList = "list.bmp";
|
const char *const ThemeEngine::kImageList = "list.bmp";
|
||||||
const char * const ThemeEngine::kImageGrid = "grid.bmp";
|
const char *const ThemeEngine::kImageGrid = "grid.bmp";
|
||||||
const char * const ThemeEngine::kImageStopbtn = "stopbtn.bmp";
|
const char *const ThemeEngine::kImageStopButton = "stopbtn.bmp";
|
||||||
const char * const ThemeEngine::kImageEditbtn = "editbtn.bmp";
|
const char *const ThemeEngine::kImageEditButton = "editbtn.bmp";
|
||||||
const char * const ThemeEngine::kImageSwitchModebtn = "switchbtn.bmp";
|
const char *const ThemeEngine::kImageSwitchModeButton = "switchbtn.bmp";
|
||||||
const char * const ThemeEngine::kImageFastReplaybtn = "fastreplay.bmp";
|
const char *const ThemeEngine::kImageFastReplayButton = "fastreplay.bmp";
|
||||||
const char * const ThemeEngine::kImageStopSmallbtn = "stopbtn_small.bmp";
|
const char *const ThemeEngine::kImageStopSmallButton = "stopbtn_small.bmp";
|
||||||
const char * const ThemeEngine::kImageEditSmallbtn = "editbtn_small.bmp";
|
const char *const ThemeEngine::kImageEditSmallButton = "editbtn_small.bmp";
|
||||||
const char * const ThemeEngine::kImageSwitchModeSmallbtn = "switchbtn_small.bmp";
|
const char *const ThemeEngine::kImageSwitchModeSmallButton = "switchbtn_small.bmp";
|
||||||
const char * const ThemeEngine::kImageFastReplaySmallbtn = "fastreplay_small.bmp";
|
const char *const ThemeEngine::kImageFastReplaySmallButton = "fastreplay_small.bmp";
|
||||||
|
|
||||||
struct TextDrawData {
|
struct TextDrawData {
|
||||||
const Graphics::Font *_fontPtr;
|
const Graphics::Font *_fontPtr;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "graphics/pixelformat.h"
|
#include "graphics/pixelformat.h"
|
||||||
|
|
||||||
|
|
||||||
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.20"
|
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.21"
|
||||||
|
|
||||||
class OSystem;
|
class OSystem;
|
||||||
|
|
||||||
|
@ -228,17 +228,17 @@ public:
|
||||||
static const char *const kImageLogoSmall; ///< ScummVM logo used in the GMM
|
static const char *const kImageLogoSmall; ///< ScummVM logo used in the GMM
|
||||||
static const char *const kImageSearch; ///< Search tool image used in the launcher
|
static const char *const kImageSearch; ///< Search tool image used in the launcher
|
||||||
static const char *const kImageEraser; ///< Clear input image used in the launcher
|
static const char *const kImageEraser; ///< Clear input image used in the launcher
|
||||||
static const char *const kImageDelbtn; ///< Delete characters in the predictive dialog
|
static const char *const kImageDelButton; ///< Delete characters in the predictive dialog
|
||||||
static const char *const kImageList; ///< List image used in save/load chooser selection
|
static const char *const kImageList; ///< List image used in save/load chooser selection
|
||||||
static const char *const kImageGrid; ///< Grid image used in save/load chooser selection
|
static const char *const kImageGrid; ///< Grid image used in save/load chooser selection
|
||||||
static const char *const kImageStopbtn; ///< Stop recording button in recorder onscreen dialog
|
static const char *const kImageStopButton; ///< Stop recording button in recorder onscreen dialog
|
||||||
static const char *const kImageEditbtn; ///< Edit recording metadata in recorder onscreen dialog
|
static const char *const kImageEditButton; ///< Edit recording metadata in recorder onscreen dialog
|
||||||
static const char *const kImageSwitchModebtn; ///< Switch mode button in recorder onscreen dialog
|
static const char *const kImageSwitchModeButton; ///< Switch mode button in recorder onscreen dialog
|
||||||
static const char *const kImageFastReplaybtn; ///< Fast playback mode button in recorder onscreen dialog
|
static const char *const kImageFastReplayButton; ///< Fast playback mode button in recorder onscreen dialog
|
||||||
static const char *const kImageStopSmallbtn; ///< Stop recording button in recorder onscreen dialog (for 320xY)
|
static const char *const kImageStopSmallButton; ///< Stop recording button in recorder onscreen dialog (for 320xY)
|
||||||
static const char *const kImageEditSmallbtn; ///< Edit recording metadata in recorder onscreen dialog (for 320xY)
|
static const char *const kImageEditSmallButton; ///< Edit recording metadata in recorder onscreen dialog (for 320xY)
|
||||||
static const char *const kImageSwitchModeSmallbtn; ///< Switch mode button in recorder onscreen dialog (for 320xY)
|
static const char *const kImageSwitchModeSmallButton; ///< Switch mode button in recorder onscreen dialog (for 320xY)
|
||||||
static const char *const kImageFastReplaySmallbtn; ///< Fast playback mode button in recorder onscreen dialog (for 320xY)
|
static const char *const kImageFastReplaySmallButton; ///< Fast playback mode button in recorder onscreen dialog (for 320xY)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Graphics mode enumeration.
|
* Graphics mode enumeration.
|
||||||
|
|
|
@ -32,6 +32,18 @@ MODULE_OBJS := \
|
||||||
widgets/scrollbar.o \
|
widgets/scrollbar.o \
|
||||||
widgets/tab.o
|
widgets/tab.o
|
||||||
|
|
||||||
|
# HACK: create_project's XCode generator relies on the following ifdef
|
||||||
|
# structure to pick up the right browser implementations for iOS and Mac OS X.
|
||||||
|
# Please keep it like this or XCode project generation will be broken.
|
||||||
|
# FIXME: This only works because of a bug in how we handle ifdef statements in
|
||||||
|
# create_project's module.mk parser. create_project will think that both
|
||||||
|
# browser.o and browser_osx.o is built when both IPHONE and MACOSX is set.
|
||||||
|
# When we do proper ifdef handling, only browser.o will be picked up, breaking
|
||||||
|
# XCode generation.
|
||||||
|
ifdef IPHONE
|
||||||
|
MODULE_OBJS += \
|
||||||
|
browser.o
|
||||||
|
else
|
||||||
ifdef MACOSX
|
ifdef MACOSX
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
browser_osx.o
|
browser_osx.o
|
||||||
|
@ -39,6 +51,7 @@ else
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
browser.o
|
browser.o
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef ENABLE_EVENTRECORDER
|
ifdef ENABLE_EVENTRECORDER
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
|
|
|
@ -62,37 +62,37 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
|
||||||
|
|
||||||
#ifndef DISABLE_FANCY_THEMES
|
#ifndef DISABLE_FANCY_THEMES
|
||||||
if (g_gui.xmlEval()->getVar("Globals.OnScreenDialog.ShowPics") == 1 && g_gui.theme()->supportsImages()) {
|
if (g_gui.xmlEval()->getVar("Globals.OnScreenDialog.ShowPics") == 1 && g_gui.theme()->supportsImages()) {
|
||||||
GUI::PicButtonWidget *btn;
|
GUI::PicButtonWidget *button;
|
||||||
btn = new PicButtonWidget(this, "OnScreenDialog.StopButton", 0, kStopCmd, 0);
|
button = new PicButtonWidget(this, "OnScreenDialog.StopButton", 0, kStopCmd, 0);
|
||||||
btn->useThemeTransparency(true);
|
button->useThemeTransparency(true);
|
||||||
|
|
||||||
if (g_system->getOverlayWidth() > 320)
|
if (g_system->getOverlayWidth() > 320)
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageStopbtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageStopButton));
|
||||||
else
|
else
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageStopSmallbtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageStopSmallButton));
|
||||||
|
|
||||||
if (isRecord) {
|
if (isRecord) {
|
||||||
btn = new PicButtonWidget(this, "OnScreenDialog.EditButton", 0, kEditCmd, 0);
|
button = new PicButtonWidget(this, "OnScreenDialog.EditButton", 0, kEditCmd, 0);
|
||||||
btn->useThemeTransparency(true);
|
button->useThemeTransparency(true);
|
||||||
|
|
||||||
if (g_system->getOverlayWidth() > 320)
|
if (g_system->getOverlayWidth() > 320)
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEditbtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEditButton));
|
||||||
else
|
else
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEditSmallbtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEditSmallButton));
|
||||||
} else {
|
} else {
|
||||||
btn = new PicButtonWidget(this, "OnScreenDialog.SwitchModeButton", 0, kSwitchModeCmd, 0);
|
button = new PicButtonWidget(this, "OnScreenDialog.SwitchModeButton", 0, kSwitchModeCmd, 0);
|
||||||
btn->useThemeTransparency(true);
|
button->useThemeTransparency(true);
|
||||||
if (g_system->getOverlayWidth() > 320)
|
if (g_system->getOverlayWidth() > 320)
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSwitchModebtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSwitchModeButton));
|
||||||
else
|
else
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSwitchModeSmallbtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSwitchModeSmallButton));
|
||||||
|
|
||||||
btn = new PicButtonWidget(this, "OnScreenDialog.FastReplayButton", 0, kFastModeCmd, 0);
|
button = new PicButtonWidget(this, "OnScreenDialog.FastReplayButton", 0, kFastModeCmd, 0);
|
||||||
btn->useThemeTransparency(true);
|
button->useThemeTransparency(true);
|
||||||
if (g_system->getOverlayWidth() > 320)
|
if (g_system->getOverlayWidth() > 320)
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageFastReplaybtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageFastReplayButton));
|
||||||
else
|
else
|
||||||
btn->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageFastReplaySmallbtn));
|
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageFastReplaySmallButton));
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "gui/widget.h"
|
#include "gui/widget.h"
|
||||||
#include "gui/widgets/edittext.h"
|
#include "gui/widgets/edittext.h"
|
||||||
#include "gui/gui-manager.h"
|
#include "gui/gui-manager.h"
|
||||||
|
#include "gui/ThemeEval.h"
|
||||||
|
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
#include "common/translation.h"
|
#include "common/translation.h"
|
||||||
|
@ -69,74 +70,57 @@ enum {
|
||||||
PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
|
PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
|
||||||
new StaticTextWidget(this, "Predictive.Headline", "Enter Text");
|
new StaticTextWidget(this, "Predictive.Headline", "Enter Text");
|
||||||
|
|
||||||
_btns = (ButtonWidget **)calloc(16, sizeof(ButtonWidget *));
|
_button[kCancelAct] = new ButtonWidget(this, "Predictive.Cancel", _("Cancel") , 0, kCancelCmd);
|
||||||
|
_button[kOkAct] = new ButtonWidget(this, "Predictive.OK", _("Ok") , 0, kOkCmd);
|
||||||
|
_button[kButton1Act] = new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , 0, kBut1Cmd);
|
||||||
|
_button[kButton2Act] = new ButtonWidget(this, "Predictive.Button2", "2 abc" , 0, kBut2Cmd);
|
||||||
|
_button[kButton3Act] = new ButtonWidget(this, "Predictive.Button3", "3 def" , 0, kBut3Cmd);
|
||||||
|
_button[kButton4Act] = new ButtonWidget(this, "Predictive.Button4", "4 ghi" , 0, kBut4Cmd);
|
||||||
|
_button[kButton5Act] = new ButtonWidget(this, "Predictive.Button5", "5 jkl" , 0, kBut5Cmd);
|
||||||
|
_button[kButton6Act] = new ButtonWidget(this, "Predictive.Button6", "6 mno" , 0, kBut6Cmd);
|
||||||
|
_button[kButton7Act] = new ButtonWidget(this, "Predictive.Button7", "7 pqrs" , 0, kBut7Cmd);
|
||||||
|
_button[kButton8Act] = new ButtonWidget(this, "Predictive.Button8", "8 tuv" , 0, kBut8Cmd);
|
||||||
|
_button[kButton9Act] = new ButtonWidget(this, "Predictive.Button9", "9 wxyz" , 0, kBut9Cmd);
|
||||||
|
_button[kButton0Act] = new ButtonWidget(this, "Predictive.Button0", "0" , 0, kBut0Cmd);
|
||||||
|
// I18N: You must leave "#" as is, only word 'next' is translatable
|
||||||
|
_button[kNextAct] = new ButtonWidget(this, "Predictive.Next", _("# next") , 0, kNextCmd);
|
||||||
|
_button[kAddAct] = new ButtonWidget(this, "Predictive.Add", _("add") , 0, kAddCmd);
|
||||||
|
_button[kAddAct]->setEnabled(false);
|
||||||
|
|
||||||
_btns[kCancelAct] = new ButtonWidget(this, "Predictive.Cancel", _("Cancel") , 0, kCancelCmd);
|
#ifndef DISABLE_FANCY_THEMES
|
||||||
_btns[kOkAct] = new ButtonWidget(this, "Predictive.OK", _("Ok") , 0, kOkCmd);
|
if (g_gui.xmlEval()->getVar("Globals.Predictive.ShowDeletePic") == 1 && g_gui.theme()->supportsImages()) {
|
||||||
_btns[kBtn1Act] = new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , 0, kBut1Cmd);
|
_button[kDelAct] = new PicButtonWidget(this, "Predictive.Delete", _("Delete char"), kDelCmd);
|
||||||
_btns[kBtn2Act] = new ButtonWidget(this, "Predictive.Button2", "2 abc" , 0, kBut2Cmd);
|
((PicButtonWidget *)_button[kDelAct])->useThemeTransparency(true);
|
||||||
_btns[kBtn3Act] = new ButtonWidget(this, "Predictive.Button3", "3 def" , 0, kBut3Cmd);
|
((PicButtonWidget *)_button[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelButton));
|
||||||
_btns[kBtn4Act] = new ButtonWidget(this, "Predictive.Button4", "4 ghi" , 0, kBut4Cmd);
|
} else
|
||||||
_btns[kBtn5Act] = new ButtonWidget(this, "Predictive.Button5", "5 jkl" , 0, kBut5Cmd);
|
#endif
|
||||||
_btns[kBtn6Act] = new ButtonWidget(this, "Predictive.Button6", "6 mno" , 0, kBut6Cmd);
|
_button[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
|
||||||
_btns[kBtn7Act] = new ButtonWidget(this, "Predictive.Button7", "7 pqrs" , 0, kBut7Cmd);
|
// I18N: Pre means 'Predictive', leave '*' as is
|
||||||
_btns[kBtn8Act] = new ButtonWidget(this, "Predictive.Button8", "8 tuv" , 0, kBut8Cmd);
|
_button[kModeAct] = new ButtonWidget(this, "Predictive.Pre", _("* Pre"), 0, kModeCmd);
|
||||||
_btns[kBtn9Act] = new ButtonWidget(this, "Predictive.Button9", "9 wxyz" , 0, kBut9Cmd);
|
_editText = new EditTextWidget(this, "Predictive.Word", _search, 0, 0, 0);
|
||||||
_btns[kBtn0Act] = new ButtonWidget(this, "Predictive.Button0", "0" , 0, kBut0Cmd);
|
|
||||||
// I18N: You must leave "#" as is, only word 'next' is translatable
|
|
||||||
_btns[kNextAct] = new ButtonWidget(this, "Predictive.Next", _("# next") , 0, kNextCmd);
|
|
||||||
_btns[kAddAct] = new ButtonWidget(this, "Predictive.Add", _("add") , 0, kAddCmd);
|
|
||||||
_btns[kAddAct]->setEnabled(false);
|
|
||||||
|
|
||||||
#ifndef DISABLE_FANCY_THEMES
|
|
||||||
_btns[kDelAct] = new PicButtonWidget(this, "Predictive.Delete", _("Delete char"), kDelCmd);
|
|
||||||
((PicButtonWidget *)_btns[kDelAct])->useThemeTransparency(true);
|
|
||||||
((PicButtonWidget *)_btns[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelbtn));
|
|
||||||
#endif
|
|
||||||
_btns[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
|
|
||||||
// I18N: Pre means 'Predictive', leave '*' as is
|
|
||||||
_btns[kModeAct] = new ButtonWidget(this, "Predictive.Pre", _("* Pre"), 0, kModeCmd);
|
|
||||||
_edittext = new EditTextWidget(this, "Predictive.Word", _search, 0, 0, 0);
|
|
||||||
|
|
||||||
_userDictHasChanged = false;
|
_userDictHasChanged = false;
|
||||||
|
|
||||||
_predictiveDict.nameDict = "predictive_dictionary";
|
_predictiveDict.nameDict = "predictive_dictionary";
|
||||||
_predictiveDict.fnameDict = "pred.dic";
|
_predictiveDict.defaultFilename = "pred.dic";
|
||||||
_predictiveDict.dictActLine = NULL;
|
|
||||||
|
|
||||||
_userDict.nameDict = "user_dictionary";
|
_userDict.nameDict = "user_dictionary";
|
||||||
_userDict.fnameDict = "user.dic";
|
_userDict.defaultFilename = "user.dic";
|
||||||
_userDict.dictActLine = NULL;
|
|
||||||
|
|
||||||
_unitedDict.nameDict = "";
|
|
||||||
_unitedDict.fnameDict = "";
|
|
||||||
|
|
||||||
_predictiveDict.dictLine = NULL;
|
|
||||||
_predictiveDict.dictText = NULL;
|
|
||||||
_predictiveDict.dictLineCount = 0;
|
|
||||||
|
|
||||||
if (!_predictiveDict.dictText) {
|
if (!_predictiveDict.dictText) {
|
||||||
loadAllDictionary(_predictiveDict);
|
loadAllDictionary(_predictiveDict);
|
||||||
if (!_predictiveDict.dictText)
|
if (!_predictiveDict.dictText)
|
||||||
debug("Predictive Dialog: pred.dic not loaded");
|
debug(5, "Predictive Dialog: pred.dic not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
_userDict.dictLine = NULL;
|
|
||||||
_userDict.dictText = NULL;
|
|
||||||
_userDict.dictTextSize = 0;
|
|
||||||
_userDict.dictLineCount = 0;
|
|
||||||
|
|
||||||
if (!_userDict.dictText) {
|
if (!_userDict.dictText) {
|
||||||
loadAllDictionary(_userDict);
|
loadAllDictionary(_userDict);
|
||||||
if (!_userDict.dictText)
|
if (!_userDict.dictText)
|
||||||
debug("Predictive Dialog: user.dic not loaded");
|
debug(5, "Predictive Dialog: user.dic not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
mergeDicts();
|
mergeDicts();
|
||||||
|
|
||||||
_unitedDict.dictActLine = NULL;
|
|
||||||
_unitedDict.dictText = NULL;
|
|
||||||
|
|
||||||
memset(_repeatcount, 0, sizeof(_repeatcount));
|
memset(_repeatcount, 0, sizeof(_repeatcount));
|
||||||
|
|
||||||
_prefix.clear();
|
_prefix.clear();
|
||||||
|
@ -146,18 +130,18 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
|
||||||
_numMatchingWords = 0;
|
_numMatchingWords = 0;
|
||||||
memset(_predictiveResult, 0, sizeof(_predictiveResult));
|
memset(_predictiveResult, 0, sizeof(_predictiveResult));
|
||||||
|
|
||||||
_lastbutton = kNoAct;
|
_lastButton = kNoAct;
|
||||||
_mode = kModePre;
|
_mode = kModePre;
|
||||||
|
|
||||||
_lastTime = 0;
|
_lastTime = 0;
|
||||||
_curTime = 0;
|
_curTime = 0;
|
||||||
_lastPressBtn = kNoAct;
|
_lastPressedButton = kNoAct;
|
||||||
|
|
||||||
_memoryList[0] = _predictiveDict.dictText;
|
_memoryList[0] = _predictiveDict.dictText;
|
||||||
_memoryList[1] = _userDict.dictText;
|
_memoryList[1] = _userDict.dictText;
|
||||||
_numMemory = 0;
|
_numMemory = 0;
|
||||||
|
|
||||||
_navigationwithkeys = false;
|
_navigationWithKeys = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PredictiveDialog::~PredictiveDialog() {
|
PredictiveDialog::~PredictiveDialog() {
|
||||||
|
@ -167,8 +151,25 @@ PredictiveDialog::~PredictiveDialog() {
|
||||||
free(_userDict.dictLine);
|
free(_userDict.dictLine);
|
||||||
free(_predictiveDict.dictLine);
|
free(_predictiveDict.dictLine);
|
||||||
free(_unitedDict.dictLine);
|
free(_unitedDict.dictLine);
|
||||||
|
}
|
||||||
|
|
||||||
free(_btns);
|
void PredictiveDialog::reflowLayout() {
|
||||||
|
#ifndef DISABLE_FANCY_THEMES
|
||||||
|
removeWidget(_button[kDelAct]);
|
||||||
|
_button[kDelAct]->setNext(0);
|
||||||
|
delete _button[kDelAct];
|
||||||
|
_button[kDelAct] = nullptr;
|
||||||
|
|
||||||
|
if (g_gui.xmlEval()->getVar("Globals.Predictive.ShowDeletePic") == 1 && g_gui.theme()->supportsImages()) {
|
||||||
|
_button[kDelAct] = new PicButtonWidget(this, "Predictive.Delete", _("Delete char"), kDelCmd);
|
||||||
|
((PicButtonWidget *)_button[kDelAct])->useThemeTransparency(true);
|
||||||
|
((PicButtonWidget *)_button[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelButton));
|
||||||
|
} else {
|
||||||
|
_button[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Dialog::reflowLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::saveUserDictToFile() {
|
void PredictiveDialog::saveUserDictToFile() {
|
||||||
|
@ -188,22 +189,22 @@ void PredictiveDialog::saveUserDictToFile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::handleKeyUp(Common::KeyState state) {
|
void PredictiveDialog::handleKeyUp(Common::KeyState state) {
|
||||||
if (_currBtn != kNoAct && !_needRefresh) {
|
if (_curPressedButton != kNoAct && !_needRefresh) {
|
||||||
_btns[_currBtn]->startAnimatePressedState();
|
_button[_curPressedButton]->startAnimatePressedState();
|
||||||
processBtnActive(_currBtn);
|
processButton(_curPressedButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::handleKeyDown(Common::KeyState state) {
|
void PredictiveDialog::handleKeyDown(Common::KeyState state) {
|
||||||
_currBtn = kNoAct;
|
_curPressedButton = kNoAct;
|
||||||
_needRefresh = false;
|
_needRefresh = false;
|
||||||
|
|
||||||
if (getFocusWidget() == _edittext) {
|
if (getFocusWidget() == _editText) {
|
||||||
setFocusWidget(_btns[kAddAct]);
|
setFocusWidget(_button[kAddAct]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lastbutton == kNoAct) {
|
if (_lastButton == kNoAct) {
|
||||||
_lastbutton = kBtn5Act;
|
_lastButton = kButton5Act;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (state.keycode) {
|
switch (state.keycode) {
|
||||||
|
@ -212,128 +213,128 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
case Common::KEYCODE_LEFT:
|
case Common::KEYCODE_LEFT:
|
||||||
_navigationwithkeys = true;
|
_navigationWithKeys = true;
|
||||||
if (_lastbutton == kBtn1Act || _lastbutton == kBtn4Act || _lastbutton == kBtn7Act)
|
if (_lastButton == kButton1Act || _lastButton == kButton4Act || _lastButton == kButton7Act)
|
||||||
_currBtn = ButtonId(_lastbutton + 2);
|
_curPressedButton = ButtonId(_lastButton + 2);
|
||||||
else if (_lastbutton == kDelAct)
|
else if (_lastButton == kDelAct)
|
||||||
_currBtn = kBtn1Act;
|
_curPressedButton = kButton1Act;
|
||||||
else if (_lastbutton == kModeAct)
|
else if (_lastButton == kModeAct)
|
||||||
_currBtn = kNextAct;
|
_curPressedButton = kNextAct;
|
||||||
else if (_lastbutton == kNextAct)
|
else if (_lastButton == kNextAct)
|
||||||
_currBtn = kBtn0Act;
|
_curPressedButton = kButton0Act;
|
||||||
else if (_lastbutton == kAddAct)
|
else if (_lastButton == kAddAct)
|
||||||
_currBtn = kOkAct;
|
_curPressedButton = kOkAct;
|
||||||
else if (_lastbutton == kCancelAct)
|
else if (_lastButton == kCancelAct)
|
||||||
_currBtn = kAddAct;
|
_curPressedButton = kAddAct;
|
||||||
else
|
else
|
||||||
_currBtn = ButtonId(_lastbutton - 1);
|
_curPressedButton = ButtonId(_lastButton - 1);
|
||||||
|
|
||||||
|
|
||||||
if (_mode != kModeAbc && _lastbutton == kCancelAct)
|
if (_mode != kModeAbc && _lastButton == kCancelAct)
|
||||||
_currBtn = kOkAct;
|
_curPressedButton = kOkAct;
|
||||||
|
|
||||||
_needRefresh = true;
|
_needRefresh = true;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_RIGHT:
|
case Common::KEYCODE_RIGHT:
|
||||||
_navigationwithkeys = true;
|
_navigationWithKeys = true;
|
||||||
if (_lastbutton == kBtn3Act || _lastbutton == kBtn6Act || _lastbutton == kBtn9Act || _lastbutton == kOkAct)
|
if (_lastButton == kButton3Act || _lastButton == kButton6Act || _lastButton == kButton9Act || _lastButton == kOkAct)
|
||||||
_currBtn = ButtonId(_lastbutton - 2);
|
_curPressedButton = ButtonId(_lastButton - 2);
|
||||||
else if (_lastbutton == kDelAct)
|
else if (_lastButton == kDelAct)
|
||||||
_currBtn = kBtn3Act;
|
_curPressedButton = kButton3Act;
|
||||||
else if (_lastbutton == kBtn0Act)
|
else if (_lastButton == kButton0Act)
|
||||||
_currBtn = kNextAct;
|
_curPressedButton = kNextAct;
|
||||||
else if (_lastbutton == kNextAct)
|
else if (_lastButton == kNextAct)
|
||||||
_currBtn = kModeAct;
|
_curPressedButton = kModeAct;
|
||||||
else if (_lastbutton == kAddAct)
|
else if (_lastButton == kAddAct)
|
||||||
_currBtn = kCancelAct;
|
_curPressedButton = kCancelAct;
|
||||||
else if (_lastbutton == kOkAct)
|
else if (_lastButton == kOkAct)
|
||||||
_currBtn = kAddAct;
|
_curPressedButton = kAddAct;
|
||||||
else
|
else
|
||||||
_currBtn = ButtonId(_lastbutton + 1);
|
_curPressedButton = ButtonId(_lastButton + 1);
|
||||||
|
|
||||||
if (_mode != kModeAbc && _lastbutton == kOkAct)
|
if (_mode != kModeAbc && _lastButton == kOkAct)
|
||||||
_currBtn = kCancelAct;
|
_curPressedButton = kCancelAct;
|
||||||
_needRefresh = true;
|
_needRefresh = true;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_UP:
|
case Common::KEYCODE_UP:
|
||||||
_navigationwithkeys = true;
|
_navigationWithKeys = true;
|
||||||
if (_lastbutton <= kBtn3Act)
|
if (_lastButton <= kButton3Act)
|
||||||
_currBtn = kDelAct;
|
_curPressedButton = kDelAct;
|
||||||
else if (_lastbutton == kDelAct)
|
else if (_lastButton == kDelAct)
|
||||||
_currBtn = kOkAct;
|
_curPressedButton = kOkAct;
|
||||||
else if (_lastbutton == kModeAct)
|
else if (_lastButton == kModeAct)
|
||||||
_currBtn = kBtn7Act;
|
_curPressedButton = kButton7Act;
|
||||||
else if (_lastbutton == kBtn0Act)
|
else if (_lastButton == kButton0Act)
|
||||||
_currBtn = kBtn8Act;
|
_curPressedButton = kButton8Act;
|
||||||
else if (_lastbutton == kNextAct)
|
else if (_lastButton == kNextAct)
|
||||||
_currBtn = kBtn9Act;
|
_curPressedButton = kButton9Act;
|
||||||
else if (_lastbutton == kAddAct)
|
else if (_lastButton == kAddAct)
|
||||||
_currBtn = kModeAct;
|
_curPressedButton = kModeAct;
|
||||||
else if (_lastbutton == kCancelAct)
|
else if (_lastButton == kCancelAct)
|
||||||
_currBtn = kBtn0Act;
|
_curPressedButton = kButton0Act;
|
||||||
else if (_lastbutton == kOkAct)
|
else if (_lastButton == kOkAct)
|
||||||
_currBtn = kNextAct;
|
_curPressedButton = kNextAct;
|
||||||
else
|
else
|
||||||
_currBtn = ButtonId(_lastbutton - 3);
|
_curPressedButton = ButtonId(_lastButton - 3);
|
||||||
_needRefresh = true;
|
_needRefresh = true;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_DOWN:
|
case Common::KEYCODE_DOWN:
|
||||||
_navigationwithkeys = true;
|
_navigationWithKeys = true;
|
||||||
if (_lastbutton == kDelAct)
|
if (_lastButton == kDelAct)
|
||||||
_currBtn = kBtn3Act;
|
_curPressedButton = kButton3Act;
|
||||||
else if (_lastbutton == kBtn7Act)
|
else if (_lastButton == kButton7Act)
|
||||||
_currBtn = kModeAct;
|
_curPressedButton = kModeAct;
|
||||||
else if (_lastbutton == kBtn8Act)
|
else if (_lastButton == kButton8Act)
|
||||||
_currBtn = kBtn0Act;
|
_curPressedButton = kButton0Act;
|
||||||
else if (_lastbutton == kBtn9Act)
|
else if (_lastButton == kButton9Act)
|
||||||
_currBtn = kNextAct;
|
_curPressedButton = kNextAct;
|
||||||
else if (_lastbutton == kModeAct)
|
else if (_lastButton == kModeAct)
|
||||||
_currBtn = kAddAct;
|
_curPressedButton = kAddAct;
|
||||||
else if (_lastbutton == kBtn0Act)
|
else if (_lastButton == kButton0Act)
|
||||||
_currBtn = kCancelAct;
|
_curPressedButton = kCancelAct;
|
||||||
else if (_lastbutton == kNextAct)
|
else if (_lastButton == kNextAct)
|
||||||
_currBtn = kOkAct;
|
_curPressedButton = kOkAct;
|
||||||
else if (_lastbutton == kAddAct || _lastbutton == kCancelAct || _lastbutton == kOkAct)
|
else if (_lastButton == kAddAct || _lastButton == kCancelAct || _lastButton == kOkAct)
|
||||||
_currBtn = kDelAct;
|
_curPressedButton = kDelAct;
|
||||||
else
|
else
|
||||||
_currBtn = ButtonId(_lastbutton + 3);
|
_curPressedButton = ButtonId(_lastButton + 3);
|
||||||
|
|
||||||
if (_mode != kModeAbc && _lastbutton == kModeAct)
|
if (_mode != kModeAbc && _lastButton == kModeAct)
|
||||||
_currBtn = kCancelAct;
|
_curPressedButton = kCancelAct;
|
||||||
|
|
||||||
_needRefresh = true;
|
_needRefresh = true;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_KP_ENTER:
|
case Common::KEYCODE_KP_ENTER:
|
||||||
case Common::KEYCODE_RETURN:
|
case Common::KEYCODE_RETURN:
|
||||||
if (state.flags & Common::KBD_CTRL) {
|
if (state.flags & Common::KBD_CTRL) {
|
||||||
_currBtn = kOkAct;
|
_curPressedButton = kOkAct;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (_navigationwithkeys) {
|
if (_navigationWithKeys) {
|
||||||
// when the user has utilized arrow key navigation,
|
// when the user has utilized arrow key navigation,
|
||||||
// interpret enter as 'click' on the _currBtn button
|
// interpret enter as 'click' on the _curPressedButton button
|
||||||
_currBtn = _lastbutton;
|
_curPressedButton = _lastButton;
|
||||||
_needRefresh = false;
|
_needRefresh = false;
|
||||||
} else {
|
} else {
|
||||||
// else it is a shortcut for 'Ok'
|
// else it is a shortcut for 'Ok'
|
||||||
_currBtn = kOkAct;
|
_curPressedButton = kOkAct;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_KP_PLUS:
|
case Common::KEYCODE_KP_PLUS:
|
||||||
_currBtn = kAddAct;
|
_curPressedButton = kAddAct;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_BACKSPACE:
|
case Common::KEYCODE_BACKSPACE:
|
||||||
case Common::KEYCODE_KP_MINUS:
|
case Common::KEYCODE_KP_MINUS:
|
||||||
_currBtn = kDelAct;
|
_curPressedButton = kDelAct;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_KP_DIVIDE:
|
case Common::KEYCODE_KP_DIVIDE:
|
||||||
_currBtn = kNextAct;
|
_curPressedButton = kNextAct;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_KP_MULTIPLY:
|
case Common::KEYCODE_KP_MULTIPLY:
|
||||||
_currBtn = kModeAct;
|
_curPressedButton = kModeAct;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_KP0:
|
case Common::KEYCODE_KP0:
|
||||||
_currBtn = kBtn0Act;
|
_curPressedButton = kButton0Act;
|
||||||
break;
|
break;
|
||||||
case Common::KEYCODE_KP1:
|
case Common::KEYCODE_KP1:
|
||||||
case Common::KEYCODE_KP2:
|
case Common::KEYCODE_KP2:
|
||||||
|
@ -344,79 +345,79 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) {
|
||||||
case Common::KEYCODE_KP7:
|
case Common::KEYCODE_KP7:
|
||||||
case Common::KEYCODE_KP8:
|
case Common::KEYCODE_KP8:
|
||||||
case Common::KEYCODE_KP9:
|
case Common::KEYCODE_KP9:
|
||||||
_currBtn = ButtonId(state.keycode - Common::KEYCODE_KP1);
|
_curPressedButton = ButtonId(state.keycode - Common::KEYCODE_KP1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Dialog::handleKeyDown(state);
|
Dialog::handleKeyDown(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lastbutton != _currBtn)
|
if (_lastButton != _curPressedButton)
|
||||||
_btns[_lastbutton]->stopAnimatePressedState();
|
_button[_lastButton]->stopAnimatePressedState();
|
||||||
|
|
||||||
if (_currBtn != kNoAct && !_needRefresh)
|
if (_curPressedButton != kNoAct && !_needRefresh)
|
||||||
_btns[_currBtn]->setPressedState();
|
_button[_curPressedButton]->setPressedState();
|
||||||
else
|
else
|
||||||
updateHighLightedButton(_currBtn);
|
updateHighLightedButton(_curPressedButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::updateHighLightedButton(ButtonId act) {
|
void PredictiveDialog::updateHighLightedButton(ButtonId act) {
|
||||||
if (_currBtn != kNoAct) {
|
if (_curPressedButton != kNoAct) {
|
||||||
_btns[_lastbutton]->setHighLighted(false);
|
_button[_lastButton]->setHighLighted(false);
|
||||||
_lastbutton = act;
|
_lastButton = act;
|
||||||
_btns[_lastbutton]->setHighLighted(true);
|
_button[_lastButton]->setHighLighted(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
void PredictiveDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
||||||
_currBtn = kNoAct;
|
_curPressedButton = kNoAct;
|
||||||
|
|
||||||
_navigationwithkeys = false;
|
_navigationWithKeys = false;
|
||||||
|
|
||||||
if (_lastbutton != kNoAct)
|
if (_lastButton != kNoAct)
|
||||||
_btns[_lastbutton]->setHighLighted(false);
|
_button[_lastButton]->setHighLighted(false);
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case kDelCmd:
|
case kDelCmd:
|
||||||
_currBtn = kDelAct;
|
_curPressedButton = kDelAct;
|
||||||
break;
|
break;
|
||||||
case kNextCmd:
|
case kNextCmd:
|
||||||
_currBtn = kNextAct;
|
_curPressedButton = kNextAct;
|
||||||
break;
|
break;
|
||||||
case kAddCmd:
|
case kAddCmd:
|
||||||
_currBtn = kAddAct;
|
_curPressedButton = kAddAct;
|
||||||
break;
|
break;
|
||||||
case kModeCmd:
|
case kModeCmd:
|
||||||
_currBtn = kModeAct;
|
_curPressedButton = kModeAct;
|
||||||
break;
|
break;
|
||||||
case kBut1Cmd:
|
case kBut1Cmd:
|
||||||
_currBtn = kBtn1Act;
|
_curPressedButton = kButton1Act;
|
||||||
break;
|
break;
|
||||||
case kBut2Cmd:
|
case kBut2Cmd:
|
||||||
_currBtn = kBtn2Act;
|
_curPressedButton = kButton2Act;
|
||||||
break;
|
break;
|
||||||
case kBut3Cmd:
|
case kBut3Cmd:
|
||||||
_currBtn = kBtn3Act;
|
_curPressedButton = kButton3Act;
|
||||||
break;
|
break;
|
||||||
case kBut4Cmd:
|
case kBut4Cmd:
|
||||||
_currBtn = kBtn4Act;
|
_curPressedButton = kButton4Act;
|
||||||
break;
|
break;
|
||||||
case kBut5Cmd:
|
case kBut5Cmd:
|
||||||
_currBtn = kBtn5Act;
|
_curPressedButton = kButton5Act;
|
||||||
break;
|
break;
|
||||||
case kBut6Cmd:
|
case kBut6Cmd:
|
||||||
_currBtn = kBtn6Act;
|
_curPressedButton = kButton6Act;
|
||||||
break;
|
break;
|
||||||
case kBut7Cmd:
|
case kBut7Cmd:
|
||||||
_currBtn = kBtn7Act;
|
_curPressedButton = kButton7Act;
|
||||||
break;
|
break;
|
||||||
case kBut8Cmd:
|
case kBut8Cmd:
|
||||||
_currBtn = kBtn8Act;
|
_curPressedButton = kButton8Act;
|
||||||
break;
|
break;
|
||||||
case kBut9Cmd:
|
case kBut9Cmd:
|
||||||
_currBtn = kBtn9Act;
|
_curPressedButton = kButton9Act;
|
||||||
break;
|
break;
|
||||||
case kBut0Cmd:
|
case kBut0Cmd:
|
||||||
_currBtn = kBtn0Act;
|
_curPressedButton = kButton0Act;
|
||||||
break;
|
break;
|
||||||
case kCancelCmd:
|
case kCancelCmd:
|
||||||
saveUserDictToFile();
|
saveUserDictToFile();
|
||||||
|
@ -426,19 +427,18 @@ void PredictiveDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 d
|
||||||
_predictiveResult[0] = 0;
|
_predictiveResult[0] = 0;
|
||||||
return;
|
return;
|
||||||
case kOkCmd:
|
case kOkCmd:
|
||||||
_currBtn = kOkAct;
|
_curPressedButton = kOkAct;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Dialog::handleCommand(sender, cmd, data);
|
Dialog::handleCommand(sender, cmd, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_currBtn != kNoAct) {
|
if (_curPressedButton != kNoAct) {
|
||||||
processBtnActive(_currBtn);
|
processButton(_curPressedButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::processBtnActive(ButtonId button) {
|
void PredictiveDialog::processButton(ButtonId button) {
|
||||||
uint8 x;
|
|
||||||
static const char *const buttonStr[] = {
|
static const char *const buttonStr[] = {
|
||||||
"1", "2", "3",
|
"1", "2", "3",
|
||||||
"4", "5", "6",
|
"4", "5", "6",
|
||||||
|
@ -457,10 +457,10 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_mode == kModeAbc) {
|
if (_mode == kModeAbc) {
|
||||||
if (button >= kBtn1Act && button <= kBtn9Act) {
|
if (button >= kButton1Act && button <= kButton9Act) {
|
||||||
if (!_lastTime)
|
if (!_lastTime)
|
||||||
_lastTime = g_system->getMillis();
|
_lastTime = g_system->getMillis();
|
||||||
if (_lastPressBtn == button) {
|
if (_lastPressedButton == button) {
|
||||||
_curTime = g_system->getMillis();
|
_curTime = g_system->getMillis();
|
||||||
if ((_curTime - _lastTime) < kRepeatDelay) {
|
if ((_curTime - _lastTime) < kRepeatDelay) {
|
||||||
button = kNextAct;
|
button = kNextAct;
|
||||||
|
@ -469,15 +469,15 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
_lastTime = 0;
|
_lastTime = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_lastPressBtn = button;
|
_lastPressedButton = button;
|
||||||
_lastTime = g_system->getMillis();
|
_lastTime = g_system->getMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button >= kBtn1Act) {
|
if (button >= kButton1Act) {
|
||||||
_lastbutton = button;
|
_lastButton = button;
|
||||||
if (button == kBtn0Act && _mode != kModeNum) { // Space
|
if (button == kButton0Act && _mode != kModeNum) { // Space
|
||||||
// bring MRU word at the top of the list when changing words
|
// bring MRU word at the top of the list when changing words
|
||||||
if (_mode == kModePre && _unitedDict.dictActLine && _numMatchingWords > 1 && _wordNumber != 0)
|
if (_mode == kModePre && _unitedDict.dictActLine && _numMatchingWords > 1 && _wordNumber != 0)
|
||||||
bringWordtoTop(_unitedDict.dictActLine, _wordNumber);
|
bringWordtoTop(_unitedDict.dictActLine, _wordNumber);
|
||||||
|
@ -491,9 +491,9 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
_numMatchingWords = 0;
|
_numMatchingWords = 0;
|
||||||
memset(_repeatcount, 0, sizeof(_repeatcount));
|
memset(_repeatcount, 0, sizeof(_repeatcount));
|
||||||
_lastTime = 0;
|
_lastTime = 0;
|
||||||
_lastPressBtn = kNoAct;
|
_lastPressedButton = kNoAct;
|
||||||
_curTime = 0;
|
_curTime = 0;
|
||||||
} else if (button < kNextAct || button == kDelAct || button == kBtn0Act) { // number or backspace
|
} else if (button < kNextAct || button == kDelAct || button == kButton0Act) { // number or backspace
|
||||||
if (button == kDelAct) { // backspace
|
if (button == kDelAct) { // backspace
|
||||||
if (_currentCode.size()) {
|
if (_currentCode.size()) {
|
||||||
_repeatcount[_currentCode.size() - 1] = 0;
|
_repeatcount[_currentCode.size() - 1] = 0;
|
||||||
|
@ -505,7 +505,7 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
_prefix.deleteLastChar();
|
_prefix.deleteLastChar();
|
||||||
}
|
}
|
||||||
} else if (_prefix.size() + _currentCode.size() < kMaxWordLen - 1) { // don't overflow the dialog line
|
} else if (_prefix.size() + _currentCode.size() < kMaxWordLen - 1) { // don't overflow the dialog line
|
||||||
if (button == kBtn0Act) { // zero
|
if (button == kButton0Act) { // zero
|
||||||
_currentCode += buttonStr[9];
|
_currentCode += buttonStr[9];
|
||||||
} else {
|
} else {
|
||||||
_currentCode += buttonStr[button];
|
_currentCode += buttonStr[button];
|
||||||
|
@ -524,7 +524,7 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
_numMatchingWords = countWordsInString(_unitedDict.dictActLine);
|
_numMatchingWords = countWordsInString(_unitedDict.dictActLine);
|
||||||
break;
|
break;
|
||||||
case kModeAbc:
|
case kModeAbc:
|
||||||
for (x = 0; x < _currentCode.size(); x++)
|
for (uint x = 0; x < _currentCode.size(); x++)
|
||||||
if (_currentCode[x] >= '1')
|
if (_currentCode[x] >= '1')
|
||||||
_temp[x] = buttons[_currentCode[x] - '1'][_repeatcount[x]];
|
_temp[x] = buttons[_currentCode[x] - '1'][_repeatcount[x]];
|
||||||
_temp[_currentCode.size()] = 0;
|
_temp[_currentCode.size()] = 0;
|
||||||
|
@ -543,7 +543,7 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
_currentWord = Common::String(tok, _currentCode.size());
|
_currentWord = Common::String(tok, _currentCode.size());
|
||||||
}
|
}
|
||||||
} else if (_mode == kModeAbc) {
|
} else if (_mode == kModeAbc) {
|
||||||
x = _currentCode.size();
|
uint x = _currentCode.size();
|
||||||
if (x) {
|
if (x) {
|
||||||
if (_currentCode.lastChar() == '1' || _currentCode.lastChar() == '7' || _currentCode.lastChar() == '9')
|
if (_currentCode.lastChar() == '1' || _currentCode.lastChar() == '7' || _currentCode.lastChar() == '9')
|
||||||
_repeatcount[x - 1] = (_repeatcount[x - 1] + 1) % 4;
|
_repeatcount[x - 1] = (_repeatcount[x - 1] + 1) % 4;
|
||||||
|
@ -558,25 +558,25 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
if (_mode == kModeAbc)
|
if (_mode == kModeAbc)
|
||||||
addWordToDict();
|
addWordToDict();
|
||||||
else
|
else
|
||||||
debug("Predictive Dialog: button Add doesn't work in this mode");
|
debug(5, "Predictive Dialog: button Add doesn't work in this mode");
|
||||||
} else if (button == kOkAct) { // Ok
|
} else if (button == kOkAct) { // Ok
|
||||||
// bring MRU word at the top of the list when ok'ed out of the dialog
|
// bring MRU word at the top of the list when ok'ed out of the dialog
|
||||||
if (_mode == kModePre && _unitedDict.dictActLine && _numMatchingWords > 1 && _wordNumber != 0)
|
if (_mode == kModePre && _unitedDict.dictActLine && _numMatchingWords > 1 && _wordNumber != 0)
|
||||||
bringWordtoTop(_unitedDict.dictActLine, _wordNumber);
|
bringWordtoTop(_unitedDict.dictActLine, _wordNumber);
|
||||||
} else if (button == kModeAct) { // Mode
|
} else if (button == kModeAct) { // Mode
|
||||||
_mode++;
|
_mode++;
|
||||||
_btns[kAddAct]->setEnabled(false);
|
_button[kAddAct]->setEnabled(false);
|
||||||
if (_mode > kModeAbc) {
|
if (_mode > kModeAbc) {
|
||||||
_mode = kModePre;
|
_mode = kModePre;
|
||||||
// I18N: Pre means 'Predictive', leave '*' as is
|
// I18N: Pre means 'Predictive', leave '*' as is
|
||||||
_btns[kModeAct]->setLabel("* Pre");
|
_button[kModeAct]->setLabel(_("* Pre"));
|
||||||
} else if (_mode == kModeNum) {
|
} else if (_mode == kModeNum) {
|
||||||
// I18N: 'Num' means Numbers
|
// I18N: 'Num' means Numbers
|
||||||
_btns[kModeAct]->setLabel("* Num");
|
_button[kModeAct]->setLabel(_("* Num"));
|
||||||
} else {
|
} else {
|
||||||
// I18N: 'Abc' means Latin alphabet input
|
// I18N: 'Abc' means Latin alphabet input
|
||||||
_btns[kModeAct]->setLabel("* Abc");
|
_button[kModeAct]->setLabel(_("* Abc"));
|
||||||
_btns[kAddAct]->setEnabled(true);
|
_button[kAddAct]->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// truncate current input at mode change
|
// truncate current input at mode change
|
||||||
|
@ -588,7 +588,7 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
memset(_repeatcount, 0, sizeof(_repeatcount));
|
memset(_repeatcount, 0, sizeof(_repeatcount));
|
||||||
|
|
||||||
_lastTime = 0;
|
_lastTime = 0;
|
||||||
_lastPressBtn = kNoAct;
|
_lastPressedButton = kNoAct;
|
||||||
_curTime = 0;
|
_curTime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -598,10 +598,10 @@ void PredictiveDialog::processBtnActive(ButtonId button) {
|
||||||
if (button == kOkAct)
|
if (button == kOkAct)
|
||||||
close();
|
close();
|
||||||
|
|
||||||
if (button == kCancelAct) {
|
if (button == kCancelAct) {
|
||||||
saveUserDictToFile();
|
saveUserDictToFile();
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::handleTickle() {
|
void PredictiveDialog::handleTickle() {
|
||||||
|
@ -621,7 +621,7 @@ void PredictiveDialog::mergeDicts() {
|
||||||
_unitedDict.dictLine = (char **)calloc(_unitedDict.dictLineCount, sizeof(char *));
|
_unitedDict.dictLine = (char **)calloc(_unitedDict.dictLineCount, sizeof(char *));
|
||||||
|
|
||||||
if (!_unitedDict.dictLine) {
|
if (!_unitedDict.dictLine) {
|
||||||
debug("Predictive Dialog: cannot allocate memory for united dic");
|
debug(5, "Predictive Dialog: cannot allocate memory for united dic");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -658,7 +658,7 @@ uint8 PredictiveDialog::countWordsInString(const char *const str) {
|
||||||
|
|
||||||
ptr = strchr(str, ' ');
|
ptr = strchr(str, ' ');
|
||||||
if (!ptr) {
|
if (!ptr) {
|
||||||
debug("Predictive Dialog: Invalid dictionary line");
|
debug(5, "Predictive Dialog: Invalid dictionary line");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ void PredictiveDialog::bringWordtoTop(char *str, int wordnum) {
|
||||||
buf[kMaxLineLen - 1] = 0;
|
buf[kMaxLineLen - 1] = 0;
|
||||||
char *word = strtok(buf, " ");
|
char *word = strtok(buf, " ");
|
||||||
if (!word) {
|
if (!word) {
|
||||||
debug("Predictive Dialog: Invalid dictionary line");
|
debug(5, "Predictive Dialog: Invalid dictionary line");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ bool PredictiveDialog::matchWord() {
|
||||||
|
|
||||||
// The entries in the dictionary consist of a code, a space, and then
|
// The entries in the dictionary consist of a code, a space, and then
|
||||||
// a space-separated list of words matching this code.
|
// a space-separated list of words matching this code.
|
||||||
// To ex_currBtnly match a code, we therefore match the code plus the trailing
|
// To exactly match a code, we therefore match the code plus the trailing
|
||||||
// space in the dictionary.
|
// space in the dictionary.
|
||||||
Common::String code = _currentCode + " ";
|
Common::String code = _currentCode + " ";
|
||||||
|
|
||||||
|
@ -929,7 +929,7 @@ void PredictiveDialog::loadDictionary(Common::SeekableReadStream *in, Dict &dict
|
||||||
in->read(dict.dictText, dict.dictTextSize);
|
in->read(dict.dictText, dict.dictTextSize);
|
||||||
dict.dictText[dict.dictTextSize] = 0;
|
dict.dictText[dict.dictTextSize] = 0;
|
||||||
uint32 time2 = g_system->getMillis();
|
uint32 time2 = g_system->getMillis();
|
||||||
debug("Predictive Dialog: Time to read %s: %d bytes, %d ms", ConfMan.get(dict.nameDict).c_str(), dict.dictTextSize, time2 - time1);
|
debug(5, "Predictive Dialog: Time to read %s: %d bytes, %d ms", ConfMan.get(dict.nameDict).c_str(), dict.dictTextSize, time2 - time1);
|
||||||
delete in;
|
delete in;
|
||||||
|
|
||||||
char *ptr = dict.dictText;
|
char *ptr = dict.dictText;
|
||||||
|
@ -960,7 +960,7 @@ void PredictiveDialog::loadDictionary(Common::SeekableReadStream *in, Dict &dict
|
||||||
lines--;
|
lines--;
|
||||||
|
|
||||||
dict.dictLineCount = lines;
|
dict.dictLineCount = lines;
|
||||||
debug("Predictive Dialog: Loaded %d lines", dict.dictLineCount);
|
debug(5, "Predictive Dialog: Loaded %d lines", dict.dictLineCount);
|
||||||
|
|
||||||
// FIXME: We use binary search on _predictiveDict.dictLine, yet we make no at_tempt
|
// FIXME: We use binary search on _predictiveDict.dictLine, yet we make no at_tempt
|
||||||
// to ever sort this array (except for the DS port). That seems risky, doesn't it?
|
// to ever sort this array (except for the DS port). That seems risky, doesn't it?
|
||||||
|
@ -971,23 +971,23 @@ void PredictiveDialog::loadDictionary(Common::SeekableReadStream *in, Dict &dict
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32 time3 = g_system->getMillis();
|
uint32 time3 = g_system->getMillis();
|
||||||
debug("Predictive Dialog: Time to parse %s: %d, total: %d", ConfMan.get(dict.nameDict).c_str(), time3 - time2, time3 - time1);
|
debug(5, "Predictive Dialog: Time to parse %s: %d, total: %d", ConfMan.get(dict.nameDict).c_str(), time3 - time2, time3 - time1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PredictiveDialog::loadAllDictionary(Dict &dict) {
|
void PredictiveDialog::loadAllDictionary(Dict &dict) {
|
||||||
ConfMan.registerDefault(dict.nameDict, dict.fnameDict);
|
ConfMan.registerDefault(dict.nameDict, dict.defaultFilename);
|
||||||
|
|
||||||
if (dict.nameDict == "predictive_dictionary") {
|
if (dict.nameDict == "predictive_dictionary") {
|
||||||
Common::File *inFile = new Common::File();
|
Common::File *inFile = new Common::File();
|
||||||
if (!inFile->open(ConfMan.get(dict.nameDict))) {
|
if (!inFile->open(ConfMan.get(dict.nameDict))) {
|
||||||
warning("Predictive Dialog: cannot read file: %s", dict.fnameDict.c_str());
|
warning("Predictive Dialog: cannot read file: %s", dict.defaultFilename.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loadDictionary(inFile, dict);
|
loadDictionary(inFile, dict);
|
||||||
} else {
|
} else {
|
||||||
Common::InSaveFile *inFile = g_system->getSavefileManager()->openForLoading(ConfMan.get(dict.nameDict));
|
Common::InSaveFile *inFile = g_system->getSavefileManager()->openForLoading(ConfMan.get(dict.nameDict));
|
||||||
if (!inFile) {
|
if (!inFile) {
|
||||||
warning("Predictive Dialog: cannot read file: %s", dict.fnameDict.c_str());
|
warning("Predictive Dialog: cannot read file: %s", dict.defaultFilename.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loadDictionary(inFile, dict);
|
loadDictionary(inFile, dict);
|
||||||
|
@ -997,9 +997,9 @@ void PredictiveDialog::loadAllDictionary(Dict &dict) {
|
||||||
void PredictiveDialog::pressEditText() {
|
void PredictiveDialog::pressEditText() {
|
||||||
Common::strlcpy(_predictiveResult, _prefix.c_str(), sizeof(_predictiveResult));
|
Common::strlcpy(_predictiveResult, _prefix.c_str(), sizeof(_predictiveResult));
|
||||||
Common::strlcat(_predictiveResult, _currentWord.c_str(), sizeof(_predictiveResult));
|
Common::strlcat(_predictiveResult, _currentWord.c_str(), sizeof(_predictiveResult));
|
||||||
_edittext->setEditString(_predictiveResult);
|
_editText->setEditString(_predictiveResult);
|
||||||
//_edittext->setCaretPos(_prefix.size() + _currentWord.size());
|
//_editText->setCaretPos(_prefix.size() + _currentWord.size());
|
||||||
_edittext->draw();
|
_editText->draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
|
|
|
@ -33,56 +33,65 @@ class EditTextWidget;
|
||||||
class ButtonWidget;
|
class ButtonWidget;
|
||||||
class PicButtonWidget;
|
class PicButtonWidget;
|
||||||
|
|
||||||
enum ButtonId {
|
|
||||||
kBtn1Act = 0,
|
|
||||||
kBtn2Act = 1,
|
|
||||||
kBtn3Act = 2,
|
|
||||||
kBtn4Act = 3,
|
|
||||||
kBtn5Act = 4,
|
|
||||||
kBtn6Act = 5,
|
|
||||||
kBtn7Act = 6,
|
|
||||||
kBtn8Act = 7,
|
|
||||||
kBtn9Act = 8,
|
|
||||||
kNextAct = 9,
|
|
||||||
kAddAct = 10,
|
|
||||||
kDelAct = 11,
|
|
||||||
kCancelAct = 12,
|
|
||||||
kOkAct = 13,
|
|
||||||
kModeAct = 14,
|
|
||||||
kBtn0Act = 15,
|
|
||||||
kNoAct = -1
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
kRepeatDelay = 500
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
kMaxLineLen = 80,
|
|
||||||
kMaxWordLen = 24,
|
|
||||||
kMaxWord = 50
|
|
||||||
};
|
|
||||||
|
|
||||||
class PredictiveDialog : public GUI::Dialog {
|
class PredictiveDialog : public GUI::Dialog {
|
||||||
public:
|
public:
|
||||||
PredictiveDialog();
|
PredictiveDialog();
|
||||||
~PredictiveDialog();
|
~PredictiveDialog();
|
||||||
|
|
||||||
|
virtual void reflowLayout();
|
||||||
|
|
||||||
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
virtual void handleKeyUp(Common::KeyState state);
|
virtual void handleKeyUp(Common::KeyState state);
|
||||||
virtual void handleKeyDown(Common::KeyState state);
|
virtual void handleKeyDown(Common::KeyState state);
|
||||||
virtual void handleTickle();
|
virtual void handleTickle();
|
||||||
|
|
||||||
const char *getResult() const { return _predictiveResult; }
|
const char *getResult() const { return _predictiveResult; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
enum ButtonId {
|
||||||
|
kButton1Act = 0,
|
||||||
|
kButton2Act = 1,
|
||||||
|
kButton3Act = 2,
|
||||||
|
kButton4Act = 3,
|
||||||
|
kButton5Act = 4,
|
||||||
|
kButton6Act = 5,
|
||||||
|
kButton7Act = 6,
|
||||||
|
kButton8Act = 7,
|
||||||
|
kButton9Act = 8,
|
||||||
|
kNextAct = 9,
|
||||||
|
kAddAct = 10,
|
||||||
|
kDelAct = 11,
|
||||||
|
kCancelAct = 12,
|
||||||
|
kOkAct = 13,
|
||||||
|
kModeAct = 14,
|
||||||
|
kButton0Act = 15,
|
||||||
|
kNoAct = -1
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
kButtonCount = kButton0Act + 1
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
kRepeatDelay = 500
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
kMaxLineLen = 80,
|
||||||
|
kMaxWordLen = 24,
|
||||||
|
kMaxWord = 50
|
||||||
|
};
|
||||||
|
|
||||||
struct Dict {
|
struct Dict {
|
||||||
|
Dict() : dictLine(nullptr), dictText(nullptr), dictActLine(nullptr),
|
||||||
|
dictLineCount(0), dictTextSize(0) {}
|
||||||
char **dictLine;
|
char **dictLine;
|
||||||
char *dictText;
|
char *dictText;
|
||||||
char *dictActLine; // using only for united dict...
|
char *dictActLine; // using only for united dict...
|
||||||
int32 dictLineCount;
|
int32 dictLineCount;
|
||||||
int32 dictTextSize;
|
int32 dictTextSize;
|
||||||
Common::String nameDict;
|
Common::String nameDict;
|
||||||
Common::String fnameDict;
|
Common::String defaultFilename;
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8 countWordsInString(const char *const str);
|
uint8 countWordsInString(const char *const str);
|
||||||
|
@ -94,7 +103,7 @@ private:
|
||||||
bool searchWord(const char *const where, const Common::String &whatCode);
|
bool searchWord(const char *const where, const Common::String &whatCode);
|
||||||
int binarySearch(const char *const *const dictLine, const Common::String &code, const int dictLineCount);
|
int binarySearch(const char *const *const dictLine, const Common::String &code, const int dictLineCount);
|
||||||
bool matchWord();
|
bool matchWord();
|
||||||
void processBtnActive(ButtonId active);
|
void processButton(ButtonId active);
|
||||||
void pressEditText();
|
void pressEditText();
|
||||||
|
|
||||||
void saveUserDictToFile();
|
void saveUserDictToFile();
|
||||||
|
@ -108,7 +117,7 @@ private:
|
||||||
Dict _userDict;
|
Dict _userDict;
|
||||||
|
|
||||||
int _mode;
|
int _mode;
|
||||||
ButtonId _lastbutton;
|
ButtonId _lastButton;
|
||||||
|
|
||||||
bool _userDictHasChanged;
|
bool _userDictHasChanged;
|
||||||
|
|
||||||
|
@ -121,8 +130,8 @@ private:
|
||||||
Common::String _prefix;
|
Common::String _prefix;
|
||||||
|
|
||||||
uint32 _curTime, _lastTime;
|
uint32 _curTime, _lastTime;
|
||||||
ButtonId _lastPressBtn;
|
ButtonId _lastPressedButton;
|
||||||
ButtonId _currBtn;
|
ButtonId _curPressedButton;
|
||||||
|
|
||||||
char _temp[kMaxWordLen + 1];
|
char _temp[kMaxWordLen + 1];
|
||||||
int _repeatcount[kMaxWordLen];
|
int _repeatcount[kMaxWordLen];
|
||||||
|
@ -132,11 +141,11 @@ private:
|
||||||
|
|
||||||
Common::String _search;
|
Common::String _search;
|
||||||
|
|
||||||
bool _navigationwithkeys;
|
bool _navigationWithKeys;
|
||||||
bool _needRefresh;
|
bool _needRefresh;
|
||||||
private:
|
private:
|
||||||
EditTextWidget *_edittext;
|
EditTextWidget *_editText;
|
||||||
ButtonWidget **_btns;
|
ButtonWidget *_button[kButtonCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
|
|
|
@ -633,6 +633,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
|
||||||
"<def var='Tooltip.XDelta' value='16'/> "
|
"<def var='Tooltip.XDelta' value='16'/> "
|
||||||
"<def var='Tooltip.YDelta' value='16'/>"
|
"<def var='Tooltip.YDelta' value='16'/>"
|
||||||
"<def var='Predictive.Button.Width' value='60' />"
|
"<def var='Predictive.Button.Width' value='60' />"
|
||||||
|
"<def var='Predictive.ShowDeletePic' value='0'/>"
|
||||||
"<widget name='OptionsLabel' "
|
"<widget name='OptionsLabel' "
|
||||||
"size='110,Globals.Line.Height' "
|
"size='110,Globals.Line.Height' "
|
||||||
"textalign='right' "
|
"textalign='right' "
|
||||||
|
@ -1930,6 +1931,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
|
||||||
"<def var='Tooltip.YDelta' value='8'/>"
|
"<def var='Tooltip.YDelta' value='8'/>"
|
||||||
"<def var='Predictive.Button.Width' value='45' />"
|
"<def var='Predictive.Button.Width' value='45' />"
|
||||||
"<def var='Predictive.Button.Height' value='15' />"
|
"<def var='Predictive.Button.Height' value='15' />"
|
||||||
|
"<def var='Predictive.ShowDeletePic' value='0'/>"
|
||||||
"<widget name='Button' "
|
"<widget name='Button' "
|
||||||
"size='72,16' "
|
"size='72,16' "
|
||||||
"/>"
|
"/>"
|
||||||
|
|
Binary file not shown.
|
@ -1 +1 @@
|
||||||
[SCUMMVM_STX0.8.20:ResidualVM Modern Theme:No Author]
|
[SCUMMVM_STX0.8.21:ResidualVM Modern Theme:No Author]
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
<def var = 'Tooltip.YDelta' value = '32'/>
|
<def var = 'Tooltip.YDelta' value = '32'/>
|
||||||
|
|
||||||
<def var = 'Predictive.Button.Width' value = '60' />
|
<def var = 'Predictive.Button.Width' value = '60' />
|
||||||
|
<def var = 'Predictive.ShowDeletePic' value = '1'/>
|
||||||
|
|
||||||
<widget name = 'OptionsLabel'
|
<widget name = 'OptionsLabel'
|
||||||
size = '115, Globals.Line.Height'
|
size = '115, Globals.Line.Height'
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
<def var = 'Predictive.Button.Width' value = '45' />
|
<def var = 'Predictive.Button.Width' value = '45' />
|
||||||
<def var = 'Predictive.Button.Height' value = '15' />
|
<def var = 'Predictive.Button.Height' value = '15' />
|
||||||
|
<def var = 'Predictive.ShowDeletePic' value = '0'/>
|
||||||
|
|
||||||
<widget name = 'Button'
|
<widget name = 'Button'
|
||||||
size = '72, 16'
|
size = '72, 16'
|
||||||
|
|
|
@ -5,11 +5,11 @@ gui/browser.cpp
|
||||||
gui/browser_osx.mm
|
gui/browser_osx.mm
|
||||||
gui/chooser.cpp
|
gui/chooser.cpp
|
||||||
gui/editrecorddialog.cpp
|
gui/editrecorddialog.cpp
|
||||||
gui/error.cpp
|
|
||||||
gui/filebrowser-dialog.cpp
|
gui/filebrowser-dialog.cpp
|
||||||
|
gui/fluidsynth-dialog.cpp
|
||||||
gui/gui-manager.cpp
|
gui/gui-manager.cpp
|
||||||
gui/KeysDialog.h
|
|
||||||
gui/KeysDialog.cpp
|
gui/KeysDialog.cpp
|
||||||
|
gui/KeysDialog.h
|
||||||
gui/launcher.cpp
|
gui/launcher.cpp
|
||||||
gui/massadd.cpp
|
gui/massadd.cpp
|
||||||
gui/onscreendialog.cpp
|
gui/onscreendialog.cpp
|
||||||
|
@ -25,6 +25,7 @@ gui/fluidsynth-dialog.cpp
|
||||||
base/main.cpp
|
base/main.cpp
|
||||||
|
|
||||||
common/error.cpp
|
common/error.cpp
|
||||||
|
common/rendermode.cpp
|
||||||
common/util.cpp
|
common/util.cpp
|
||||||
|
|
||||||
engines/advancedDetector.cpp
|
engines/advancedDetector.cpp
|
||||||
|
@ -38,9 +39,9 @@ audio/null.h
|
||||||
audio/null.cpp
|
audio/null.cpp
|
||||||
audio/softsynth/mt32.cpp
|
audio/softsynth/mt32.cpp
|
||||||
|
|
||||||
|
backends/events/default/default-events.cpp
|
||||||
|
backends/graphics/surfacesdl/surfacesdl-graphics.cpp
|
||||||
backends/keymapper/remap-dialog.cpp
|
backends/keymapper/remap-dialog.cpp
|
||||||
backends/midi/windows.cpp
|
backends/midi/windows.cpp
|
||||||
backends/platform/sdl/macosx/appmenu_osx.mm
|
backends/platform/sdl/macosx/appmenu_osx.mm
|
||||||
backends/graphics/surfacesdl/surfacesdl-graphics.cpp
|
|
||||||
backends/events/default/default-events.cpp
|
|
||||||
backends/updates/macosx/macosx-updates.mm
|
backends/updates/macosx/macosx-updates.mm
|
||||||
|
|
788
po/be_BY.po
788
po/be_BY.po
File diff suppressed because it is too large
Load diff
776
po/ca_ES.po
776
po/ca_ES.po
File diff suppressed because it is too large
Load diff
896
po/cs_CZ.po
896
po/cs_CZ.po
File diff suppressed because it is too large
Load diff
792
po/da_DA.po
792
po/da_DA.po
File diff suppressed because it is too large
Load diff
780
po/de_DE.po
780
po/de_DE.po
File diff suppressed because it is too large
Load diff
788
po/es_ES.po
788
po/es_ES.po
File diff suppressed because it is too large
Load diff
782
po/fi_FI.po
782
po/fi_FI.po
File diff suppressed because it is too large
Load diff
787
po/fr_FR.po
787
po/fr_FR.po
File diff suppressed because it is too large
Load diff
776
po/gl_ES.po
776
po/gl_ES.po
File diff suppressed because it is too large
Load diff
966
po/hu_HU.po
966
po/hu_HU.po
File diff suppressed because it is too large
Load diff
794
po/it_IT.po
794
po/it_IT.po
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,7 @@ POTFILE := $(srcdir)/po/residualvm.pot
|
||||||
POFILES := $(wildcard $(srcdir)/po/*.po)
|
POFILES := $(wildcard $(srcdir)/po/*.po)
|
||||||
CPFILES := $(wildcard $(srcdir)/po/*.cp)
|
CPFILES := $(wildcard $(srcdir)/po/*.cp)
|
||||||
|
|
||||||
ENGINE_INPUT_POTFILES := $(wildcard $(srcdir)/engines/*/POTFILES)
|
ENGINE_INPUT_POTFILES := $(sort $(wildcard $(srcdir)/engines/*/POTFILES))
|
||||||
updatepot:
|
updatepot:
|
||||||
cat $(srcdir)/po/POTFILES $(ENGINE_INPUT_POTFILES) | \
|
cat $(srcdir)/po/POTFILES $(ENGINE_INPUT_POTFILES) | \
|
||||||
xgettext -f - -D $(srcdir) -d residualvm --c++ -k_ -k_s -k_c:1,2c -k_sc:1,2c --add-comments=I18N\
|
xgettext -f - -D $(srcdir) -d residualvm --c++ -k_ -k_s -k_c:1,2c -k_sc:1,2c --add-comments=I18N\
|
||||||
|
|
790
po/nb_NO.po
790
po/nb_NO.po
File diff suppressed because it is too large
Load diff
774
po/nl_NL.po
774
po/nl_NL.po
File diff suppressed because it is too large
Load diff
810
po/nn_NO.po
810
po/nn_NO.po
File diff suppressed because it is too large
Load diff
790
po/pl_PL.po
790
po/pl_PL.po
File diff suppressed because it is too large
Load diff
806
po/pt_BR.po
806
po/pt_BR.po
File diff suppressed because it is too large
Load diff
797
po/ru_RU.po
797
po/ru_RU.po
File diff suppressed because it is too large
Load diff
745
po/scummvm.pot
745
po/scummvm.pot
File diff suppressed because it is too large
Load diff
794
po/se_SE.po
794
po/se_SE.po
File diff suppressed because it is too large
Load diff
783
po/uk_UA.po
783
po/uk_UA.po
File diff suppressed because it is too large
Load diff
16
ports.mk
16
ports.mk
|
@ -75,7 +75,7 @@ bundle: residualvm-static
|
||||||
mkdir -p $(bundle_name)/Contents/MacOS
|
mkdir -p $(bundle_name)/Contents/MacOS
|
||||||
mkdir -p $(bundle_name)/Contents/Resources
|
mkdir -p $(bundle_name)/Contents/Resources
|
||||||
echo "APPL????" > $(bundle_name)/Contents/PkgInfo
|
echo "APPL????" > $(bundle_name)/Contents/PkgInfo
|
||||||
cp $(srcdir)/dists/macosx/Info.plist $(bundle_name)/Contents/
|
sed -e 's/$$(PRODUCT_BUNDLE_IDENTIFIER)/org.residualvm.residualvm/' $(srcdir)/dists/macosx/Info.plist >$(bundle_name)/Contents/Info.plist
|
||||||
ifdef USE_SPARKLE
|
ifdef USE_SPARKLE
|
||||||
mkdir -p $(bundle_name)/Contents/Frameworks
|
mkdir -p $(bundle_name)/Contents/Frameworks
|
||||||
cp $(srcdir)/dists/macosx/dsa_pub.pem $(bundle_name)/Contents/Resources/
|
cp $(srcdir)/dists/macosx/dsa_pub.pem $(bundle_name)/Contents/Resources/
|
||||||
|
@ -143,8 +143,16 @@ endif
|
||||||
|
|
||||||
ifdef USE_FLUIDSYNTH
|
ifdef USE_FLUIDSYNTH
|
||||||
OSX_STATIC_LIBS += \
|
OSX_STATIC_LIBS += \
|
||||||
-framework CoreAudio \
|
-liconv -framework CoreMIDI -framework CoreAudio\
|
||||||
$(STATICLIBPATH)/lib/libfluidsynth.a
|
$(STATICLIBPATH)/lib/libfluidsynth.a \
|
||||||
|
$(STATICLIBPATH)/lib/libglib-2.0.a \
|
||||||
|
$(STATICLIBPATH)/lib/libintl.a
|
||||||
|
|
||||||
|
ifneq ($(BACKEND), iphone)
|
||||||
|
ifneq ($(BACKEND), ios7)
|
||||||
|
OSX_STATIC_LIBS += -lreadline
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_MAD
|
ifdef USE_MAD
|
||||||
|
@ -198,7 +206,7 @@ residualvm-static: $(OBJS)
|
||||||
$(OSX_STATIC_LIBS) \
|
$(OSX_STATIC_LIBS) \
|
||||||
$(OSX_ZLIB)
|
$(OSX_ZLIB)
|
||||||
|
|
||||||
# Special target to create a static linked binary for the iPhone
|
# Special target to create a static linked binary for the iPhone (legacy, and iOS 7+)
|
||||||
iphone: $(OBJS)
|
iphone: $(OBJS)
|
||||||
$(CXX) $(LDFLAGS) -o residualvm $(OBJS) \
|
$(CXX) $(LDFLAGS) -o residualvm $(OBJS) \
|
||||||
$(OSX_STATIC_LIBS) \
|
$(OSX_STATIC_LIBS) \
|
||||||
|
|
|
@ -332,6 +332,9 @@ class StringTestSuite : public CxxTest::TestSuite
|
||||||
TS_ASSERT(!Common::matchString("monkey.s99", "monkey.s*1"));
|
TS_ASSERT(!Common::matchString("monkey.s99", "monkey.s*1"));
|
||||||
TS_ASSERT(Common::matchString("monkey.s101", "monkey.s*1"));
|
TS_ASSERT(Common::matchString("monkey.s101", "monkey.s*1"));
|
||||||
|
|
||||||
|
TS_ASSERT(Common::matchString("monkey.s01", "monkey.s##"));
|
||||||
|
TS_ASSERT(!Common::matchString("monkey.s01", "monkey.###"));
|
||||||
|
|
||||||
TS_ASSERT(!Common::String("").matchString("*_"));
|
TS_ASSERT(!Common::String("").matchString("*_"));
|
||||||
TS_ASSERT(Common::String("a").matchString("a***"));
|
TS_ASSERT(Common::String("a").matchString("a***"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue