Add config entry "allowSymlinks"

This commit is contained in:
Jonas Kulla 2013-10-20 22:38:46 +02:00
parent dcdfea55f1
commit 10b3e04dee
6 changed files with 13 additions and 4 deletions

View File

@ -80,6 +80,7 @@ mkxp reads configuration data from the file "mkxp.conf" contained in the current
| fixedFramerate | int | 0 | FPS will be fixed to this amount. Ignored if 0. | | fixedFramerate | int | 0 | FPS will be fixed to this amount. Ignored if 0. |
| solidFonts | bool | false | Don't use alpha blending for fonts | | solidFonts | bool | false | Don't use alpha blending for fonts |
| gameFolder | string | "." | mkxp will look for all game related files here | | gameFolder | string | "." | mkxp will look for all game related files here |
| allowSymlinks | bool | false | Allow symlinks to be followed in the game folder. |
| customScript | string | "" | Execute a raw ruby script file instead of an RPG Maker game. | | customScript | string | "" | Execute a raw ruby script file instead of an RPG Maker game. |
| RTPs | string list | "" | A list of space separated paths to RTPs to be used (See next section) | | RTPs | string list | "" | A list of space separated paths to RTPs to be used (See next section) |

View File

@ -39,7 +39,8 @@ Config::Config()
defScreenH(480), defScreenH(480),
fixedFramerate(0), fixedFramerate(0),
solidFonts(false), solidFonts(false),
gameFolder(".") gameFolder("."),
allowSymlinks(false)
{} {}
void Config::read() void Config::read()
@ -59,6 +60,7 @@ void Config::read()
READ_VAL(fixedFramerate, Int); READ_VAL(fixedFramerate, Int);
READ_VAL(solidFonts, Bool); READ_VAL(solidFonts, Bool);
READ_VAL(gameFolder, ByteArray); READ_VAL(gameFolder, ByteArray);
READ_VAL(allowSymlinks, Bool);
READ_VAL(customScript, ByteArray); READ_VAL(customScript, ByteArray);
QStringList _rtps = confFile.value("RTPs").toStringList(); QStringList _rtps = confFile.value("RTPs").toStringList();

View File

@ -45,6 +45,7 @@ struct Config
bool solidFonts; bool solidFonts;
QByteArray gameFolder; QByteArray gameFolder;
bool allowSymlinks;
QByteArray customScript; QByteArray customScript;
QVector<QByteArray> rtps; QVector<QByteArray> rtps;

View File

@ -679,12 +679,16 @@ struct FileSystemPrivate
} }
}; };
FileSystem::FileSystem(const char *argv0) FileSystem::FileSystem(const char *argv0,
bool allowSymlinks)
{ {
p = new FileSystemPrivate; p = new FileSystemPrivate;
PHYSFS_init(argv0); PHYSFS_init(argv0);
PHYSFS_registerArchiver(&RGSS_Archiver); PHYSFS_registerArchiver(&RGSS_Archiver);
if (allowSymlinks)
PHYSFS_permitSymbolicLinks(1);
} }
FileSystem::~FileSystem() FileSystem::~FileSystem()

View File

@ -54,7 +54,8 @@ struct FileSystemPrivate;
class FileSystem class FileSystem
{ {
public: public:
FileSystem(const char *argv0); FileSystem(const char *argv0,
bool allowSymlinks);
~FileSystem(); ~FileSystem();
void addPath(const char *path); void addPath(const char *path);

View File

@ -99,7 +99,7 @@ struct SharedStatePrivate
SharedStatePrivate(RGSSThreadData *threadData) SharedStatePrivate(RGSSThreadData *threadData)
: bindingData(0), : bindingData(0),
sdlWindow(threadData->window), sdlWindow(threadData->window),
fileSystem(threadData->argv0), fileSystem(threadData->argv0, threadData->config.allowSymlinks),
eThread(*threadData->ethread), eThread(*threadData->ethread),
rtData(*threadData), rtData(*threadData),
config(threadData->config), config(threadData->config),