Skip to content

Commit

Permalink
macOS: Fix build + Enable running game from .app
Browse files Browse the repository at this point in the history
  • Loading branch information
Mefiresu committed Jul 20, 2024
1 parent e2c9219 commit 7d75a92
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RetroEDv2/gamemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GameManager::GameManager(QWidget *parent) : QDialog(parent), ui(new Ui::GameMana
#if defined(Q_OS_WIN)
QFileDialog filedialog(this, tr("Open Executable"), "",
"Windows Executables (*.exe);;All Files (*)");
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
QFileDialog filedialog(this, tr("Open Executable"), "",
"Mac OS Executables (*.app);;All Files (*)");
#else
Expand Down
7 changes: 7 additions & 0 deletions RetroEDv2/tools/sceneeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,14 @@ SceneEditor::SceneEditor(QWidget *parent) : QWidget(parent), ui(new Ui::SceneEdi
args << "console=true;" << QString("stage=%1;").arg(argInitStage)
<< QString("scene=%1;").arg(argInitScene);
QProcess proc;
#ifdef Q_OS_MACOS
// Run with "open" so that .app can work
proc.setProgram("open");
QStringList openArgs({"-a", gamePath, "--args"});
args = openArgs + args;
#else
proc.setProgram(gamePath);
#endif
proc.setWorkingDirectory(QFileInfo(dataPath).absolutePath());
proc.setArguments(args);
proc.startDetached();
Expand Down
9 changes: 8 additions & 1 deletion RetroEDv2/tools/sceneeditorv5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ SceneEditorv5::SceneEditorv5(QWidget *parent) : QWidget(parent), ui(new Ui::Scen
args << "console=true;" << QString("stage=%1;").arg(argInitStage)
<< QString("scene=%1;").arg(argInitScene) << QString("filter=%1;").arg(filterVal);
QProcess proc;
#ifdef Q_OS_MACOS
// Run with "open" so that .app can work
proc.setProgram("open");
QStringList openArgs({"-a", gamePath, "--args"});
args = openArgs + args;
#else
proc.setProgram(gamePath);
#endif
proc.setWorkingDirectory(QFileInfo(dataPath).absolutePath());
proc.setArguments(args);
proc.startDetached();
Expand Down Expand Up @@ -2958,7 +2965,7 @@ void SceneEditorv5::CreateNewScene(QString scnPath, bool prePlus, bool loadGC, Q
};
#ifdef Q_OS_WIN
int definedOS = 0;
#elif Q_OS_MAC
#elif defined(Q_OS_MACOS)
int definedOS = 1;
#else
int definedOS = 2;
Expand Down
4 changes: 2 additions & 2 deletions RetroEDv2/tools/sceneviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ void SceneViewer::updateScene()
if (engineRevision != 1)
status += QString(", Filter: %1").arg(sceneFilter);
if (!v5Editor->gameLinks.count()){
#ifdef Q_OS_WIN
#if defined(Q_OS_WIN)
gameLinkState = "No Game.dll found";
#elif Q_OS_MAC
#elif defined(Q_OS_MACOS)
gameLinkState = "No Game.dylib found";
#else
gameLinkState = "No libGame.so found";
Expand Down

0 comments on commit 7d75a92

Please sign in to comment.