whether the game quit normally, so shell scripts get a useful value
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7165
d7cf8633-e32d-0410-b094-
e92efae38249
void Host_Quit_f (void)
{
void Host_Quit_f (void)
{
// (may) output text to terminal which launched program
void Sys_Shutdown (void); //INFO: This is only called by Host_Shutdown so we dont need testing for recursion
// (may) output text to terminal which launched program
void Sys_Shutdown (void); //INFO: This is only called by Host_Shutdown so we dont need testing for recursion
+void Sys_Quit (int returnvalue);
double Sys_DoubleTime (void);
double Sys_DoubleTime (void);
extern qboolean host_shuttingdown;
extern qboolean host_shuttingdown;
+void Sys_Quit (int returnvalue)
{
host_shuttingdown = true;
Host_Shutdown();
{
host_shuttingdown = true;
Host_Shutdown();
{
printf("Received signal %d, exiting...\n", sig);
VID_RestoreSystemGamma();
{
printf("Received signal %d, exiting...\n", sig);
VID_RestoreSystemGamma();
// Closed
if (AsyncEvent_Quitting)
// Closed
if (AsyncEvent_Quitting)
}
static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer)
}
static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer)
VID_AppFocusChanged(false);
break;
case kEventAppQuit:
VID_AppFocusChanged(false);
break;
case kEventAppQuit:
break;
case kEventAppActiveWindowChanged:
break;
break;
case kEventAppActiveWindowChanged:
break;
break;
case DestroyNotify:
// window has been destroyed
break;
case DestroyNotify:
// window has been destroyed
break;
case ClientMessage:
// window manager messages
if ((event.xclient.format == 32) && ((unsigned int)event.xclient.data.l[0] == wm_delete_window_atom))
break;
case ClientMessage:
// window manager messages
if ((event.xclient.format == 32) && ((unsigned int)event.xclient.data.l[0] == wm_delete_window_atom))
break;
case MapNotify:
// window restored
break;
case MapNotify:
// window restored
{
Con_Printf("Received signal %d, exiting...\n", sig);
VID_RestoreSystemGamma();
{
Con_Printf("Received signal %d, exiting...\n", sig);
VID_RestoreSystemGamma();
void signal_handler(int sig)
{
Con_Printf("Received signal %d, exiting...\n", sig);
void signal_handler(int sig)
{
Con_Printf("Received signal %d, exiting...\n", sig);
while( SDL_PollEvent( &event ) )
switch( event.type ) {
case SDL_QUIT:
while( SDL_PollEvent( &event ) )
switch( event.type ) {
case SDL_QUIT:
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
{
if (!GetMessage (&msg, NULL, 0, 0))
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
{
if (!GetMessage (&msg, NULL, 0, 0))
TranslateMessage (&msg);
DispatchMessage (&msg);
TranslateMessage (&msg);
DispatchMessage (&msg);
case WM_CLOSE:
if (MessageBox (mainwindow, "Are you sure you want to quit?", "Confirm Exit", MB_YESNO | MB_SETFOREGROUND | MB_ICONQUESTION) == IDYES)
case WM_CLOSE:
if (MessageBox (mainwindow, "Are you sure you want to quit?", "Confirm Exit", MB_YESNO | MB_SETFOREGROUND | MB_ICONQUESTION) == IDYES)