diff --git a/include/QF/console.h b/include/QF/console.h index 6f6fb1436..819d214be 100644 --- a/include/QF/console.h +++ b/include/QF/console.h @@ -116,7 +116,6 @@ void Con_BufferAddText (con_buffer_t *buf, const char *text); // init/shutdown functions void Con_Init (const char *plugin_name); -void Con_Init_Cvars (void); void Con_Shutdown (void); void Con_ExecLine (const char *line); diff --git a/libs/console/client.c b/libs/console/client.c index 1dd46445e..2cd3c3e20 100644 --- a/libs/console/client.c +++ b/libs/console/client.c @@ -422,7 +422,7 @@ C_Print (const char *fmt, va_list args) if (!con->x) { Linefeed (); // mark time for transparent overlay - if (con->current >= 0) + if (con->current >= 0 && con_data.realtime) con_times[con->current % NUM_CON_TIMES] = *con_data.realtime; } @@ -560,7 +560,7 @@ DrawInputLine (int x, int y, int cursor, inputline_t *il) } else { Draw_nString (x, y, s, il->width - 1); } - if (cursor) { + if (cursor && con_data.realtime) { float t = *con_data.realtime * con_cursorspeed; int ch = 10 + ((int) (t) & 1); Draw_Character (x + ((il->linepos - il->scroll) << 3), y, ch); @@ -706,6 +706,9 @@ draw_notify (view_t *view) char *text; float time; + if (!con_data.realtime) + return; + x = view->xabs + 8; y = view->yabs; for (i = con->current - NUM_CON_TIMES + 1; i <= con->current; i++) { diff --git a/libs/console/console.c b/libs/console/console.c index b1d2a4f45..9836e33aa 100644 --- a/libs/console/console.c +++ b/libs/console/console.c @@ -57,24 +57,15 @@ static U void (*const display)(const char **, int) = Con_DisplayList; static cvar_t *con_interpreter; -VISIBLE void -Con_Init (const char *plugin_name) -{ - con_module = PI_LoadPlugin ("console", plugin_name); - if (con_module) { - con_module->functions->general->p_Init (); - Sys_SetStdPrintf (con_module->functions->console->pC_Print); - } else { - setvbuf (stdout, 0, _IOLBF, BUFSIZ); - } -} - static void Con_Interp_f (cvar_t *var) { + if (!con_module) + return; + cbuf_interpreter_t *interp = Cmd_GetProvider(var->string); - if (con_module && interp) { + if (interp) { cbuf_t *new; Sys_Printf ("Switching to interpreter '%s'\n", var->string); @@ -92,6 +83,21 @@ Con_Interp_f (cvar_t *var) } } +VISIBLE void +Con_Init (const char *plugin_name) +{ + con_module = PI_LoadPlugin ("console", plugin_name); + if (con_module) { + con_module->functions->general->p_Init (); + Sys_SetStdPrintf (con_module->functions->console->pC_Print); + } else { + setvbuf (stdout, 0, _IOLBF, BUFSIZ); + } + con_interpreter = + Cvar_Get("con_interpreter", "id", CVAR_NONE, Con_Interp_f, + "Interpreter for the interactive console"); +} + VISIBLE void Con_ExecLine (const char *line) { @@ -116,14 +122,6 @@ Con_ExecLine (const char *line) Sys_Printf ("%s\n", line); } -VISIBLE void -Con_Init_Cvars (void) -{ - con_interpreter = - Cvar_Get("con_interpreter", "id", CVAR_NONE, Con_Interp_f, - "Interpreter for the interactive console"); -} - VISIBLE void Con_Shutdown (void) { diff --git a/nq/source/host.c b/nq/source/host.c index 3cd398015..b471098ae 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -922,7 +922,6 @@ Host_Init (void) VID_Init_Cvars (); S_Init_Cvars (); Key_Init_Cvars (); - Con_Init_Cvars (); PR_Init_Cvars (); SV_Progs_Init_Cvars (); R_Init_Cvars (); diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index cde3b08c1..be3821d67 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1775,7 +1775,6 @@ Host_Init (void) CL_Init_Cvars (); CL_Prediction_Init_Cvars (); COM_Init_Cvars (); - Con_Init_Cvars (); Game_Init_Cvars (); IN_Init_Cvars (); Key_Init_Cvars ();