Rev 7 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7 | Rev 11 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | * terms of this license. |
9 | * terms of this license. |
10 | * |
10 | * |
11 | * You must not remove this notice, or any other, from this software. |
11 | * You must not remove this notice, or any other, from this software. |
12 | */ |
12 | */ |
13 | 13 | ||
14 | #include <SDL.h> |
14 | #include <SDL2/SDL.h> |
15 | 15 | ||
16 | #include <signal.h> |
16 | #include <signal.h> |
17 | 17 | ||
18 | #include "system.h" |
18 | #include "system.h" |
19 |
|
19 | #if defined(_WIN32) |
20 | #include "windows.h" |
20 | #include "windows.h" |
21 | char *sys_getbasepath (void) |
21 | char *sys_getbasepath (void) |
22 | { |
22 | { |
23 | static char app_path[1024] = ""; |
23 | static char app_path[1024] = ""; |
24 | if (app_path[0] == 0) |
24 | if (app_path[0] == 0) |
Line 27... | Line 27... | ||
27 | if (strrchr (app_path, '\\') != NULL) |
27 | if (strrchr (app_path, '\\') != NULL) |
28 | *strrchr (app_path, '\\') = 0; |
28 | *strrchr (app_path, '\\') = 0; |
29 | } |
29 | } |
30 | return (app_path); |
30 | return (app_path); |
31 | } |
31 | } |
32 | #else // !WIN32 |
- | |
33 |
|
32 | #elif defined(__APPLE__) |
34 | #include <CoreFoundation/CoreFoundation.h> |
33 | #include <CoreFoundation/CoreFoundation.h> |
35 | #include <dlfcn.h> |
34 | #include <dlfcn.h> |
36 | void MessageBox (void *handle, char *msg, char *title, int buttons) |
35 | void MessageBox (void *handle, char *msg, char *title, int buttons) |
37 | { |
36 | { |
38 | const void *keys[2]; |
37 | const void *keys[2]; |
Line 82... | Line 81... | ||
82 | *strrchr (app_path, '/') = 0; |
81 | *strrchr (app_path, '/') = 0; |
83 | strcat_s (app_path, 1024, "/Resources"); |
82 | strcat_s (app_path, 1024, "/Resources"); |
84 | } |
83 | } |
85 | return (app_path); |
84 | return (app_path); |
86 | } |
85 | } |
87 | #else // !__APPLE__ |
86 | #else // !_WIN32 && !__APPLE__ |
88 | #define MessageBox(handle,msg,title,btns) fprintf (stderr, msg) |
87 | #define MessageBox(handle,msg,title,btns) fprintf (stderr, msg) |
89 | #define MB_OK 0 |
88 | #define MB_OK 0 |
90 | char *sys_getbasepath (void) |
89 | char *sys_getbasepath (void) |
91 | { |
90 | { |
92 | return ("."); |
91 | return ("."); |
93 | } |
92 | } |
94 | #endif // __APPLE__ |
93 | #endif // _WIN32 || __APPLE__ |
95 | #endif // WIN32 |
- | |
96 | 94 | ||
97 | 95 | ||
98 | /* |
96 | /* |
99 | * Panic |
97 | * Panic |
100 | */ |
98 | */ |