summaryrefslogtreecommitdiff
path: root/unix.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-07-24 20:47:42 +0000
committerbjarni <bjarni@openttd.org>2005-07-24 20:47:42 +0000
commitcb3c325e5f8bcb09f390ef7a1af0ef0442fe9462 (patch)
treea76a3caff196b9a4ee538b858977e8393b1f4d44 /unix.c
parent238e47cd42c009f2ab1359428788a65a26fafebb (diff)
downloadopenttd-cb3c325e5f8bcb09f390ef7a1af0ef0442fe9462.tar.xz
(svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
- As a bonus, we now have an objective C file (os/macosx/macos.m) to use the functions Apple made to interact with OS stuff
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/unix.c b/unix.c
index 6c93ad993..8a4a53326 100644
--- a/unix.c
+++ b/unix.c
@@ -53,6 +53,10 @@ ULONG __stack = (1024*1024)*2; // maybe not that much is needed actually ;)
// ULONG __stack =
#endif
+#if defined(__APPLE__)
+#include "os/macosx/macos.h"
+#endif
+
static char *_fios_path;
static char *_fios_save_path;
static char *_fios_scn_path;
@@ -467,10 +471,9 @@ void ShowInfo(const char *str)
void ShowOSErrorBox(const char *buf)
{
#if defined(__APPLE__)
- // this creates an error in the console and then opens the console.
- // Colourcodes are not used in the console, so they are skipped here
- fprintf(stderr, "Error: %s", buf);
- system("/Applications/Utilities/Console.app/Contents/MacOS/Console &");
+ // this creates an NSAlertPanel with the contents of 'buf'
+ // this is the native and nicest way to do this on OSX
+ ShowMacDialog( buf, "See readme for more info\nMost likely you are missing files from the original TTD", "Quit" );
#else
// all systems, but OSX
fprintf(stderr, "\033[1;31mError: %s\033[0;39m\n", buf);