Skip to content

Commit 6b1fd23

Browse files
Add support for MacOS.
1 parent 267af17 commit 6b1fd23

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

globaldefines.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737

3838
//For OS X support (not used because no mac to compile and test on)
3939
#elif defined(Q_OS_MAC)
40-
#define DEFAULT_PATH ""
41-
#define ENGINE_FILENAME ""
42-
#define PLATFORM "darwin"
40+
#define DEFAULT_PATH QDir::homePath() + QString("/Library/Application Support/Toontown Rewritten")
41+
#define LIBRARY_PATH QString("./Libraries.bundle")
42+
#define ENGINE_FILENAME QString("\"./Toontown Rewritten\"")
43+
#define PLATFORM "darwin"
4344

4445
#else
4546
#error "Unsupported platform."

loginworker.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ void LoginWorker::startGame(QString cookie, QString gameServer)
243243
QProcessEnvironment gameEnvironment = QProcessEnvironment::systemEnvironment();
244244
gameEnvironment.insert("TTR_PLAYCOOKIE", cookie);
245245
gameEnvironment.insert("TTR_GAMESERVER", gameServer);
246+
247+
#ifdef Q_OS_MAC
248+
gameEnvironment.insert("DYLD_LIBRARY_PATH", LIBRARY_PATH);
249+
#endif
250+
246251
gameProcess->setProcessEnvironment(gameEnvironment);
247252

248253
connect(gameProcess, SIGNAL(started()), this, SLOT(gameHasStarted()));

patchworker.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
#endif
3838
//*********************************************************
3939

40+
#ifdef Q_OS_MAC
41+
#include <sys/types.h>
42+
#endif
43+
4044
class PatchWorker : public QObject
4145
{
4246
Q_OBJECT

resources/icon.icns

148 KB
Binary file not shown.

0 commit comments

Comments
 (0)