foxygit / doom Log in
commit 1b4ad12272d7250ed8d62d82fca5ca96161bb481
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Oct 21 21:37:53 2011 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Oct 21 21:37:53 2011 +0000

    Add command line parameter to disable the GUI pop-up window that appears
    when an error occurs (or -timedemo finishes).

    Subversion-branch: /branches/v2-branch
    Subversion-revision: 2451
---
 src/i_system.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/i_system.c b/src/i_system.c
index 38266c4f..328fd9f5 100644
--- a/src/i_system.c
+++ b/src/i_system.c
@@ -319,6 +319,7 @@ void I_Error (char *error, ...)
 {
     va_list argptr;
     atexit_listentry_t *entry;
+    boolean exit_gui_popup;

     if (already_quitting)
     {
@@ -351,9 +352,13 @@ void I_Error (char *error, ...)

         entry = entry->next;
     }
-
+
+    exit_gui_popup = !M_ParmExists("-nogui");
+
 #ifdef _WIN32
     // On Windows, pop up a dialog box with the error message.
+
+    if (exit_gui_popup)
     {
         char msgbuf[512];
         wchar_t wmsgbuf[512];
@@ -372,7 +377,7 @@ void I_Error (char *error, ...)
 #endif

 #ifdef __MACOSX__
-    if (!I_ConsoleStdout())
+    if (exit_gui_popup && !I_ConsoleStdout())
     {
         CFStringRef message;
         char msgbuf[512];