Skip to content

Commit baef5b3

Browse files
committed
Chamges to make Mac bundle
- Removed subdir for SDL_mixer.h (shouldn't need it) - Changed SDL BasePath to SDL_PrefPath on Mac. Files can be found in bundle in '~/Library/Application Support/Akhenaten'
1 parent e868273 commit baef5b3

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/platform/akhenaten.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ static bool pre_init(pcstr custom_data_dir) {
149149
#if !defined(GAME_PLATFORM_ANDROID)
150150
// ...then from the executable base path...
151151
static_assert(SDL_VERSION_ATLEAST(2, 0, 1), "SDL version too old");
152+
#if defined(GAME_PLATFORM_MACOSX)
153+
char* tmp_path = SDL_GetPrefPath("", "Akhenaten");
154+
#else
152155
char* tmp_path = SDL_GetBasePath();
156+
#endif
153157
bstring512 base_path(tmp_path);
154158
SDL_free(tmp_path);
155159
if (pre_init_dir_attempt(base_path, "Attempting to load game from base path %s")) {

src/platform/prefs.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ static FILE* open_pref_file(const char* filename, const char* mode) {
1414
static_assert(SDL_VERSION_ATLEAST(2, 0, 1), "SDL version too old");
1515
#if defined(GAME_PLATFORM_ANDROID)
1616
bstring512 dir_path = SDL_AndroidGetExternalStoragePath();
17+
#else
18+
#if defined(GAME_PLATFORM_MACOSX)
19+
char* tmp_path = SDL_GetPrefPath("", "Akhenaten");
1720
#else
1821
char* tmp_path = SDL_GetBasePath();
22+
#endif
1923
bstring512 dir_path(tmp_path);
2024
SDL_free(tmp_path);
2125
#endif

src/sound/sound.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#include <SDL.h>
22

3-
#ifdef __APPLE__
4-
#include <SDL2_mixer/SDL_mixer.h>
5-
#else
63
#include <SDL_mixer.h>
7-
#endif
84

95
#include "sound/sound.h"
106
#include "core/game_environment.h"

0 commit comments

Comments
 (0)