More conversion
This commit is contained in:
+21
-37
@@ -50,8 +50,8 @@ int con_current; // where next message will be printed
|
||||
int con_x; // offset in current line for next print
|
||||
char *con_text = NULL;
|
||||
|
||||
cvar_t con_notifytime = {"con_notifytime","3",CVAR_NONE}; //seconds
|
||||
cvar_t con_logcenterprint = {"con_logcenterprint", "1", CVAR_NONE}; //johnfitz
|
||||
convar con_notifytime{"con_notifytime","3"}; //seconds
|
||||
convar con_logcenterprint{"con_logcenterprint", "1"}; //johnfitz
|
||||
|
||||
char con_lastcenterstring[1024]; //johnfitz
|
||||
|
||||
@@ -78,8 +78,8 @@ const char *Con_Quakebar (int len)
|
||||
static char bar[42];
|
||||
int i;
|
||||
|
||||
len = q_min(len, (int)sizeof(bar) - 2);
|
||||
len = q_min(len, con_linewidth);
|
||||
len = std::min(len, (int)sizeof(bar) - 2);
|
||||
len = std::min(len, con_linewidth);
|
||||
|
||||
bar[0] = '\35';
|
||||
for (i = 1; i < len - 1; i++)
|
||||
@@ -331,14 +331,14 @@ void Con_Init (void)
|
||||
|
||||
Con_Printf ("Console initialized.\n");
|
||||
|
||||
Cvar_RegisterVariable (&con_notifytime);
|
||||
Cvar_RegisterVariable (&con_logcenterprint); //johnfitz
|
||||
con_notifytime.inscribe();
|
||||
con_logcenterprint.inscribe(); //johnfitz
|
||||
|
||||
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f);
|
||||
Cmd_AddCommand ("messagemode", Con_MessageMode_f);
|
||||
Cmd_AddCommand ("messagemode2", Con_MessageMode2_f);
|
||||
Cmd_AddCommand ("clear", Con_Clear_f);
|
||||
Cmd_AddCommand ("condump", Con_Dump_f); //johnfitz
|
||||
command::add ("toggleconsole", Con_ToggleConsole_f);
|
||||
command::add ("messagemode", Con_MessageMode_f);
|
||||
command::add ("messagemode2", Con_MessageMode2_f);
|
||||
command::add ("clear", Con_Clear_f);
|
||||
command::add ("condump", Con_Dump_f); //johnfitz
|
||||
con_initialized = true;
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ void Con_CenterPrintf (int linewidth, const char *fmt, ...)
|
||||
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
linewidth = q_min(linewidth, con_linewidth);
|
||||
linewidth = std::min(linewidth, con_linewidth);
|
||||
for (src = msg; *src; )
|
||||
{
|
||||
dst = line;
|
||||
@@ -727,21 +727,7 @@ tab_t *tablist;
|
||||
|
||||
//defs from elsewhere
|
||||
extern qboolean keydown[256];
|
||||
typedef struct cmd_function_s
|
||||
{
|
||||
struct cmd_function_s *next;
|
||||
const char *name;
|
||||
xcommand_t function;
|
||||
} cmd_function_t;
|
||||
extern cmd_function_t *cmd_functions;
|
||||
#define MAX_ALIAS_NAME 32
|
||||
typedef struct cmdalias_s
|
||||
{
|
||||
struct cmdalias_s *next;
|
||||
char name[MAX_ALIAS_NAME];
|
||||
char *value;
|
||||
} cmdalias_t;
|
||||
extern cmdalias_t *cmd_alias;
|
||||
|
||||
/*
|
||||
============
|
||||
@@ -897,8 +883,6 @@ BuildTabList -- johnfitz
|
||||
*/
|
||||
void BuildTabList (const char *partial)
|
||||
{
|
||||
cmdalias_t *alias;
|
||||
cmd_function_t *cmd;
|
||||
int len;
|
||||
|
||||
tablist = NULL;
|
||||
@@ -907,17 +891,17 @@ void BuildTabList (const char *partial)
|
||||
bash_partial[0] = 0;
|
||||
bash_singlematch = 1;
|
||||
|
||||
for (auto cvar : std::ranges::views::values(CLIENT_VARIABLES))
|
||||
if (!Q_strncmp (partial, cvar->name, len))
|
||||
AddToTabList (cvar->name, "cvar");
|
||||
for (const auto cvar : convar::get_variables())
|
||||
if (!Q_strncmp (partial, cvar->name.c_str(), len))
|
||||
AddToTabList (cvar->name.c_str(), "cvar");
|
||||
|
||||
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
|
||||
if (!Q_strncmp (partial,cmd->name, len))
|
||||
AddToTabList (cmd->name, "command");
|
||||
for (const auto &ccmd : command::get_commands())
|
||||
if (!Q_strncmp (partial,ccmd.name.c_str(), len))
|
||||
AddToTabList (ccmd.name.c_str(), "command");
|
||||
|
||||
for (alias=cmd_alias ; alias ; alias=alias->next)
|
||||
if (!Q_strncmp (partial, alias->name, len))
|
||||
AddToTabList (alias->name, "alias");
|
||||
for (const auto &alias : command::get_aliases())
|
||||
if (!Q_strncmp (partial, alias.name.c_str(), len))
|
||||
AddToTabList (alias.name.c_str(), "alias");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user