예제 #1
0
/*
=============
Sys_Error

Show the early console as an error dialog
=============
*/
void QDECL Sys_Error( const char *error, ... ) {
	va_list		argptr;
	char		text[4096];
    MSG        msg;

	va_start (argptr, error);
	vsprintf (text, error, argptr);
	va_end (argptr);

	Conbuf_AppendText( text );
	Conbuf_AppendText( "\n" );

	Sys_SetErrorText( text );
	Sys_ShowConsole( 1, qtrue );

	timeEndPeriod( 1 );

	IN_Shutdown();

	// wait for the user to quit
	while ( 1 ) {
		if (!GetMessage (&msg, NULL, 0, 0))
			Com_Quit_f ();
		TranslateMessage (&msg);
      	DispatchMessage (&msg);
	}

	Sys_DestroyConsole();
  	Com_ShutdownZoneMemory();
  	Com_ShutdownHunkMemory();

	exit (1);
}
예제 #2
0
/*
=================
Sys_Error
=================
*/
void Sys_Error( const char *error, ... ) {
	va_list argptr;
	char    string[4096];
#if defined (_WIN32) && !defined (_DEBUG)
	MSG		msg;
#endif

	va_start (argptr,error);
	idStr::vsnPrintf (string, sizeof(string), error, argptr);
	va_end (argptr);

#if defined (_WIN32) && !defined (_DEBUG)
	Conbuf_AppendText( string );
	Conbuf_AppendText( "\n" );
#else
	// Print text in the console window/box
	Sys_Print( string );
	Sys_Print( "\n" );
#endif

#if defined (_WIN32) && !defined (_DEBUG)
	Sys_SetErrorText( string );
	Sys_ShowConsole( 1, qtrue );

	timeEndPeriod( 1 );

	IN_Shutdown();

	// wait for the user to quit
	while ( 1 ) {
		if ( !GetMessage( &msg, NULL, 0, 0 ) ) {
			Com_Quit_f();
		}
		TranslateMessage( &msg );
		DispatchMessage( &msg );
	}

	Sys_DestroyConsole();
#endif

	CL_Shutdown( );
	Sys_ErrorDialog( string );

	Sys_Exit( 1 );
}
예제 #3
0
파일: sys_win.c 프로젝트: chrisnew/quake2
void Sys_Error (const char *error, ...)
{
	va_list		argptr;
	char		text[1024];

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

	timeEndPeriod( 1 );

	CL_Shutdown ();
	Qcommon_Shutdown ();

	if (qDedConsole)
	{
		MSG		msg;
		BOOL	bRet;

		Conbuf_AppendText( text );
		Conbuf_AppendText( "\n" );

		Sys_SetErrorText( text );
		Sys_ShowConsole( 1, true );

		// wait for the user to quit
		while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) {
			if (bRet == -1)
				break;

			TranslateMessage (&msg);
      		DispatchMessage (&msg);

			Sleep(25);
		}
	}
	else
	{
		MessageBox(NULL, text, "Error", 0 /* MB_OK */ );
	}

	Sys_DestroyConsole();

	exit (1);
}
예제 #4
0
/*
=================
Sys_Error
=================
*/
void Sys_Error(const char *error, ...)
{
	va_list argptr;
	char    string[1024];
#ifdef USE_WINDOWS_CONSOLE
	MSG msg;
#endif

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

#ifdef _WIN32
	Sys_Splash(qfalse);
#endif

#ifdef USE_WINDOWS_CONSOLE
	Conbuf_AppendText(string);
	Conbuf_AppendText("\n");

	Sys_SetErrorText(string);
	Sys_ShowConsoleWindow(1, qtrue);

	IN_Shutdown();

	// wait for the user to quit
	while (1)
	{
		if (!GetMessage(&msg, NULL, 0, 0))
		{
			Com_Quit_f();
		}

		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	Sys_DestroyConsole();
#endif

	Sys_ErrorDialog(string);

	Sys_Exit(3);
}