/// called to yield for a little bit so as not to hog cpu when paused or debugging
double Sys_Sleep(double time);
+void Sys_SDL_Dialog(const char *title, const char *string);
void Sys_SDL_Init(void);
/// Perform Key_Event () callbacks until the input que is empty
void Sys_SDL_HandleEvents(void);
// Sys_Error early in startup might screw with automated
// workflows or something if we show the dialog by default.
static qbool nocrashdialog = true;
-void Sys_Error (const char *error, ...)
+void Sys_SDL_Dialog(const char *title, const char *string)
{
- va_list argptr;
- char string[MAX_INPUTLINE];
-
-// change stdin to non blocking
-#ifndef WIN32
- fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
-#endif
-
- va_start (argptr,error);
- dpvsnprintf (string, sizeof (string), error, argptr);
- va_end (argptr);
-
- Con_Printf(CON_ERROR "Engine Error: %s\n", string);
-
- // don't want a dead window left blocking the OS UI or the crash dialog
- Host_Shutdown();
-
if(!nocrashdialog)
- SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Engine Error", string, NULL);
-
- exit (1);
+ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, string, NULL);
}
void Sys_Print(const char *text)
return NULL;
}
+
+void Sys_Error (const char *error, ...)
+{
+ va_list argptr;
+ char string[MAX_INPUTLINE];
+
+// change stdin to non blocking
+#ifndef WIN32
+ fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
+#endif
+
+ va_start (argptr,error);
+ dpvsnprintf (string, sizeof (string), error, argptr);
+ va_end (argptr);
+
+ Con_Printf(CON_ERROR "Engine Error: %s\n", string);
+
+ // don't want a dead window left blocking the OS UI or the crash dialog
+ Host_Shutdown();
+
+ Sys_SDL_Dialog("Engine Error", string);
+
+ exit (1);
+}
+
#ifndef WIN32
static const char *Sys_FindInPATH(const char *name, char namesep, const char *PATH, char pathsep, char *buf, size_t bufsize)
{
fflush(stdout);
}
-void Sys_Error (const char *error, ...)
+void Sys_SDL_Dialog(const char *title, const char *string)
{
- va_list argptr;
- char string[MAX_INPUTLINE];
-
-// change stdin to non blocking
-#ifndef WIN32
- fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
-#endif
- va_start (argptr,error);
- dpvsnprintf (string, sizeof (string), error, argptr);
- va_end (argptr);
-
- Con_Printf(CON_ERROR "Engine Error: %s\n", string);
-
- //Host_Shutdown ();
- exit (1);
}
void Sys_Print(const char *text)