Quake II RTX doxygen  1.0 dev
console.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 // console.c
19 
20 #include "client.h"
21 
22 #define CON_TIMES 16
23 #define CON_TIMES_MASK (CON_TIMES - 1)
24 
25 #define CON_TOTALLINES 1024 // total lines in console scrollback
26 #define CON_TOTALLINES_MASK (CON_TOTALLINES - 1)
27 
28 #define CON_LINEWIDTH 100 // fixed width, do not need more
29 
30 typedef enum {
34 } chatMode_t;
35 
36 typedef enum {
42 
43 typedef struct console_s {
44  qboolean initialized;
45 
47  int current; // line where next message will be printed
48  int x; // offset in current line for next print
49  int display; // bottom of console displays this line
50  int color;
51  int newline;
52 
53  int linewidth; // characters across screen
55  float scale;
56 
57  unsigned times[CON_TIMES]; // cls.realtime time the line was generated
58  // for transparent notify lines
59  qboolean skipNotify;
60 
61  qhandle_t backImage;
62  qhandle_t charsetImage;
63 
64  float currentHeight; // aproaches scr_conlines at scr_conspeed
65  float destHeight; // 0.0 to 1.0 lines of console to display
66 
67  commandPrompt_t chatPrompt;
68  commandPrompt_t prompt;
69 
72  netadr_t remoteAddress;
74 
76 } console_t;
77 
78 static console_t con;
79 
80 static cvar_t *con_notifytime;
81 static cvar_t *con_notifylines;
82 static cvar_t *con_clock;
83 static cvar_t *con_height;
84 static cvar_t *con_speed;
85 static cvar_t *con_alpha;
86 static cvar_t *con_scale;
87 static cvar_t *con_font;
88 static cvar_t *con_background;
89 static cvar_t *con_scroll;
90 static cvar_t *con_history;
91 
92 // ============================================================================
93 
94 /*
95 ================
96 Con_SkipNotify
97 ================
98 */
99 void Con_SkipNotify(qboolean skip)
100 {
101  con.skipNotify = skip;
102 }
103 
104 /*
105 ================
106 Con_ClearTyping
107 ================
108 */
109 void Con_ClearTyping(void)
110 {
111  // clear any typing
112  IF_Clear(&con.prompt.inputLine);
114 }
115 
116 /*
117 ================
118 Con_Close
119 
120 Instantly removes the console. Unless `force' is true, does not remove the console
121 if user has typed something into it since the last call to Con_Popup.
122 ================
123 */
124 void Con_Close(qboolean force)
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 }
144 
145 /*
146 ================
147 Con_Popup
148 
149 Drop to connection screen. Unless `force' is true, does not change console mode to popup.
150 ================
151 */
152 void Con_Popup(qboolean force)
153 {
154  if (force) {
155  con.mode = CON_POPUP;
156  }
157 
158  Key_SetDest(cls.key_dest | KEY_CONSOLE);
159  Con_RunConsole();
160 }
161 
162 /*
163 ================
164 Con_ToggleConsole_f
165 
166 Toggles console up/down animation.
167 ================
168 */
169 static void toggle_console(consoleMode_t mode, chatMode_t chat)
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 }
193 
195 {
197 }
198 
199 static void Con_ToggleChat_f(void)
200 {
202 }
203 
204 static void Con_ToggleChat2_f(void)
205 {
207 }
208 
209 /*
210 ================
211 Con_Clear_f
212 ================
213 */
214 static void Con_Clear_f(void)
215 {
216  memset(con.text, 0, sizeof(con.text));
218 }
219 
220 static void Con_Dump_c(genctx_t *ctx, int argnum)
221 {
222  if (argnum == 1) {
223  FS_File_g("condumps", ".txt", FS_SEARCH_STRIPEXT, ctx);
224  }
225 }
226 
227 /*
228 ================
229 Con_Dump_f
230 
231 Save the console contents out to a file
232 ================
233 */
234 static void Con_Dump_f(void)
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 }
269 
270 
271 /*
272 ================
273 Con_ClearNotify_f
274 ================
275 */
277 {
278  int i;
279 
280  for (i = 0; i < CON_TIMES; i++)
281  con.times[i] = 0;
282 }
283 
284 /*
285 ================
286 Con_MessageMode_f
287 ================
288 */
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 }
305 
306 static void Con_MessageMode_f(void)
307 {
309 }
310 
311 static void Con_MessageMode2_f(void)
312 {
314 }
315 
316 /*
317 ================
318 Con_RemoteMode_f
319 ================
320 */
321 static void Con_RemoteMode_f(void)
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 }
352 
353 static void CL_RemoteMode_c(genctx_t *ctx, int argnum)
354 {
355  if (argnum == 1) {
356  Com_Address_g(ctx);
357  }
358 }
359 
360 /*
361 ================
362 Con_CheckResize
363 
364 If the line width has changed, reformat the buffer.
365 ================
366 */
367 void Con_CheckResize(void)
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 }
383 
384 /*
385 ================
386 Con_CheckTop
387 
388 Make sure at least one line is visible if console is backscrolled.
389 ================
390 */
391 static void Con_CheckTop(void)
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 }
402 
403 static void con_param_changed(cvar_t *self)
404 {
407  }
408 }
409 
410 static void con_scale_changed(cvar_t *self)
411 {
413  Con_CheckResize();
414  }
415 }
416 
417 static const cmdreg_t c_console[] = {
418  { "toggleconsole", Con_ToggleConsole_f },
419  { "togglechat", Con_ToggleChat_f },
420  { "togglechat2", Con_ToggleChat2_f },
421  { "messagemode", Con_MessageMode_f },
422  { "messagemode2", Con_MessageMode2_f },
423  { "remotemode", Con_RemoteMode_f, CL_RemoteMode_c },
424  { "clear", Con_Clear_f },
425  { "clearnotify", Con_ClearNotify_f },
426  { "condump", Con_Dump_f, Con_Dump_c },
427 
428  { NULL }
429 };
430 
431 /*
432 ================
433 Con_Init
434 ================
435 */
436 void Con_Init(void)
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 }
478 
479 void Con_PostInit(void)
480 {
481  if (con_history->integer > 0) {
482  Prompt_LoadHistory(&con.prompt, COM_HISTORYFILE_NAME);
483  }
484 }
485 
486 /*
487 ================
488 Con_Shutdown
489 ================
490 */
491 void Con_Shutdown(void)
492 {
493  if (con_history->integer > 0) {
494  Prompt_SaveHistory(&con.prompt, COM_HISTORYFILE_NAME, con_history->integer);
495  }
497 }
498 
499 static void Con_CarriageRet(void)
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 }
515 
516 static void Con_Linefeed(void)
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 }
530 
531 void Con_SetColor(color_index_t color)
532 {
533  con.color = color;
534 }
535 
536 /*
537 =================
538 CL_LoadState
539 =================
540 */
542 {
543  con.loadstate = state;
545  VID_PumpEvents();
546 }
547 
548 /*
549 ================
550 Con_Print
551 
552 Handles cursor positioning, line wrapping, etc
553 All console printing must go through this in order to be displayed on screen
554 If no console is visible, the text will appear at the top of the game window
555 ================
556 */
557 void Con_Print(const char *txt)
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 }
602 
603 /*
604 ================
605 Con_Printf
606 
607 Print text to graphical console only,
608 bypassing system console and logfiles
609 ================
610 */
611 void Con_Printf(const char *fmt, ...)
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 }
622 
623 /*
624 ================
625 Con_RegisterMedia
626 ================
627 */
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 }
656 
657 /*
658 ==============================================================================
659 
660 DRAWING
661 
662 ==============================================================================
663 */
664 
665 static int Con_DrawLine(int v, int line, float alpha)
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 }
694 
695 #define CON_PRESTEP (CHAR_HEIGHT * 3 + CHAR_HEIGHT / 4)
696 
697 /*
698 ================
699 Con_DrawNotify
700 
701 Draws the last few lines of output transparently over the game top
702 ================
703 */
704 static void Con_DrawNotify(void)
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 }
767 
768 /*
769 ================
770 Con_DrawSolidConsole
771 
772 Draws the console with the solid background
773 ================
774 */
775 static void Con_DrawSolidConsole(void)
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 }
972 
973 //=============================================================================
974 
975 /*
976 ==================
977 Con_RunConsole
978 
979 Scroll it up or down
980 ==================
981 */
982 void Con_RunConsole(void)
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 }
1026 
1027 /*
1028 ==================
1029 SCR_DrawConsole
1030 ==================
1031 */
1033 {
1034  R_SetScale(con.scale);
1036  Con_DrawNotify();
1037  R_SetScale(1.0f);
1038 }
1039 
1040 
1041 /*
1042 ==============================================================================
1043 
1044  LINE TYPING INTO THE CONSOLE AND COMMAND COMPLETION
1045 
1046 ==============================================================================
1047 */
1048 
1049 static void Con_Say(char *msg)
1050 {
1051  CL_ClientCommand(va("say%s \"%s\"", con.chat == CHAT_TEAM ? "_team" : "", msg));
1052 }
1053 
1054 // don't close console after connecting
1055 static void Con_InteractiveMode(void)
1056 {
1057  if (con.mode == CON_POPUP) {
1058  con.mode = CON_DEFAULT;
1059  }
1060 }
1061 
1062 static void Con_Action(void)
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 }
1095 
1096 static void Con_Paste(void)
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 }
1129 
1130 /*
1131 ====================
1132 Key_Console
1133 
1134 Interactive line editing and console scrollback
1135 ====================
1136 */
1137 void Key_Console(int key)
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 }
1228 
1229 void Char_Console(int key)
1230 {
1231  if (IF_CharEvent(&con.prompt.inputLine, key)) {
1233  }
1234 }
1235 
1236 /*
1237 ====================
1238 Key_Message
1239 ====================
1240 */
1241 void Key_Message(int key)
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 }
1288 
1289 void Char_Message(int key)
1290 {
1291  IF_CharEvent(&con.chatPrompt.inputLine, key);
1292 }
1293 
1294 
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
Char_Console
void Char_Console(int key)
Definition: console.c:1229
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
Con_Shutdown
void Con_Shutdown(void)
Definition: console.c:491
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
Key_Console
void Key_Console(int key)
Definition: console.c:1137
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
Con_PostInit
void Con_PostInit(void)
Definition: console.c:479
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
CL_LoadState
void CL_LoadState(load_state_t state)
Definition: console.c:541
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_Popup
void Con_Popup(qboolean force)
Definition: console.c:152
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
console_s
Definition: console.c:43
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_SkipNotify
void Con_SkipNotify(qboolean skip)
Definition: console.c:99
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
Con_Init
void Con_Init(void)
Definition: console.c:436
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
Char_Message
void Char_Message(int key)
Definition: console.c:1289
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
client.h
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
Con_SetColor
void Con_SetColor(color_index_t color)
Definition: console.c:531
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
console_t
struct console_s console_t
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
load_state_t
load_state_t
Definition: client.h:606
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
Con_DrawConsole
void Con_DrawConsole(void)
Definition: console.c:1032
r_config
refcfg_t r_config
Definition: refresh.c:401
Key_Message
void Key_Message(int key)
Definition: console.c:1241
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