Quake II RTX doxygen  1.0 dev
console.c File Reference
#include "client.h"

Go to the source code of this file.

Classes

struct  console_s
 

Macros

#define CON_TIMES   16
 
#define CON_TIMES_MASK   (CON_TIMES - 1)
 
#define CON_TOTALLINES   1024
 
#define CON_TOTALLINES_MASK   (CON_TOTALLINES - 1)
 
#define CON_LINEWIDTH   100
 
#define CON_PRESTEP   (CHAR_HEIGHT * 3 + CHAR_HEIGHT / 4)
 
#define APP_VERSION   APPLICATION " " VERSION_STRING
 
#define VER_WIDTH   ((int)(sizeof(APP_VERSION) + 1) * CHAR_WIDTH)
 

Typedefs

typedef struct console_s console_t
 

Enumerations

enum  chatMode_t { CHAT_NONE, CHAT_DEFAULT, CHAT_TEAM }
 
enum  consoleMode_t { CON_POPUP, CON_DEFAULT, CON_CHAT, CON_REMOTE }
 

Functions

void Con_SkipNotify (qboolean skip)
 
void Con_ClearTyping (void)
 
void Con_Close (qboolean force)
 
void Con_Popup (qboolean force)
 
static void toggle_console (consoleMode_t mode, chatMode_t chat)
 
void Con_ToggleConsole_f (void)
 
static void Con_ToggleChat_f (void)
 
static void Con_ToggleChat2_f (void)
 
static void Con_Clear_f (void)
 
static void Con_Dump_c (genctx_t *ctx, int argnum)
 
static void Con_Dump_f (void)
 
void Con_ClearNotify_f (void)
 
static void start_message_mode (chatMode_t mode)
 
static void Con_MessageMode_f (void)
 
static void Con_MessageMode2_f (void)
 
static void Con_RemoteMode_f (void)
 
static void CL_RemoteMode_c (genctx_t *ctx, int argnum)
 
void Con_CheckResize (void)
 
static void Con_CheckTop (void)
 
static void con_param_changed (cvar_t *self)
 
static void con_scale_changed (cvar_t *self)
 
void Con_Init (void)
 
void Con_PostInit (void)
 
void Con_Shutdown (void)
 
static void Con_CarriageRet (void)
 
static void Con_Linefeed (void)
 
void Con_SetColor (color_index_t color)
 
void CL_LoadState (load_state_t state)
 
void Con_Print (const char *txt)
 
void Con_Printf (const char *fmt,...)
 
void Con_RegisterMedia (void)
 
static int Con_DrawLine (int v, int line, float alpha)
 
static void Con_DrawNotify (void)
 
static void Con_DrawSolidConsole (void)
 
void Con_RunConsole (void)
 
void Con_DrawConsole (void)
 
static void Con_Say (char *msg)
 
static void Con_InteractiveMode (void)
 
static void Con_Action (void)
 
static void Con_Paste (void)
 
void Key_Console (int key)
 
void Char_Console (int key)
 
void Key_Message (int key)
 
void Char_Message (int key)
 

Variables

static console_t con
 
static cvar_t * con_notifytime
 
static cvar_t * con_notifylines
 
static cvar_t * con_clock
 
static cvar_t * con_height
 
static cvar_t * con_speed
 
static cvar_t * con_alpha
 
static cvar_t * con_scale
 
static cvar_t * con_font
 
static cvar_t * con_background
 
static cvar_t * con_scroll
 
static cvar_t * con_history
 
static const cmdreg_t c_console []
 

Macro Definition Documentation

◆ APP_VERSION

#define APP_VERSION   APPLICATION " " VERSION_STRING

◆ CON_LINEWIDTH

#define CON_LINEWIDTH   100

Definition at line 28 of file console.c.

◆ CON_PRESTEP

#define CON_PRESTEP   (CHAR_HEIGHT * 3 + CHAR_HEIGHT / 4)

Definition at line 695 of file console.c.

◆ CON_TIMES

#define CON_TIMES   16

Definition at line 22 of file console.c.

◆ CON_TIMES_MASK

#define CON_TIMES_MASK   (CON_TIMES - 1)

Definition at line 23 of file console.c.

◆ CON_TOTALLINES

#define CON_TOTALLINES   1024

Definition at line 25 of file console.c.

◆ CON_TOTALLINES_MASK

#define CON_TOTALLINES_MASK   (CON_TOTALLINES - 1)

Definition at line 26 of file console.c.

◆ VER_WIDTH

#define VER_WIDTH   ((int)(sizeof(APP_VERSION) + 1) * CHAR_WIDTH)

Typedef Documentation

◆ console_t

typedef struct console_s console_t

Enumeration Type Documentation

◆ chatMode_t

enum chatMode_t
Enumerator
CHAT_NONE 
CHAT_DEFAULT 
CHAT_TEAM 

Definition at line 30 of file console.c.

30  {
31  CHAT_NONE,
33  CHAT_TEAM
34 } chatMode_t;

◆ consoleMode_t

Enumerator
CON_POPUP 
CON_DEFAULT 
CON_CHAT 
CON_REMOTE 

Definition at line 36 of file console.c.

36  {
37  CON_POPUP,
39  CON_CHAT,

Function Documentation

◆ Char_Console()

void Char_Console ( int  key)

Definition at line 1229 of file console.c.

1230 {
1231  if (IF_CharEvent(&con.prompt.inputLine, key)) {
1233  }
1234 }

Referenced by Key_Event().

◆ Char_Message()

void Char_Message ( int  key)

Definition at line 1289 of file console.c.

1290 {
1291  IF_CharEvent(&con.chatPrompt.inputLine, key);
1292 }

Referenced by Key_Event().

◆ CL_LoadState()

void CL_LoadState ( load_state_t  state)

Definition at line 541 of file console.c.

542 {
543  con.loadstate = state;
545  VID_PumpEvents();
546 }

Referenced by CL_Begin(), CL_Precache_f(), CL_PrepRefresh(), CL_RestartFilesystem(), and CL_RestartRefresh().

◆ CL_RemoteMode_c()

static void CL_RemoteMode_c ( genctx_t *  ctx,
int  argnum 
)
static

Definition at line 353 of file console.c.

354 {
355  if (argnum == 1) {
356  Com_Address_g(ctx);
357  }
358 }

◆ Con_Action()

static void Con_Action ( void  )
static

Definition at line 1062 of file console.c.

1063 {
1064  char *cmd = Prompt_Action(&con.prompt);
1065 
1067 
1068  if (!cmd) {
1069  Con_Printf("]\n");
1070  return;
1071  }
1072 
1073  // backslash text are commands, else chat
1074  if (cmd[0] == '\\' || cmd[0] == '/') {
1075  Cbuf_AddText(&cmd_buffer, cmd + 1); // skip slash
1076  Cbuf_AddText(&cmd_buffer, "\n");
1077  } else {
1078  if (con.mode == CON_REMOTE) {
1080  } else if (cls.state == ca_active && con.mode == CON_CHAT) {
1081  Con_Say(cmd);
1082  } else {
1083  Cbuf_AddText(&cmd_buffer, cmd);
1084  Cbuf_AddText(&cmd_buffer, "\n");
1085  }
1086  }
1087 
1088  Con_Printf("]%s\n", cmd);
1089 
1090  if (cls.state == ca_disconnected) {
1091  // force an update, because the command may take some time
1092  SCR_UpdateScreen();
1093  }
1094 }

Referenced by Con_Paste(), and Key_Console().

◆ Con_CarriageRet()

static void Con_CarriageRet ( void  )
static

Definition at line 499 of file console.c.

500 {
501  char *p;
502 
504  memset(p, 0, sizeof(con.text[0]));
505 
506  // add color from last line
507  con.x = 0;
508  p[con.x++] = con.color;
509 
510  // update time for transparent overlay
511  if (!con.skipNotify) {
513  }
514 }

Referenced by Con_Linefeed(), and Con_Print().

◆ Con_CheckResize()

void Con_CheckResize ( void  )

Definition at line 367 of file console.c.

368 {
369  int width;
370 
372 
373  con.vidWidth = r_config.width * con.scale;
374  con.vidHeight = r_config.height * con.scale;
375 
376  width = (con.vidWidth / CHAR_WIDTH) - 2;
377 
379  con.prompt.inputLine.visibleChars = con.linewidth;
380  con.prompt.widthInChars = con.linewidth - 1; // account for color byte
381  con.chatPrompt.inputLine.visibleChars = con.linewidth;
382 }

Referenced by Con_Init(), con_scale_changed(), and SCR_ModeChanged().

◆ Con_CheckTop()

static void Con_CheckTop ( void  )
static

Definition at line 391 of file console.c.

392 {
393  int top = con.current - CON_TOTALLINES + 1;
394 
395  if (top < 1) {
396  top = 1;
397  }
398  if (con.display < top) {
399  con.display = top;
400  }
401 }

Referenced by Con_Linefeed(), and Key_Console().

◆ Con_Clear_f()

static void Con_Clear_f ( void  )
static

Definition at line 214 of file console.c.

215 {
216  memset(con.text, 0, sizeof(con.text));
218 }

Referenced by Key_Console().

◆ Con_ClearNotify_f()

void Con_ClearNotify_f ( void  )

Definition at line 276 of file console.c.

277 {
278  int i;
279 
280  for (i = 0; i < CON_TIMES; i++)
281  con.times[i] = 0;
282 }

Referenced by CL_PrepRefresh(), Con_Close(), SCR_CenterPrint(), SCR_EndLoadingPlaque(), and toggle_console().

◆ Con_ClearTyping()

void Con_ClearTyping ( void  )

Definition at line 109 of file console.c.

110 {
111  // clear any typing
112  IF_Clear(&con.prompt.inputLine);
114 }

Referenced by Con_Close(), and toggle_console().

◆ Con_Close()

void Con_Close ( qboolean  force)

Definition at line 124 of file console.c.

125 {
126  if (con.mode > CON_POPUP && !force) {
127  return;
128  }
129 
130  // if not connected, console or menu should be up
131  if (cls.state < ca_active && !(cls.key_dest & KEY_MENU)) {
132  return;
133  }
134 
135  Con_ClearTyping();
137 
138  Key_SetDest(cls.key_dest & ~KEY_CONSOLE);
139 
141  con.mode = CON_POPUP;
142  con.chat = CHAT_NONE;
143 }

Referenced by CL_RestartFilesystem(), CL_RestartRefresh(), Key_Event(), SCR_PlayCinematic(), set_active_state(), start_message_mode(), and UI_PushMenu().

◆ Con_DrawConsole()

void Con_DrawConsole ( void  )

Definition at line 1032 of file console.c.

1033 {
1034  R_SetScale(con.scale);
1036  Con_DrawNotify();
1037  R_SetScale(1.0f);
1038 }

Referenced by SCR_UpdateScreen().

◆ Con_DrawLine()

static int Con_DrawLine ( int  v,
int  line,
float  alpha 
)
static

Definition at line 665 of file console.c.

666 {
667  char *p = con.text[line & CON_TOTALLINES_MASK];
668  color_index_t c = *p;
669  color_t color;
670  int flags = 0;
671 
672  switch (c) {
673  case COLOR_ALT:
674  flags = UI_ALTCOLOR;
675  // fall through
676  case COLOR_NONE:
677  R_ClearColor();
678  if (alpha != 1) {
679  R_SetAlpha(alpha);
680  }
681  break;
682  default:
683  color.u32 = colorTable[c & 7];
684  if (alpha != 1) {
685  color.u8[3] = alpha * 255;
686  }
687  R_SetColor(color.u32);
688  break;
689  }
690 
691  return R_DrawString(CHAR_WIDTH, v, flags, con.linewidth - 1, p + 1,
692  con.charsetImage);
693 }

Referenced by Con_DrawNotify(), and Con_DrawSolidConsole().

◆ Con_DrawNotify()

static void Con_DrawNotify ( void  )
static

Definition at line 704 of file console.c.

705 {
706  int v;
707  char *text;
708  int i, j;
709  unsigned time;
710  int skip;
711  float alpha;
712 
713  // only draw notify in game
714  if (cls.state != ca_active) {
715  return;
716  }
717  if (cls.key_dest & (KEY_MENU | KEY_CONSOLE)) {
718  return;
719  }
720  if (con.currentHeight) {
721  return;
722  }
723 
724  j = con_notifylines->integer;
725  if (j > CON_TIMES) {
726  j = CON_TIMES;
727  }
728 
729  v = 0;
730  for (i = con.current - j + 1; i <= con.current; i++) {
731  if (i < 0)
732  continue;
733  time = con.times[i & CON_TIMES_MASK];
734  if (time == 0)
735  continue;
736  // alpha fade the last string left on screen
737  alpha = SCR_FadeAlpha(time, con_notifytime->value * 1000, 300);
738  if (!alpha)
739  continue;
740  if (v || i != con.current) {
741  alpha = 1; // don't fade
742  }
743 
744  Con_DrawLine(v, i, alpha);
745 
746  v += CHAR_HEIGHT;
747  }
748 
749  R_ClearColor();
750 
751  if (cls.key_dest & KEY_MESSAGE) {
752  if (con.chat == CHAT_TEAM) {
753  text = "say_team:";
754  skip = 11;
755  } else {
756  text = "say:";
757  skip = 5;
758  }
759 
760  R_DrawString(CHAR_WIDTH, v, 0, MAX_STRING_CHARS, text,
761  con.charsetImage);
762  con.chatPrompt.inputLine.visibleChars = con.linewidth - skip + 1;
763  IF_Draw(&con.chatPrompt.inputLine, skip * CHAR_WIDTH, v,
764  UI_DRAWCURSOR, con.charsetImage);
765  }
766 }

Referenced by Con_DrawConsole().

◆ Con_DrawSolidConsole()

static void Con_DrawSolidConsole ( void  )
static

Definition at line 775 of file console.c.

776 {
777  int i, x, y;
778  int rows;
779  char *text;
780  int row;
781  char buffer[CON_LINEWIDTH];
782  int vislines;
783  float alpha;
784  int widths[2];
785 
786  vislines = con.vidHeight * con.currentHeight;
787  if (vislines <= 0)
788  return;
789 
790  if (vislines > con.vidHeight)
791  vislines = con.vidHeight;
792 
793 // setup transparency
794  if (cls.state >= ca_active && !(cls.key_dest & KEY_MENU) && con_alpha->value) {
795  alpha = 0.5f + 0.5f * (con.currentHeight / con_height->value);
796  R_SetAlpha(alpha * Cvar_ClampValue(con_alpha, 0, 1));
797  }
798 
799 // draw the background
800  if (cls.state < ca_active || (cls.key_dest & KEY_MENU) || con_alpha->value) {
801  R_DrawStretchPic(0, vislines - con.vidHeight,
803  }
804 
805 // draw the text
806  y = vislines - CON_PRESTEP;
807  rows = y / CHAR_HEIGHT + 1; // rows of text to draw
808 
809 // draw arrows to show the buffer is backscrolled
810  if (con.display != con.current) {
811  R_SetColor(U32_RED);
812  for (i = 1; i < con.linewidth / 2; i += 4) {
813  R_DrawChar(i * CHAR_WIDTH, y, 0, '^', con.charsetImage);
814  }
815 
816  y -= CHAR_HEIGHT;
817  rows--;
818  }
819 
820 // draw from the bottom up
821  R_ClearColor();
822  row = con.display;
823  widths[0] = widths[1] = 0;
824  for (i = 0; i < rows; i++) {
825  if (row < 0)
826  break;
827  if (con.current - row > CON_TOTALLINES - 1)
828  break; // past scrollback wrap point
829 
830  x = Con_DrawLine(y, row, 1);
831  if (i < 2) {
832  widths[i] = x;
833  }
834 
835  y -= CHAR_HEIGHT;
836  row--;
837  }
838 
839  R_ClearColor();
840 
841  // draw the download bar
842  if (cls.download.current) {
843  int n, j;
844 
845  if ((text = strrchr(cls.download.current->path, '/')) != NULL)
846  text++;
847  else
848  text = cls.download.current->path;
849 
850  // figure out width
851  x = con.linewidth;
852  y = x - strlen(text) - 18;
853  i = x / 3;
854  if (strlen(text) > i) {
855  y = x - i - 21;
856  strncpy(buffer, text, i);
857  buffer[i] = 0;
858  strcat(buffer, "...");
859  } else {
860  strcpy(buffer, text);
861  }
862  strcat(buffer, ": ");
863  i = strlen(buffer);
864  buffer[i++] = '\x80';
865  // where's the dot go?
866  n = y * cls.download.percent / 100;
867  for (j = 0; j < y; j++) {
868  if (j == n) {
869  buffer[i++] = '\x83';
870  } else {
871  buffer[i++] = '\x81';
872  }
873  }
874  buffer[i++] = '\x82';
875  buffer[i] = 0;
876 
877  Q_snprintf(buffer + i, sizeof(buffer) - i, " %02d%% (%d kB)",
879 
880  // draw it
881  y = vislines - CON_PRESTEP + CHAR_HEIGHT * 2;
882  R_DrawString(CHAR_WIDTH, y, 0, CON_LINEWIDTH, buffer, con.charsetImage);
883  } else if (cls.state == ca_loading) {
884  // draw loading state
885  switch (con.loadstate) {
886  case LOAD_MAP:
887  text = cl.configstrings[CS_MODELS + 1];
888  break;
889  case LOAD_MODELS:
890  text = "models";
891  break;
892  case LOAD_IMAGES:
893  text = "images";
894  break;
895  case LOAD_CLIENTS:
896  text = "clients";
897  break;
898  case LOAD_SOUNDS:
899  text = "sounds";
900  break;
901  default:
902  text = NULL;
903  break;
904  }
905 
906  if (text) {
907  Q_snprintf(buffer, sizeof(buffer), "Loading %s...", text);
908 
909  // draw it
910  y = vislines - CON_PRESTEP + CHAR_HEIGHT * 2;
911  R_DrawString(CHAR_WIDTH, y, 0, CON_LINEWIDTH, buffer, con.charsetImage);
912  }
913  }
914 
915 // draw the input prompt, user text, and cursor if desired
916  x = 0;
917  if (cls.key_dest & KEY_CONSOLE) {
918  y = vislines - CON_PRESTEP + CHAR_HEIGHT;
919 
920  // draw command prompt
921  switch (con.mode) {
922  case CON_CHAT:
923  i = '&';
924  break;
925  case CON_REMOTE:
926  i = '#';
927  break;
928  default:
929  i = 17;
930  break;
931  }
932  R_SetColor(U32_YELLOW);
933  R_DrawChar(CHAR_WIDTH, y, 0, i, con.charsetImage);
934  R_ClearColor();
935 
936  // draw input line
937  x = IF_Draw(&con.prompt.inputLine, 2 * CHAR_WIDTH, y,
938  UI_DRAWCURSOR, con.charsetImage);
939  }
940 
941 #define APP_VERSION APPLICATION " " VERSION_STRING
942 #define VER_WIDTH ((int)(sizeof(APP_VERSION) + 1) * CHAR_WIDTH)
943 
944  y = vislines - CON_PRESTEP + CHAR_HEIGHT;
945  row = 0;
946  // shift version upwards to prevent overdraw
947  if (x > con.vidWidth - VER_WIDTH) {
948  y -= CHAR_HEIGHT;
949  row++;
950  }
951 
952  R_SetColor(U32_CYAN);
953 
954 // draw clock
955  if (con_clock->integer) {
956  x = Com_Time_m(buffer, sizeof(buffer)) * CHAR_WIDTH;
957  if (widths[row] + x + CHAR_WIDTH <= con.vidWidth) {
958  R_DrawString(con.vidWidth - CHAR_WIDTH - x, y - CHAR_HEIGHT,
959  UI_RIGHT, MAX_STRING_CHARS, buffer, con.charsetImage);
960  }
961  }
962 
963 // draw version
964  if (!row || widths[0] + VER_WIDTH <= con.vidWidth) {
965  SCR_DrawStringEx(con.vidWidth - CHAR_WIDTH, y, UI_RIGHT,
966  MAX_STRING_CHARS, APP_VERSION, con.charsetImage);
967  }
968 
969  // restore rendering parameters
970  R_ClearColor();
971 }

Referenced by Con_DrawConsole().

◆ Con_Dump_c()

static void Con_Dump_c ( genctx_t *  ctx,
int  argnum 
)
static

Definition at line 220 of file console.c.

221 {
222  if (argnum == 1) {
223  FS_File_g("condumps", ".txt", FS_SEARCH_STRIPEXT, ctx);
224  }
225 }

◆ Con_Dump_f()

static void Con_Dump_f ( void  )
static

Definition at line 234 of file console.c.

235 {
236  int l;
237  char *line;
238  qhandle_t f;
239  char name[MAX_OSPATH];
240 
241  if (Cmd_Argc() != 2) {
242  Com_Printf("Usage: %s <filename>\n", Cmd_Argv(0));
243  return;
244  }
245 
246  f = FS_EasyOpenFile(name, sizeof(name), FS_MODE_WRITE | FS_FLAG_TEXT,
247  "condumps/", Cmd_Argv(1), ".txt");
248  if (!f) {
249  return;
250  }
251 
252  // skip empty lines
253  for (l = con.current - CON_TOTALLINES + 1; l <= con.current; l++) {
254  if (con.text[l & CON_TOTALLINES_MASK][0]) {
255  break;
256  }
257  }
258 
259  // write the remaining lines
260  for (; l <= con.current; l++) {
261  line = con.text[l & CON_TOTALLINES_MASK];
262  FS_FPrintf(f, "%s\n", line + 1);
263  }
264 
265  FS_FCloseFile(f);
266 
267  Com_Printf("Dumped console text to %s.\n", name);
268 }

◆ Con_Init()

void Con_Init ( void  )

Definition at line 436 of file console.c.

437 {
438  memset(&con, 0, sizeof(con));
439 
440 //
441 // register our commands
442 //
444 
445  con_notifytime = Cvar_Get("con_notifytime", "3", 0);
446  con_notifylines = Cvar_Get("con_notifylines", "4", 0);
447  con_clock = Cvar_Get("con_clock", "0", 0);
448  con_height = Cvar_Get("con_height", "0.5", 0);
449  con_speed = Cvar_Get("scr_conspeed", "3", 0);
450  con_alpha = Cvar_Get("con_alpha", "1", 0);
451  con_scale = Cvar_Get("con_scale", "1", 0);
452  con_scale->changed = con_scale_changed;
453  con_font = Cvar_Get("con_font", "conchars", 0);
454  con_font->changed = con_param_changed;
455  con_background = Cvar_Get("con_background", "conback", 0);
457  con_scroll = Cvar_Get("con_scroll", "0", 0);
458  con_history = Cvar_Get("con_history", "0", 0);
459 
460  IF_Init(&con.prompt.inputLine, 0, MAX_FIELD_TEXT - 1);
461  IF_Init(&con.chatPrompt.inputLine, 0, MAX_FIELD_TEXT - 1);
462 
463  con.prompt.printf = Con_Printf;
464 
465  // use default width since no video is initialized yet
466  r_config.width = 640;
467  r_config.height = 480;
468  con.linewidth = -1;
469  con.scale = 1;
470  con.color = COLOR_NONE;
471  con.text[0][0] = COLOR_NONE;
472  con.x = 1;
473 
474  Con_CheckResize();
475 
476  con.initialized = qtrue;
477 }

Referenced by Qcommon_Init().

◆ Con_InteractiveMode()

static void Con_InteractiveMode ( void  )
static

Definition at line 1055 of file console.c.

1056 {
1057  if (con.mode == CON_POPUP) {
1058  con.mode = CON_DEFAULT;
1059  }
1060 }

Referenced by Char_Console(), Con_Action(), Con_Paste(), and Key_Console().

◆ Con_Linefeed()

static void Con_Linefeed ( void  )
static

Definition at line 516 of file console.c.

517 {
518  if (con.display == con.current)
519  con.display++;
520  con.current++;
521 
522  Con_CarriageRet();
523 
524  if (con_scroll->integer & 2) {
526  } else {
527  Con_CheckTop();
528  }
529 }

Referenced by Con_Print().

◆ Con_MessageMode2_f()

static void Con_MessageMode2_f ( void  )
static

Definition at line 311 of file console.c.

312 {
314 }

◆ Con_MessageMode_f()

static void Con_MessageMode_f ( void  )
static

Definition at line 306 of file console.c.

307 {
309 }

◆ con_param_changed()

static void con_param_changed ( cvar_t *  self)
static

Definition at line 403 of file console.c.

404 {
407  }
408 }

Referenced by Con_Init().

◆ Con_Paste()

static void Con_Paste ( void  )
static

Definition at line 1096 of file console.c.

1097 {
1098  char *cbd, *s;
1099 
1101 
1102  if ((cbd = VID_GetClipboardData()) == NULL) {
1103  return;
1104  }
1105 
1106  s = cbd;
1107  while (*s) {
1108  int c = *s++;
1109  switch (c) {
1110  case '\n':
1111  if (*s) {
1112  Con_Action();
1113  }
1114  break;
1115  case '\r':
1116  case '\t':
1117  IF_CharEvent(&con.prompt.inputLine, ' ');
1118  break;
1119  default:
1120  if (Q_isprint(c)) {
1121  IF_CharEvent(&con.prompt.inputLine, c);
1122  }
1123  break;
1124  }
1125  }
1126 
1127  Z_Free(cbd);
1128 }

Referenced by Key_Console().

◆ Con_Popup()

void Con_Popup ( qboolean  force)

Definition at line 152 of file console.c.

153 {
154  if (force) {
155  con.mode = CON_POPUP;
156  }
157 
158  Key_SetDest(cls.key_dest | KEY_CONSOLE);
159  Con_RunConsole();
160 }

Referenced by CL_CheckForResend(), CL_Connect_f(), CL_PlayDemo_f(), CL_RestartFilesystem(), and CL_RestartRefresh().

◆ Con_PostInit()

void Con_PostInit ( void  )

Definition at line 479 of file console.c.

480 {
481  if (con_history->integer > 0) {
482  Prompt_LoadHistory(&con.prompt, COM_HISTORYFILE_NAME);
483  }
484 }

Referenced by CL_Init().

◆ Con_Print()

void Con_Print ( const char *  txt)

Definition at line 557 of file console.c.

558 {
559  char *p;
560  int l;
561 
562  if (!con.initialized)
563  return;
564 
565  while (*txt) {
566  if (con.newline) {
567  if (con.newline == '\n') {
568  Con_Linefeed();
569  } else {
570  Con_CarriageRet();
571  }
572  con.newline = 0;
573  }
574 
575  // count word length
576  for (p = (char *)txt; *p > 32; p++)
577  ;
578  l = p - txt;
579 
580  // word wrap
581  if (l < con.linewidth && con.x + l > con.linewidth) {
582  Con_Linefeed();
583  }
584 
585  switch (*txt) {
586  case '\r':
587  case '\n':
588  con.newline = *txt;
589  break;
590  default: // display character and advance
591  if (con.x == con.linewidth) {
592  Con_Linefeed();
593  }
595  p[con.x++] = *txt;
596  break;
597  }
598 
599  txt++;
600  }
601 }

Referenced by Com_LPrintf(), and Con_Printf().

◆ Con_Printf()

void Con_Printf ( const char *  fmt,
  ... 
)

Definition at line 611 of file console.c.

612 {
613  va_list argptr;
614  char msg[MAXPRINTMSG];
615 
616  va_start(argptr, fmt);
617  Q_vsnprintf(msg, sizeof(msg), fmt, argptr);
618  va_end(argptr);
619 
620  Con_Print(msg);
621 }

Referenced by CL_ParseServerData(), Con_Action(), and Con_Init().

◆ Con_RegisterMedia()

void Con_RegisterMedia ( void  )

Definition at line 628 of file console.c.

629 {
630  qerror_t err;
631 
632  con.charsetImage = R_RegisterImage(con_font->string, IT_FONT, IF_PERMANENT | IF_SRGB, &err);
633  if (!con.charsetImage) {
634  if (strcmp(con_font->string, "conchars")) {
635  Com_WPrintf("Couldn't load %s: %s\n", con_font->string, Q_ErrorString(err));
636  Cvar_Reset(con_font);
637  con.charsetImage = R_RegisterImage("conchars", IT_FONT, IF_PERMANENT | IF_SRGB, &err);
638  }
639  if (!con.charsetImage) {
640  Com_Error(ERR_FATAL, "Couldn't load pics/conchars.pcx: %s", Q_ErrorString(err));
641  }
642  }
643 
644  con.backImage = R_RegisterImage(con_background->string, IT_PIC, IF_PERMANENT | IF_SRGB, &err);
645  if (!con.backImage) {
646  if (strcmp(con_background->string, "conback")) {
647  Com_WPrintf("Couldn't load %s: %s\n", con_background->string, Q_ErrorString(err));
648  Cvar_Reset(con_background);
649  con.backImage = R_RegisterImage("conback", IT_PIC, IF_PERMANENT | IF_SRGB, &err);
650  }
651  if (!con.backImage) {
652  Com_EPrintf("Couldn't load pics/conback.pcx: %s\n", Q_ErrorString(err));
653  }
654  }
655 }

Referenced by CL_InitRefresh(), CL_RestartFilesystem(), CL_RestartRefresh(), and con_param_changed().

◆ Con_RemoteMode_f()

static void Con_RemoteMode_f ( void  )
static

Definition at line 321 of file console.c.

322 {
323  netadr_t adr;
324  char *s;
325 
326  if (Cmd_Argc() != 3) {
327  Com_Printf("Usage: %s <address> <password>\n", Cmd_Argv(0));
328  return;
329  }
330 
331  s = Cmd_Argv(1);
332  if (!NET_StringToAdr(s, &adr, PORT_SERVER)) {
333  Com_Printf("Bad address: %s\n", s);
334  return;
335  }
336 
337  s = Cmd_Argv(2);
338 
339  if (!(cls.key_dest & KEY_CONSOLE)) {
341  } else {
342  con.mode = CON_REMOTE;
343  con.chat = CHAT_NONE;
344  }
345 
346  con.remoteAddress = adr;
347  if (con.remotePassword) {
349  }
350  con.remotePassword = Z_CopyString(s);
351 }

◆ Con_RunConsole()

void Con_RunConsole ( void  )

Definition at line 982 of file console.c.

983 {
984  if (cls.disable_screen) {
986  return;
987  }
988 
989  if (!(cls.key_dest & KEY_MENU)) {
990  if (cls.state == ca_disconnected) {
991  // draw fullscreen console
993  return;
994  }
996  // draw half-screen console
997  con.destHeight = con.currentHeight = 0.5f;
998  return;
999  }
1000  }
1001 
1002 // decide on the height of the console
1003  if (cls.key_dest & KEY_CONSOLE) {
1005  } else {
1006  con.destHeight = 0; // none visible
1007  }
1008 
1009  if (con_speed->value <= 0) {
1011  return;
1012  }
1013 
1014  if (con.currentHeight > con.destHeight) {
1015  con.currentHeight -= con_speed->value * cls.frametime;
1016  if (con.currentHeight < con.destHeight) {
1018  }
1019  } else if (con.currentHeight < con.destHeight) {
1020  con.currentHeight += con_speed->value * cls.frametime;
1021  if (con.currentHeight > con.destHeight) {
1023  }
1024  }
1025 }

Referenced by CL_Frame(), CL_Init(), and Con_Popup().

◆ Con_Say()

static void Con_Say ( char *  msg)
static

Definition at line 1049 of file console.c.

1050 {
1051  CL_ClientCommand(va("say%s \"%s\"", con.chat == CHAT_TEAM ? "_team" : "", msg));
1052 }

Referenced by Con_Action(), and Key_Message().

◆ con_scale_changed()

static void con_scale_changed ( cvar_t *  self)
static

Definition at line 410 of file console.c.

411 {
413  Con_CheckResize();
414  }
415 }

Referenced by Con_Init().

◆ Con_SetColor()

void Con_SetColor ( color_index_t  color)

Definition at line 531 of file console.c.

532 {
533  con.color = color;
534 }

Referenced by Com_SetColor().

◆ Con_Shutdown()

void Con_Shutdown ( void  )

Definition at line 491 of file console.c.

492 {
493  if (con_history->integer > 0) {
494  Prompt_SaveHistory(&con.prompt, COM_HISTORYFILE_NAME, con_history->integer);
495  }
497 }

Referenced by CL_Shutdown().

◆ Con_SkipNotify()

void Con_SkipNotify ( qboolean  skip)

Definition at line 99 of file console.c.

100 {
101  con.skipNotify = skip;
102 }

Referenced by CL_ParsePrint().

◆ Con_ToggleChat2_f()

static void Con_ToggleChat2_f ( void  )
static

Definition at line 204 of file console.c.

205 {
207 }

◆ Con_ToggleChat_f()

static void Con_ToggleChat_f ( void  )
static

Definition at line 199 of file console.c.

200 {
202 }

◆ Con_ToggleConsole_f()

void Con_ToggleConsole_f ( void  )

Definition at line 194 of file console.c.

195 {
197 }

Referenced by Key_Event().

◆ Key_Console()

void Key_Console ( int  key)

Definition at line 1137 of file console.c.

1138 {
1139  if (key == 'l' && Key_IsDown(K_CTRL)) {
1140  Con_Clear_f();
1141  return;
1142  }
1143 
1144  if (key == 'd' && Key_IsDown(K_CTRL)) {
1145  con.mode = CON_DEFAULT;
1146  return;
1147  }
1148 
1149  if (key == K_ENTER || key == K_KP_ENTER) {
1150  Con_Action();
1151  goto scroll;
1152  }
1153 
1154  if ((key == 'v' && Key_IsDown(K_CTRL)) ||
1155  (key == K_INS && Key_IsDown(K_SHIFT)) || key == K_MOUSE3) {
1156  Con_Paste();
1157  goto scroll;
1158  }
1159 
1160  if (key == K_TAB) {
1162  goto scroll;
1163  }
1164 
1165  if (key == 'r' && Key_IsDown(K_CTRL)) {
1166  Prompt_CompleteHistory(&con.prompt, qfalse);
1167  goto scroll;
1168  }
1169 
1170  if (key == 's' && Key_IsDown(K_CTRL)) {
1172  goto scroll;
1173  }
1174 
1175  if (key == K_UPARROW || (key == 'p' && Key_IsDown(K_CTRL))) {
1177  goto scroll;
1178  }
1179 
1180  if (key == K_DOWNARROW || (key == 'n' && Key_IsDown(K_CTRL))) {
1182  goto scroll;
1183  }
1184 
1185  if (key == K_PGUP || key == K_MWHEELUP) {
1186  if (Key_IsDown(K_CTRL)) {
1187  con.display -= 6;
1188  } else {
1189  con.display -= 2;
1190  }
1191  Con_CheckTop();
1192  return;
1193  }
1194 
1195  if (key == K_PGDN || key == K_MWHEELDOWN) {
1196  if (Key_IsDown(K_CTRL)) {
1197  con.display += 6;
1198  } else {
1199  con.display += 2;
1200  }
1201  if (con.display > con.current) {
1202  con.display = con.current;
1203  }
1204  return;
1205  }
1206 
1207  if (key == K_HOME && Key_IsDown(K_CTRL)) {
1208  con.display = 1;
1209  Con_CheckTop();
1210  return;
1211  }
1212 
1213  if (key == K_END && Key_IsDown(K_CTRL)) {
1214  con.display = con.current;
1215  return;
1216  }
1217 
1218  if (IF_KeyEvent(&con.prompt.inputLine, key)) {
1221  }
1222 
1223 scroll:
1224  if (con_scroll->integer & 1) {
1225  con.display = con.current;
1226  }
1227 }

Referenced by Key_Event().

◆ Key_Message()

void Key_Message ( int  key)

Definition at line 1241 of file console.c.

1242 {
1243  if (key == 'l' && Key_IsDown(K_CTRL)) {
1244  IF_Clear(&con.chatPrompt.inputLine);
1245  return;
1246  }
1247 
1248  if (key == K_ENTER || key == K_KP_ENTER) {
1249  char *cmd = Prompt_Action(&con.chatPrompt);
1250 
1251  if (cmd) {
1252  Con_Say(cmd);
1253  }
1254  Key_SetDest(cls.key_dest & ~KEY_MESSAGE);
1255  return;
1256  }
1257 
1258  if (key == K_ESCAPE) {
1259  Key_SetDest(cls.key_dest & ~KEY_MESSAGE);
1260  IF_Clear(&con.chatPrompt.inputLine);
1261  return;
1262  }
1263 
1264  if (key == 'r' && Key_IsDown(K_CTRL)) {
1266  return;
1267  }
1268 
1269  if (key == 's' && Key_IsDown(K_CTRL)) {
1271  return;
1272  }
1273 
1274  if (key == K_UPARROW || (key == 'p' && Key_IsDown(K_CTRL))) {
1276  return;
1277  }
1278 
1279  if (key == K_DOWNARROW || (key == 'n' && Key_IsDown(K_CTRL))) {
1281  return;
1282  }
1283 
1284  if (IF_KeyEvent(&con.chatPrompt.inputLine, key)) {
1286  }
1287 }

Referenced by Key_Event().

◆ start_message_mode()

static void start_message_mode ( chatMode_t  mode)
static

Definition at line 289 of file console.c.

290 {
291  if (cls.state != ca_active || cls.demo.playback) {
292  Com_Printf("You must be in a level to chat.\n");
293  return;
294  }
295 
296  // starting messagemode closes console
297  if (cls.key_dest & KEY_CONSOLE) {
298  Con_Close(qtrue);
299  }
300 
301  con.chat = mode;
302  IF_Replace(&con.chatPrompt.inputLine, Cmd_RawArgs());
303  Key_SetDest(cls.key_dest | KEY_MESSAGE);
304 }

Referenced by Con_MessageMode2_f(), and Con_MessageMode_f().

◆ toggle_console()

static void toggle_console ( consoleMode_t  mode,
chatMode_t  chat 
)
static

Definition at line 169 of file console.c.

170 {
171  SCR_EndLoadingPlaque(); // get rid of loading plaque
172 
173  Con_ClearTyping();
175 
176  if (cls.key_dest & KEY_CONSOLE) {
177  Key_SetDest(cls.key_dest & ~KEY_CONSOLE);
178  con.mode = CON_POPUP;
179  con.chat = CHAT_NONE;
180  return;
181  }
182 
183  if (mode == CON_CHAT && (cls.state != ca_active || cls.demo.playback)) {
184  Com_Printf("You must be in a level to chat.\n");
185  return;
186  }
187 
188  // toggling console discards chat message
189  Key_SetDest((cls.key_dest | KEY_CONSOLE) & ~KEY_MESSAGE);
190  con.mode = mode;
191  con.chat = chat;
192 }

Referenced by Con_RemoteMode_f(), Con_ToggleChat2_f(), Con_ToggleChat_f(), and Con_ToggleConsole_f().

Variable Documentation

◆ c_console

const cmdreg_t c_console[]
static
Initial value:
= {
{ "toggleconsole", Con_ToggleConsole_f },
{ "togglechat", Con_ToggleChat_f },
{ "togglechat2", Con_ToggleChat2_f },
{ "messagemode", Con_MessageMode_f },
{ "messagemode2", Con_MessageMode2_f },
{ "remotemode", Con_RemoteMode_f, CL_RemoteMode_c },
{ "clear", Con_Clear_f },
{ "clearnotify", Con_ClearNotify_f },
{ "condump", Con_Dump_f, Con_Dump_c },
{ NULL }
}

Definition at line 417 of file console.c.

Referenced by Con_Init().

◆ con

◆ con_alpha

cvar_t* con_alpha
static

Definition at line 85 of file console.c.

Referenced by Con_DrawSolidConsole(), and Con_Init().

◆ con_background

cvar_t* con_background
static

Definition at line 88 of file console.c.

Referenced by Con_Init(), and Con_RegisterMedia().

◆ con_clock

cvar_t* con_clock
static

Definition at line 82 of file console.c.

Referenced by Con_DrawSolidConsole(), and Con_Init().

◆ con_font

cvar_t* con_font
static

Definition at line 87 of file console.c.

Referenced by Con_Init(), and Con_RegisterMedia().

◆ con_height

cvar_t* con_height
static

Definition at line 83 of file console.c.

Referenced by Con_DrawSolidConsole(), Con_Init(), and Con_RunConsole().

◆ con_history

cvar_t* con_history
static

Definition at line 90 of file console.c.

Referenced by Con_Init(), Con_PostInit(), and Con_Shutdown().

◆ con_notifylines

cvar_t* con_notifylines
static

Definition at line 81 of file console.c.

Referenced by Con_DrawNotify(), and Con_Init().

◆ con_notifytime

cvar_t* con_notifytime
static

Definition at line 80 of file console.c.

Referenced by Con_DrawNotify(), and Con_Init().

◆ con_scale

cvar_t* con_scale
static

Definition at line 86 of file console.c.

Referenced by Con_CheckResize(), and Con_Init().

◆ con_scroll

cvar_t* con_scroll
static

Definition at line 89 of file console.c.

Referenced by Con_Init(), Con_Linefeed(), and Key_Console().

◆ con_speed

cvar_t* con_speed
static

Definition at line 84 of file console.c.

Referenced by Con_Init(), and Con_RunConsole().

SCR_FadeAlpha
float SCR_FadeAlpha(unsigned startTime, unsigned visTime, unsigned fadeTime)
Definition: screen.c:193
Con_Print
void Con_Print(const char *txt)
Definition: console.c:557
console_s::destHeight
float destHeight
Definition: console.c:65
R_RegisterImage
qhandle_t R_RegisterImage(const char *name, imagetype_t type, imageflags_t flags, qerror_t *err_p)
Definition: images.c:1170
console_s::currentHeight
float currentHeight
Definition: console.c:64
Prompt_CompleteCommand
void Prompt_CompleteCommand(commandPrompt_t *prompt, qboolean backslash)
Definition: prompt.c:190
con_history
static cvar_t * con_history
Definition: console.c:90
client_state_s::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:289
FS_EasyOpenFile
qhandle_t FS_EasyOpenFile(char *buf, size_t size, unsigned mode, const char *dir, const char *name, const char *ext)
Definition: files.c:1846
Prompt_CompleteHistory
void Prompt_CompleteHistory(commandPrompt_t *prompt, qboolean forward)
Definition: prompt.c:387
colorTable
const uint32_t colorTable[8]
Definition: screen.c:118
R_SetColor
void(* R_SetColor)(uint32_t color)
Definition: refresh.c:413
Con_MessageMode2_f
static void Con_MessageMode2_f(void)
Definition: console.c:311
LOAD_SOUNDS
@ LOAD_SOUNDS
Definition: client.h:612
client_static_s::playback
qhandle_t playback
Definition: client.h:453
R_SetAlpha
void(* R_SetAlpha)(float clpha)
Definition: refresh.c:411
Prompt_HistoryDown
void Prompt_HistoryDown(commandPrompt_t *prompt)
Definition: prompt.c:519
console_s::vidHeight
int vidHeight
Definition: console.c:54
Q_snprintf
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
Definition: shared.c:846
CON_CHAT
@ CON_CHAT
Definition: console.c:39
CHAT_DEFAULT
@ CHAT_DEFAULT
Definition: console.c:32
client_static_s::demo
struct client_static_s::@3 demo
con_background
static cvar_t * con_background
Definition: console.c:88
Con_DrawSolidConsole
static void Con_DrawSolidConsole(void)
Definition: console.c:775
console_s::mode
consoleMode_t mode
Definition: console.c:71
console_s::skipNotify
qboolean skipNotify
Definition: console.c:59
Con_RemoteMode_f
static void Con_RemoteMode_f(void)
Definition: console.c:321
Key_SetDest
void Key_SetDest(keydest_t dest)
Definition: keys.c:178
console_s::vidWidth
int vidWidth
Definition: console.c:54
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
client_static_s::key_dest
keydest_t key_dest
Definition: client.h:376
Q_ErrorString
const char * Q_ErrorString(qerror_t error)
Definition: error.c:51
R_ClearColor
void(* R_ClearColor)(void)
Definition: refresh.c:410
Prompt_ClearState
void Prompt_ClearState(commandPrompt_t *prompt)
Definition: prompt.c:437
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: screen.c:2142
ca_disconnected
@ ca_disconnected
Definition: client.h:334
ca_active
@ ca_active
Definition: client.h:340
LOAD_IMAGES
@ LOAD_IMAGES
Definition: client.h:610
FS_FPrintf
ssize_t FS_FPrintf(qhandle_t f, const char *format,...)
Definition: files.c:2039
client_static_s::state
connstate_t state
Definition: client.h:375
Con_ToggleConsole_f
void Con_ToggleConsole_f(void)
Definition: console.c:194
CON_DEFAULT
@ CON_DEFAULT
Definition: console.c:38
con_height
static cvar_t * con_height
Definition: console.c:83
CL_RemoteMode_c
static void CL_RemoteMode_c(genctx_t *ctx, int argnum)
Definition: console.c:353
Com_Time_m
size_t Com_Time_m(char *buffer, size_t size)
Definition: common.c:652
client_static_s::ref_initialized
qboolean ref_initialized
Definition: client.h:380
Con_Printf
void Con_Printf(const char *fmt,...)
Definition: console.c:611
R_ClampScale
float R_ClampScale(cvar_t *var)
Definition: refresh.c:440
console_s::loadstate
load_state_t loadstate
Definition: console.c:75
CON_LINEWIDTH
#define CON_LINEWIDTH
Definition: console.c:28
console_s::text
char text[CON_TOTALLINES][CON_LINEWIDTH]
Definition: console.c:46
Prompt_Action
char * Prompt_Action(commandPrompt_t *prompt)
Definition: prompt.c:453
con_scale_changed
static void con_scale_changed(cvar_t *self)
Definition: console.c:410
Con_Dump_c
static void Con_Dump_c(genctx_t *ctx, int argnum)
Definition: console.c:220
CON_TOTALLINES_MASK
#define CON_TOTALLINES_MASK
Definition: console.c:26
con_scale
static cvar_t * con_scale
Definition: console.c:86
console_s::initialized
qboolean initialized
Definition: console.c:44
Q_vsnprintf
size_t Q_vsnprintf(char *dest, size_t size, const char *fmt, va_list argptr)
Definition: shared.c:791
CON_TIMES
#define CON_TIMES
Definition: console.c:22
SCR_EndLoadingPlaque
void SCR_EndLoadingPlaque(void)
Definition: screen.c:1456
start_message_mode
static void start_message_mode(chatMode_t mode)
Definition: console.c:289
CON_TIMES_MASK
#define CON_TIMES_MASK
Definition: console.c:23
console_s::linewidth
int linewidth
Definition: console.c:53
Con_DrawLine
static int Con_DrawLine(int v, int line, float alpha)
Definition: console.c:665
VID_PumpEvents
void VID_PumpEvents(void)
Definition: client.c:971
chatMode_t
chatMode_t
Definition: console.c:30
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:899
c_console
static const cmdreg_t c_console[]
Definition: console.c:417
console_s::chatPrompt
commandPrompt_t chatPrompt
Definition: console.c:67
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:889
Con_RunConsole
void Con_RunConsole(void)
Definition: console.c:982
Con_CarriageRet
static void Con_CarriageRet(void)
Definition: console.c:499
con_clock
static cvar_t * con_clock
Definition: console.c:82
Con_CheckTop
static void Con_CheckTop(void)
Definition: console.c:391
width
static int width
Definition: physical_sky.c:38
con_speed
static cvar_t * con_speed
Definition: console.c:84
console_s::scale
float scale
Definition: console.c:55
Con_ClearNotify_f
void Con_ClearNotify_f(void)
Definition: console.c:276
Con_Close
void Con_Close(qboolean force)
Definition: console.c:124
VID_GetClipboardData
char * VID_GetClipboardData(void)
Definition: client.c:1327
Con_Paste
static void Con_Paste(void)
Definition: console.c:1096
cmd_buffer
cmdbuf_t cmd_buffer
Definition: cmd.c:49
con_notifylines
static cvar_t * con_notifylines
Definition: console.c:81
Com_Error
void Com_Error(error_type_t type, const char *fmt,...)
Definition: g_main.c:258
Con_ToggleChat2_f
static void Con_ToggleChat2_f(void)
Definition: console.c:204
client_static_s::current
dlqueue_t * current
Definition: client.h:440
Prompt_HistoryUp
void Prompt_HistoryUp(commandPrompt_t *prompt)
Definition: prompt.c:490
VER_WIDTH
#define VER_WIDTH
Con_Clear_f
static void Con_Clear_f(void)
Definition: console.c:214
console_s::x
int x
Definition: console.c:48
Cvar_ClampValue
float Cvar_ClampValue(cvar_t *var, float min, float max)
Definition: cvar.c:571
console_s::color
int color
Definition: console.c:50
Cbuf_AddText
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
Definition: cmd.c:95
con_font
static cvar_t * con_font
Definition: console.c:87
va
char * va(const char *format,...)
Definition: shared.c:429
FS_File_g
void FS_File_g(const char *path, const char *ext, unsigned flags, genctx_t *ctx)
Definition: files.c:2954
Con_RegisterMedia
void Con_RegisterMedia(void)
Definition: console.c:628
Z_Free
void Z_Free(void *ptr)
Definition: zone.c:147
Cmd_Register
void Cmd_Register(const cmdreg_t *reg)
Definition: cmd.c:1572
Con_CheckResize
void Con_CheckResize(void)
Definition: console.c:367
Key_IsDown
int Key_IsDown(int key)
Definition: keys.c:204
console_s::remoteAddress
netadr_t remoteAddress
Definition: console.c:72
con_scroll
static cvar_t * con_scroll
Definition: console.c:89
Com_Address_g
void Com_Address_g(genctx_t *ctx)
Definition: common.c:729
R_DrawString
int(* R_DrawString)(int x, int y, int flags, size_t maxChars, const char *string, qhandle_t font)
Definition: refresh.c:417
console_s::prompt
commandPrompt_t prompt
Definition: console.c:68
con
static console_t con
Definition: console.c:78
Prompt_LoadHistory
void Prompt_LoadHistory(commandPrompt_t *prompt, const char *filename)
Definition: prompt.c:588
Con_InteractiveMode
static void Con_InteractiveMode(void)
Definition: console.c:1055
Prompt_SaveHistory
void Prompt_SaveHistory(commandPrompt_t *prompt, const char *filename, int lines)
Definition: prompt.c:559
NET_StringToAdr
qboolean NET_StringToAdr(const char *s, netadr_t *a, int default_port)
Definition: net.c:332
console_s::display
int display
Definition: console.c:49
client_static_s::percent
int percent
Definition: client.h:441
CHAT_TEAM
@ CHAT_TEAM
Definition: console.c:33
dlqueue_t::path
char path[1]
Definition: client.h:371
Con_Say
static void Con_Say(char *msg)
Definition: console.c:1049
con_alpha
static cvar_t * con_alpha
Definition: console.c:85
IF_Replace
void IF_Replace(inputField_t *field, const char *text)
Definition: field.c:67
CHAT_NONE
@ CHAT_NONE
Definition: console.c:31
toggle_console
static void toggle_console(consoleMode_t mode, chatMode_t chat)
Definition: console.c:169
Prompt_Clear
void Prompt_Clear(commandPrompt_t *prompt)
Definition: prompt.c:540
cl
client_state_t cl
Definition: main.c:99
client_static_s::frametime
float frametime
Definition: client.h:390
console_s::remotePassword
char * remotePassword
Definition: console.c:73
cls
client_static_t cls
Definition: main.c:98
c
statCounters_t c
Definition: main.c:30
Con_DrawNotify
static void Con_DrawNotify(void)
Definition: console.c:704
CL_SendRcon
void CL_SendRcon(const netadr_t *adr, const char *pass, const char *cmd)
Definition: main.c:637
Con_Linefeed
static void Con_Linefeed(void)
Definition: console.c:516
client_static_s::download
struct client_static_s::@2 download
CON_PRESTEP
#define CON_PRESTEP
Definition: console.c:695
console_s::charsetImage
qhandle_t charsetImage
Definition: console.c:62
IF_Clear
void IF_Clear(inputField_t *field)
Definition: field.c:56
R_DrawStretchPic
void(* R_DrawStretchPic)(int x, int y, int w, int h, qhandle_t pic)
Definition: refresh.c:420
CON_TOTALLINES
#define CON_TOTALLINES
Definition: console.c:25
client_static_s::disable_screen
unsigned disable_screen
Definition: client.h:381
err
int err
Definition: win.h:24
console_s::chat
chatMode_t chat
Definition: console.c:70
R_SetScale
void(* R_SetScale)(float scale)
Definition: refresh.c:415
LOAD_CLIENTS
@ LOAD_CLIENTS
Definition: client.h:611
LOAD_MODELS
@ LOAD_MODELS
Definition: client.h:609
msg
const char * msg
Definition: win.h:25
con_param_changed
static void con_param_changed(cvar_t *self)
Definition: console.c:403
client_static_s::realtime
unsigned realtime
Definition: client.h:389
ca_loading
@ ca_loading
Definition: client.h:338
R_DrawChar
void(* R_DrawChar)(int x, int y, int flags, int ch, qhandle_t font)
Definition: refresh.c:416
CL_ClientCommand
void CL_ClientCommand(const char *string)
Definition: main.c:299
Con_Dump_f
static void Con_Dump_f(void)
Definition: console.c:234
color
static vec4_t color
Definition: mesh.c:33
console_s::current
int current
Definition: console.c:47
FS_FCloseFile
void FS_FCloseFile(qhandle_t f)
Definition: files.c:759
Con_ClearTyping
void Con_ClearTyping(void)
Definition: console.c:109
Con_MessageMode_f
static void Con_MessageMode_f(void)
Definition: console.c:306
con_notifytime
static cvar_t * con_notifytime
Definition: console.c:80
Con_Action
static void Con_Action(void)
Definition: console.c:1062
LOAD_MAP
@ LOAD_MAP
Definition: client.h:608
console_s::backImage
qhandle_t backImage
Definition: console.c:61
CON_REMOTE
@ CON_REMOTE
Definition: console.c:40
IF_Init
void IF_Init(inputField_t *field, size_t visibleChars, size_t maxChars)
Definition: field.c:36
Con_ToggleChat_f
static void Con_ToggleChat_f(void)
Definition: console.c:199
client_static_s::position
int position
Definition: client.h:442
console_s::newline
int newline
Definition: console.c:51
APP_VERSION
#define APP_VERSION
r_config
refcfg_t r_config
Definition: refresh.c:401
consoleMode_t
consoleMode_t
Definition: console.c:36
CON_POPUP
@ CON_POPUP
Definition: console.c:37
console_s::times
unsigned times[CON_TIMES]
Definition: console.c:57
SCR_DrawStringEx
int SCR_DrawStringEx(int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
Definition: screen.c:139
Cmd_RawArgs
char * Cmd_RawArgs(void)
Definition: cmd.c:951