Пример #1
0
void Sys_Quit (void)
{
	Host_Shutdown();
	printf("Sys_Quit - exiting.");
    // fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
	exit(0);
}
Пример #2
0
void Sys_Quit (void)
{
	Sys_EnableTerm();
	Host_Shutdown ();

	exit (0);
}
Пример #3
0
void Sys_Error (const char *error, ...)
{
    va_list     argptr;
    char        string[1024];

// change stdin to non blocking
    // fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);

    va_start (argptr,error);
    vsprintf (string,error,argptr);
    va_end (argptr);
#ifdef USE_PMPEVENT
  PMPERROR(("Error: %s\n", string));
#else
  IwError(("%s", string));
  fprintf(stderr, "Error: %s\n", string);
#endif
  Host_Shutdown ();
#ifdef USE_PMPEVENT
  PMPERROR(("Sys_Error - exiting."));
#else
  printf("Sys_Error - exiting.\n");
#endif
  exit (1);

}
Пример #4
0
void Sys_Quit (void)
{
	aptUnhook(&sysAptCookie);
	Host_Shutdown();
	gfxExit();
	exit (0);
}
Пример #5
0
void Sys_Error (const char *error, ...)
{
	va_list		argptr;
	char		text[MAX_PRINTMSG];

	va_start (argptr, error);
	q_vsnprintf (text, sizeof(text), error, argptr);
	va_end (argptr);

	if (con_debuglog)
	{
		LOG_Print (ERROR_PREFIX);
		LOG_Print (text);
		LOG_Print ("\n\n");
	}

	Host_Shutdown ();

	printf (ERROR_PREFIX "%s\n\n", text);

#ifdef DEBUG_BUILD
	getch();
#endif

	exit (1);
}
Пример #6
0
void Sys_Quit (void)
{
	byte	screen[80*25*2];
//	byte	*d;	// 2001-09-12 Returning information about loaded file by Maddes
	char			ver[6];
	int			i;
	loadedfile_t	*fileinfo;	// 2001-09-12 Returning information about loaded file by Maddes


// load the sell screen before shuting everything down
	if (registered->value)
// 2001-09-12 Returning information about loaded file by Maddes  start
//		d = COM_LoadHunkFile ("end2.bin");
		fileinfo = COM_LoadHunkFile ("end2.bin");
// 2001-09-12 Returning information about loaded file by Maddes  end
	else
// 2001-09-12 Returning information about loaded file by Maddes  start
//		d = COM_LoadHunkFile ("end1.bin");
		fileinfo = COM_LoadHunkFile ("end1.bin");
// 2001-09-12 Returning information about loaded file by Maddes  end

// 2001-09-12 Returning information about loaded file by Maddes  start
/*
	if (d)
		memcpy (screen, d, sizeof(screen));
*/
	if (fileinfo)
		memcpy (screen, fileinfo->data, sizeof(screen));
// 2001-09-12 Returning information about loaded file by Maddes  end

// write the version number directly to the end screen
	sprintf (ver, " v%4.2f", VERSION);
	for (i=0 ; i<6 ; i++)
		screen[0*80*2 + 72*2 + i*2] = ver[i];

	Host_Shutdown();

// do the text mode sell screen
// 2001-09-12 Returning information about loaded file by Maddes  start
//	if (d)
	if (fileinfo)
// 2001-09-12 Returning information about loaded file by Maddes  end
	{
		memcpy ((void *)real2ptr(0xb8000), screen,80*25*2);

	// set text pos
		regs.x.ax = 0x0200;
		regs.h.bh = 0;
		regs.h.dl = 0;
		regs.h.dh = 22;
		dos_int86 (0x10);
	}
	else
		printf ("couldn't load endscreen.\n");

	exit(0);
}
Пример #7
0
void Sys_Quit (void)
{
	Host_Shutdown();

	if (isDedicated)
		FreeConsole ();

	exit (0);
}
Пример #8
0
void
Sys_Quit(void)
{
    Host_Shutdown();
    fcntl(STDIN_FILENO, F_SETFL,
	  fcntl(STDIN_FILENO, F_GETFL, 0) & ~O_NONBLOCK);
    fflush(stdout);
    exit(0);
}
Пример #9
0
void Sys_ShutdownGame() {

   //Sys_ShutdownAuthentication();
   Host_Shutdown();
   NET_Config(0);
   //Sys_ShutdownLauncherInterface();
   Sys_ShutdownMemory();
   //Sys_Shutdown();
}
Пример #10
0
int SDLash_EventFilter( SDL_Event* event)
{
	switch ( event->type )
	{
		case SDL_MOUSEMOTION:
			IN_MouseEvent(0);
			break;
		case SDL_QUIT:
			Host_Shutdown();
			break;

		case SDL_KEYDOWN:
		case SDL_KEYUP:
			SDLash_KeyEvent(event->key);
			break;

		case SDL_MOUSEWHEEL:
			SDLash_WheelEvent(event->wheel);
			break;

		case SDL_MOUSEBUTTONUP:
		case SDL_MOUSEBUTTONDOWN:
			SDLash_MouseEvent(event->button);
			break;

		case SDL_TEXTEDITING:
			MsgDev(D_INFO, "Caught a text edit: %s %n %n\n", event->edit.text, event->edit.start, event->edit.length);
			break;

		case SDL_TEXTINPUT:
			SDLash_InputEvent(event->text);
			break;

		case SDL_WINDOWEVENT:
			if( host.state == HOST_SHUTDOWN )
				break; // no need to activate
			if( host.state != HOST_RESTART )
			{
				switch( event->window.type )
				{
				case SDL_WINDOWEVENT_MINIMIZED:
					host.state = HOST_SLEEP;
					break;
				case SDL_WINDOWEVENT_FOCUS_LOST:
					host.state = HOST_NOFOCUS;
					IN_DeactivateMouse();
					break;
				default:
					host.state = HOST_FRAME;
					IN_ActivateMouse(true);
				}
			}
	}
	VGUI_SurfaceWndProc(event);
	return 0;
}
Пример #11
0
void Sys_Error (char *error, ...)
{
    va_list         argptr;

    printf ("Sys_Error: ");
    va_start (argptr,error);
    vprintf (error,argptr);
    va_end (argptr);
    printf ("\n");
    Host_Shutdown();
    exit (1);
}
Пример #12
0
void Host_Quit (void)
{
	// execute user's trigger
	TP_ExecTrigger ("f_exit");
	Cbuf_Execute();
	
	// save config (conditional)
	Config_QuitSave();

	// turn off
	Host_Shutdown ();
	Sys_Quit ();
}
Пример #13
0
void Sys_Error(const char *error, ...)
{
   va_list argptr;
   char string[MAX_PRINTMSG];

   va_start(argptr, error);
   vsnprintf(string, sizeof(string), error, argptr);
   va_end(argptr);
   fprintf(stderr, "Error: %s\n", string);

   Host_Shutdown();
   exit(1);
}
Пример #14
0
void Sys_Quit (void)
{
	Host_Shutdown();
    fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
#if 0
	if (registered.value)
		printf("%s", end2);
	else
		printf("%s", end1);
#endif
	fflush(stdout);
	exit(0);
}
Пример #15
0
void Sys_Quit(void)
{
	byte	screen[80*25*2];
	byte	*d;
	char			ver[6];
	int			i;


// load the sell screen before shuting everything down
	if (registered.value)
	{
		d = COM_LoadHunkFile("end2.bin");
	}
	else
	{
		d = COM_LoadHunkFile("end1.bin");
	}
	if (d)
	{
		memcpy(screen, d, sizeof(screen));
	}

// write the version number directly to the end screen
	sprintf(ver, " v%4.2f", VERSION);
	for (i=0 ; i<6 ; i++)
	{
		screen[0*80*2 + 72*2 + i*2] = ver[i];
	}

	Host_Shutdown();

// do the text mode sell screen
	if (d)
	{
		memcpy((void *)real2ptr(0xb8000), screen,80*25*2);

		// set text pos
		regs.x.ax = 0x0200;
		regs.h.bh = 0;
		regs.h.dl = 0;
		regs.h.dh = 22;
		dos_int86(0x10);
	}
	else
	{
		printf("couldn't load endscreen.\n");
	}

	exit(0);
}
Пример #16
0
void Sys_Error (char *error, ...)
{ 
    va_list     argptr;
    char        string[1024];

    va_start (argptr,error);
    vsprintf (string,error,argptr);
    va_end (argptr);
	fprintf(stderr, "Error: %s\n", string);

	Host_Shutdown ();
	exit (1);

} 
Пример #17
0
void Sys_Error (char *error, ...)
{ 
    va_list     argptr;
    char        string[1024];
    
    va_start (argptr,error);
    vsprintf (string,error,argptr);
    va_end (argptr);

	Host_Shutdown();
	fprintf(stderr, "Error: %s\n", string);
// Sys_AtExit is called by exit to shutdown the system
	exit(0);
} 
Пример #18
0
void Sys_Quit (void)
{
  Host_Shutdown();
#ifdef USE_PMPEVENT
  PMPERROR(("Sys_Quit - exiting."));
#else
  printf("Sys_Quit - exiting.\n");
#endif
    // fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
  if (soft_quit) {
    return;
  }
    exit(0);
}
Пример #19
0
void
Sys_Quit(void)
{
    Host_Shutdown();
    fcntl(STDIN_FILENO, F_SETFL,
	  fcntl(STDIN_FILENO, F_GETFL, 0) & ~O_NONBLOCK);
#if 0
    if (registered.value)
	printf("%s", end2);
    else
	printf("%s", end1);
#endif
    fflush(stdout);
    exit(0);
}
Пример #20
0
void Sys_Quit(const char* EndText)
{
    // Shutdown system
    Host_Shutdown();

    SDL_Quit();

    // Throw the end text at the screen
    if (EndText)
    {
        PutEndText(EndText);
    }

    // Exit
    exit(0);
}
Пример #21
0
void		 Sys_Error (const char *error, ...)
{
	va_list	 argptr;
	char	 string[1024];

	// change stdin to non blocking
	fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);

	va_start (argptr, error);
	vsnprintf (string, sizeof(string), error, argptr);
	va_end (argptr);
	fprintf(stderr, "Error: %s\n", string);

	Host_Shutdown ();
	exit (1);
}
Пример #22
0
void Sys_Error (char *error, ...)
{ 
    va_list     argptr;
    char        string[1024];

// change stdin to non blocking
    // fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
    
    va_start (argptr,error);
    vsprintf (string,error,argptr);
    va_end (argptr);
	fprintf(stderr, "Error: %s\n", string);

	Host_Shutdown ();
	printf("Sys_Error - exiting.");
	exit (1);

} 
Пример #23
0
void
Sys_Error(const char *error, ...)
{
    va_list argptr;
    char string[MAX_PRINTMSG];

// change stdin to non blocking
    fcntl(STDIN_FILENO, F_SETFL,
	  fcntl(STDIN_FILENO, F_GETFL, 0) & ~O_NONBLOCK);

    va_start(argptr, error);
    vsnprintf(string, sizeof(string), error, argptr);
    va_end(argptr);
    fprintf(stderr, "Error: %s\n", string);

    Host_Shutdown();
    exit(1);
}
Пример #24
0
void Sys_Error (const char *error, ...)
{
	va_list		argptr;
	char		text[MAX_INPUTLINE];
	static int	in_sys_error0 = 0;
	static int	in_sys_error1 = 0;
	static int	in_sys_error2 = 0;
	static int	in_sys_error3 = 0;

	va_start (argptr, error);
	dpvsnprintf (text, sizeof (text), error, argptr);
	va_end (argptr);

	Con_Printf ("Quake Error: %s\n", text);

	// close video so the message box is visible, unless we already tried that
	if (!in_sys_error0 && cls.state != ca_dedicated)
	{
		in_sys_error0 = 1;
		VID_Shutdown();
	}

	if (!in_sys_error3 && cls.state != ca_dedicated)
	{
		in_sys_error3 = true;
		MessageBox(NULL, text, "Quake Error", MB_OK | MB_SETFOREGROUND | MB_ICONSTOP);
	}

	if (!in_sys_error1)
	{
		in_sys_error1 = 1;
		Host_Shutdown ();
	}

// shut down QHOST hooks if necessary
	if (!in_sys_error2)
	{
		in_sys_error2 = 1;
		Sys_Shutdown ();
	}

	exit (1);
}
Пример #25
0
void Sys_Error (const char *error, ...)
{
	va_list argptr;
	char string[MAX_INPUTLINE];

// change stdin to non blocking
#ifdef FNDELAY
	fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
#endif

	va_start (argptr,error);
	dpvsnprintf (string, sizeof (string), error, argptr);
	va_end (argptr);

	Con_Printf ("Quake Error: %s\n", string);

	Host_Shutdown ();
	exit (1);
}
Пример #26
0
void Sys_Error (char *error, ...) {
        extern FILE *qconsole_log;
	va_list argptr;
	char string[1024];

	fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);	//change stdin to non blocking

	if (rtc_fd)
		close(rtc_fd);

	va_start (argptr, error);
	vsnprintf (string, sizeof(string), error, argptr);
	va_end (argptr);
	fprintf(stderr, "Error: %s\n", string);
	if (qconsole_log)
	    fprintf(qconsole_log, "Error: %s\n", string);

	Host_Shutdown ();
	exit (1);
}
Пример #27
0
/*
	Sys_Error
*/
void
Sys_Error (const char *error, ...)
{
	va_list     argptr;
	char        text[1024];

#ifndef _WIN32
	fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
#endif
	va_start (argptr, error);
	vsnprintf (text, sizeof (text), error, argptr);
	va_end (argptr);

#ifdef WIN32
	MessageBox (NULL, text, "Error", 0 /* MB_OK */ );
#endif
	fprintf (stderr, "Error: %s\n", text);

	Host_Shutdown ();
	exit (1);
}
Пример #28
0
void Sys_Error (const char *error, ...)
{
	va_list		argptr;
	char		text[1024];
	DWORD		dummy;

	va_start (argptr, error);
	q_vsnprintf (text, sizeof(text), error, argptr);
	va_end (argptr);

	if (isDedicated)
		WriteFile (houtput, errortxt1, strlen(errortxt1), &dummy, NULL);
	/* SDL will put these into its own stderr log,
	   so print to stderr even in graphical mode. */
	fputs (errortxt1, stderr);
	Host_Shutdown ();
	fputs (errortxt2, stderr);
	fputs (text, stderr);
	fputs ("\n\n", stderr);
	if (!isDedicated)
		PL_ErrorDialog(text);
	else
	{
		WriteFile (houtput, errortxt2, strlen(errortxt2), &dummy, NULL);
		WriteFile (houtput, text,      strlen(text),      &dummy, NULL);
		WriteFile (houtput, "\r\n",    2,		  &dummy, NULL);
		SDL_Delay (3000);	/* show the console 3 more seconds */
	}

// shut down QHOST hooks if necessary
//	DeinitConProc ();

#if defined(_DEBUG) && defined(_WIN32)
	__debugbreak();
#endif

	exit (1);
}
Пример #29
0
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) & ~FNDELAY);
#endif

	va_start (argptr,error);
	dpvsnprintf (string, sizeof (string), error, argptr);
	va_end (argptr);

	Con_Printf ("Quake Error: %s\n", string);

#ifdef WIN32
	MessageBox(NULL, string, "Quake Error", MB_OK | MB_SETFOREGROUND | MB_ICONSTOP);
#endif

	Host_Shutdown ();
	exit (1);
}
Пример #30
0
void Sys_Error (const char *error, ...)
{
	va_list		argptr;
	char		text[MAX_PRINTMSG];

	va_start (argptr, error);
	q_vsnprintf (text, sizeof(text), error, argptr);
	va_end (argptr);

	if (con_debuglog)
	{
		LOG_Print (ERROR_PREFIX);
		LOG_Print (text);
		LOG_Print ("\n\n");
	}

	Sys_EnableTerm();
	Host_Shutdown ();

	fprintf(stderr, ERROR_PREFIX "%s\n\n", text);

// Sys_AtExit is called by exit to shutdown the system
	exit (1);
}