aboutsummaryrefslogtreecommitdiffstats
path: root/code/sys
diff options
context:
space:
mode:
authoricculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-09-15 05:38:27 +0000
committericculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-09-15 05:38:27 +0000
commitda827dbb091b0cba604e408854fa7d89f83c5b65 (patch)
tree08c719ed9ba9005f4efce4def068de4a431f6d11 /code/sys
parent4d2bb35e55e29ef01e7a8f86a4f817e6ec0735aa (diff)
downloadioquake3-aero-da827dbb091b0cba604e408854fa7d89f83c5b65.tar.gz
ioquake3-aero-da827dbb091b0cba604e408854fa7d89f83c5b65.zip
Added a real GUI message box to Sys_ErrorDialog() on Mac OS X.
Fixes Bugzilla #3654. git-svn-id: svn://svn.icculus.org/quake3/trunk@1616 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/sys')
-rw-r--r--code/sys/sys_cocoa.m40
-rw-r--r--code/sys/sys_local.h1
-rw-r--r--code/sys/sys_unix.c5
3 files changed, 46 insertions, 0 deletions
diff --git a/code/sys/sys_cocoa.m b/code/sys/sys_cocoa.m
new file mode 100644
index 0000000..7efa615
--- /dev/null
+++ b/code/sys/sys_cocoa.m
@@ -0,0 +1,40 @@
+/*
+===========================================================================
+Copyright (C) 1999-2005 Id Software, Inc.
+
+This file is part of Quake III Arena source code.
+
+Quake III Arena source code is free software; you can redistribute it
+and/or modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the License,
+or (at your option) any later version.
+
+Quake III Arena source code is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Quake III Arena source code; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+===========================================================================
+*/
+
+#ifndef MACOS_X
+#error This file is for Mac OS X only. You probably should not compile it.
+#endif
+
+// Please note that this file is just some Mac-specific bits. Most of the
+// Mac OS X code is shared with other Unix platforms in sys_unix.c ...
+
+#import <Cocoa/Cocoa.h>
+
+void Sys_Cocoa_MsgBox( const char *text )
+{
+ NSRunInformationalAlertPanel(@"ioquake3",
+ [NSString stringWithUTF8String:text],
+ @"OK", nil, nil);
+}
+
+// end of sys_cocoa.m ...
+
diff --git a/code/sys/sys_local.h b/code/sys/sys_local.h
index 6174876..09d0cc0 100644
--- a/code/sys/sys_local.h
+++ b/code/sys/sys_local.h
@@ -46,6 +46,7 @@ unsigned int CON_LogRead( char *out, unsigned int outSize );
#ifdef MACOS_X
char *Sys_StripAppBundle( char *pwd );
+void Sys_Cocoa_MsgBox( const char *text );
#endif
void Sys_GLimpSafeInit( void );
diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c
index bcbb086..641770c 100644
--- a/code/sys/sys_unix.c
+++ b/code/sys/sys_unix.c
@@ -510,6 +510,11 @@ void Sys_ErrorDialog( const char *error )
Sys_Print( va( "%s\n", error ) );
+#if defined(MACOS_X) && !DEDICATED
+ if (!com_dedicated || !com_dedicated->integer)
+ Sys_Cocoa_MsgBox(error);
+#endif
+
/* make sure the write path for the crashlog exists... */
if( FS_CreatePath( ospath ) ) {
Com_Printf( "ERROR: couldn't create path '%s' for crash log.\n", ospath );