summaryrefslogtreecommitdiff
path: root/src/sys/sys_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/sys_main.c')
-rw-r--r--src/sys/sys_main.c83
1 files changed, 15 insertions, 68 deletions
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index 512c43b8..284a1194 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -108,34 +108,6 @@ void Sys_In_Restart_f( void )
/*
=================
-Sys_ConsoleInputInit
-
-Start the console input subsystem
-=================
-*/
-void Sys_ConsoleInputInit( void )
-{
-#ifdef DEDICATED
- CON_Init( );
-#endif
-}
-
-/*
-=================
-Sys_ConsoleInputShutdown
-
-Shutdown the console input subsystem
-=================
-*/
-void Sys_ConsoleInputShutdown( void )
-{
-#ifdef DEDICATED
- CON_Shutdown( );
-#endif
-}
-
-/*
-=================
Sys_ConsoleInput
Handle new console input
@@ -143,11 +115,7 @@ Handle new console input
*/
char *Sys_ConsoleInput(void)
{
-#ifdef DEDICATED
- return CON_ConsoleInput( );
-#endif
-
- return NULL;
+ return CON_Input( );
}
/*
@@ -159,18 +127,18 @@ Single exit point (regular exit or in case of error)
*/
void Sys_Exit( int ex )
{
- Sys_ConsoleInputShutdown();
+ CON_Shutdown( );
#ifndef DEDICATED
SDL_Quit( );
#endif
#ifdef NDEBUG
- exit(ex);
+ exit( ex );
#else
// Cause a backtrace on error exits
assert( ex == 0 );
- exit(ex);
+ exit( ex );
#endif
}
@@ -179,10 +147,10 @@ void Sys_Exit( int ex )
Sys_Quit
=================
*/
-void Sys_Quit (void)
+void Sys_Quit( void )
{
- CL_Shutdown ();
- Sys_Exit(0);
+ CL_Shutdown( );
+ Sys_Exit( 0 );
}
/*
@@ -227,7 +195,7 @@ Sys_AnsiColorPrint
Transform Q3 colour codes to ANSI escape sequences
=================
*/
-static void Sys_AnsiColorPrint( const char *msg )
+void Sys_AnsiColorPrint( const char *msg )
{
static char buffer[ MAXPRINTMSG ];
int length = 0;
@@ -296,18 +264,8 @@ Sys_Print
*/
void Sys_Print( const char *msg )
{
-#ifdef DEDICATED
- CON_Hide();
-#endif
-
- if( com_ansiColor && com_ansiColor->integer )
- Sys_AnsiColorPrint( msg );
- else
- fputs(msg, stderr);
-
-#ifdef DEDICATED
- CON_Show();
-#endif
+ CON_LogWrite( msg );
+ CON_Print( msg );
}
/*
@@ -320,16 +278,13 @@ void Sys_Error( const char *error, ... )
va_list argptr;
char string[1024];
-#ifdef DEDICATED
- CON_Hide();
-#endif
-
CL_Shutdown ();
va_start (argptr,error);
Q_vsnprintf (string, sizeof(string), error, argptr);
va_end (argptr);
- fprintf(stderr, "Sys_Error: %s\n", string);
+
+ Sys_ErrorDialog( string );
Sys_Exit( 1 );
}
@@ -348,15 +303,7 @@ void Sys_Warn( char *warning, ... )
Q_vsnprintf (string, sizeof(string), warning, argptr);
va_end (argptr);
-#ifdef DEDICATED
- CON_Hide();
-#endif
-
- fprintf(stderr, "Warning: %s", string);
-
-#ifdef DEDICATED
- CON_Show();
-#endif
+ CON_Print( va( "Warning: %s", string ) );
}
/*
@@ -624,9 +571,9 @@ int main( int argc, char **argv )
}
Com_Init( commandLine );
- NET_Init();
+ NET_Init( );
- Sys_ConsoleInputInit();
+ CON_Init( );
#ifndef _WIN32
// Windows doesn't have these signals