Skip to content

Commit

Permalink
MacOS: change from a Mac App to command line app for now.
Browse files Browse the repository at this point in the history
Makes it easier to set the working directory to the app location, so that the game can find the required files.
  • Loading branch information
BodbDearg committed Feb 28, 2020
1 parent d242020 commit 6ba1dff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ if (PLATFORM_WINDOWS)
endif()

if (PLATFORM_MAC)
SET_TARGET_PROPERTIES(${GAME_TGT_NAME} PROPERTIES MACOSX_BUNDLE TRUE)
# Disable for now!
# SET_TARGET_PROPERTIES(${GAME_TGT_NAME} PROPERTIES MACOSX_BUNDLE TRUE)
endif()

if (PLATFORM_LINUX)
Expand Down
4 changes: 2 additions & 2 deletions game/Main_Mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int main(const int argc, const char** const argv) noexcept {
// Set the working directory to the .app folder if we can't find Doom.cue:
NSFileManager* fileMgr = [NSFileManager defaultManager];
NSString* workingDir = [fileMgr currentDirectoryPath];
std::printf("PSYDOOM current working directory: %s\n", workingDir.UTF8String);
std::printf("PsyDoom current working directory: %s\n", workingDir.UTF8String);

if (![fileMgr fileExistsAtPath: @"Doom.cue"]) {
NSURL* bundleURL = [[NSBundle mainBundle] bundleURL];
Expand All @@ -25,7 +25,7 @@ int main(const int argc, const char** const argv) noexcept {
appFolder = bundleURL;
}

std::printf("'Doom.cue' not found at current PSYDOOM working directory! Changing PSYDOOM working dir to: %s\n", appFolder.path.UTF8String);
std::printf("'Doom.cue' not found at current PsyDoom working directory! Changing PsyDoom working dir to: %s\n", appFolder.path.UTF8String);
[fileMgr changeCurrentDirectoryPath: appFolder.path];
}

Expand Down

0 comments on commit 6ba1dff

Please sign in to comment.