Fix the annoying "Unknown interpreter 'id'" error. It was both bogus and a symptom of other problems (also fixed).

This commit is contained in:
Bill Currie 2009-03-16 11:49:52 +00:00 committed by Jeff Teunissen
parent 0af43cf016
commit 59c077638a
5 changed files with 24 additions and 26 deletions

View file

@ -116,7 +116,6 @@ void Con_BufferAddText (con_buffer_t *buf, const char *text);
// init/shutdown functions // init/shutdown functions
void Con_Init (const char *plugin_name); void Con_Init (const char *plugin_name);
void Con_Init_Cvars (void);
void Con_Shutdown (void); void Con_Shutdown (void);
void Con_ExecLine (const char *line); void Con_ExecLine (const char *line);

View file

@ -422,7 +422,7 @@ C_Print (const char *fmt, va_list args)
if (!con->x) { if (!con->x) {
Linefeed (); Linefeed ();
// mark time for transparent overlay // 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; 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 { } else {
Draw_nString (x, y, s, il->width - 1); Draw_nString (x, y, s, il->width - 1);
} }
if (cursor) { if (cursor && con_data.realtime) {
float t = *con_data.realtime * con_cursorspeed; float t = *con_data.realtime * con_cursorspeed;
int ch = 10 + ((int) (t) & 1); int ch = 10 + ((int) (t) & 1);
Draw_Character (x + ((il->linepos - il->scroll) << 3), y, ch); Draw_Character (x + ((il->linepos - il->scroll) << 3), y, ch);
@ -706,6 +706,9 @@ draw_notify (view_t *view)
char *text; char *text;
float time; float time;
if (!con_data.realtime)
return;
x = view->xabs + 8; x = view->xabs + 8;
y = view->yabs; y = view->yabs;
for (i = con->current - NUM_CON_TIMES + 1; i <= con->current; i++) { for (i = con->current - NUM_CON_TIMES + 1; i <= con->current; i++) {

View file

@ -57,24 +57,15 @@ static U void (*const display)(const char **, int) = Con_DisplayList;
static cvar_t *con_interpreter; 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 static void
Con_Interp_f (cvar_t *var) Con_Interp_f (cvar_t *var)
{ {
if (!con_module)
return;
cbuf_interpreter_t *interp = Cmd_GetProvider(var->string); cbuf_interpreter_t *interp = Cmd_GetProvider(var->string);
if (con_module && interp) { if (interp) {
cbuf_t *new; cbuf_t *new;
Sys_Printf ("Switching to interpreter '%s'\n", var->string); 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 VISIBLE void
Con_ExecLine (const char *line) Con_ExecLine (const char *line)
{ {
@ -116,14 +122,6 @@ Con_ExecLine (const char *line)
Sys_Printf ("%s\n", 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 VISIBLE void
Con_Shutdown (void) Con_Shutdown (void)
{ {

View file

@ -922,7 +922,6 @@ Host_Init (void)
VID_Init_Cvars (); VID_Init_Cvars ();
S_Init_Cvars (); S_Init_Cvars ();
Key_Init_Cvars (); Key_Init_Cvars ();
Con_Init_Cvars ();
PR_Init_Cvars (); PR_Init_Cvars ();
SV_Progs_Init_Cvars (); SV_Progs_Init_Cvars ();
R_Init_Cvars (); R_Init_Cvars ();

View file

@ -1775,7 +1775,6 @@ Host_Init (void)
CL_Init_Cvars (); CL_Init_Cvars ();
CL_Prediction_Init_Cvars (); CL_Prediction_Init_Cvars ();
COM_Init_Cvars (); COM_Init_Cvars ();
Con_Init_Cvars ();
Game_Init_Cvars (); Game_Init_Cvars ();
IN_Init_Cvars (); IN_Init_Cvars ();
Key_Init_Cvars (); Key_Init_Cvars ();