mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 23:11:38 +00:00
Fix the annoying "Unknown interpreter 'id'" error. It was both bogus and a symptom of other problems (also fixed).
This commit is contained in:
parent
0af43cf016
commit
59c077638a
5 changed files with 24 additions and 26 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 ();
|
||||
|
|
|
@ -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 ();
|
||||
|
|
Loading…
Reference in a new issue