cl_console.c File Reference

Console related code. More...

#include "cl_console.h"
#include "client.h"
#include "cl_game.h"
#include "input/cl_keys.h"
#include "renderer/r_draw.h"
Include dependency graph for cl_console.c:

Go to the source code of this file.

Data Structures

struct  console_t

Defines

#define CONSOLE_CHAR_ALIGN   4
#define NUM_CON_TIMES   8
#define COLORED_TEXT_MASK   128
#define CON_TEXTSIZE   32768
#define CONSOLE_CURSOR_CHAR   11
#define CONSOLE_HISTORY_FILENAME   "history"

Functions

static void Con_DisplayString (int x, int y, const char *s)
static void Key_ClearTyping (void)
void Con_ToggleConsole_f (void)
static void Con_ToggleChat_f (void)
static void Con_Clear_f (void)
 Clears the console buffer.
void Con_Scroll (int scroll)
 Scrolls the console.
void Con_ClearNotify (void)
 Clear the notify times to ensure that every message will disappear from screen.
static void Con_MessageModeSay_f (void)
static void Con_MessageModeSayTeam_f (void)
void Con_CheckResize (void)
 If the line width has changed, reformat the buffer.
void Con_LoadConsoleHistory (void)
 Load the console history.
void Con_SaveConsoleHistory (void)
 Stores the console history.
void Con_Init (void)
static void Con_Linefeed (void)
void Con_Print (const char *txt)
 Handles cursor positioning, line wrapping, etc All console printing must go through this in order to be logged to disk If no console is visible, the text will appear at the top of the game window.
void Con_Close (void)
 Hide the gameconsole if active.
static void Con_DrawInput (void)
 The input line scrolls horizontally if typing goes beyond the right edge.
void Con_DrawNotify (void)
 Draws the last few lines of output transparently over the game top.
void Con_DrawConsole (float frac)
 Draws the console with the solid background.

Variables

static console_t con
static cvar_tcon_notifytime
static cvar_tcon_history
static cvar_tcon_background
const int con_fontHeight = 12
const int con_fontWidth = 10
const int con_fontShift = 3

Detailed Description

Console related code.

Definition in file cl_console.c.


Define Documentation

#define COLORED_TEXT_MASK   128

Definition at line 37 of file cl_console.c.

#define CON_TEXTSIZE   32768

Definition at line 38 of file cl_console.c.

Referenced by Con_CheckResize().

#define CONSOLE_CHAR_ALIGN   4

Definition at line 35 of file cl_console.c.

Referenced by Con_DrawConsole(), and Con_DrawInput().

#define CONSOLE_CURSOR_CHAR   11

Definition at line 39 of file cl_console.c.

Referenced by Con_DrawInput().

#define CONSOLE_HISTORY_FILENAME   "history"

Definition at line 40 of file cl_console.c.

Referenced by Con_LoadConsoleHistory(), and Con_SaveConsoleHistory().

#define NUM_CON_TIMES   8

Definition at line 36 of file cl_console.c.

Referenced by Con_ClearNotify(), Con_DrawNotify(), and Con_Print().


Function Documentation

void Con_CheckResize ( void   ) 

If the line width has changed, reformat the buffer.

Definition at line 162 of file cl_console.c.

References Con_ClearNotify(), con_fontShift, CON_TEXTSIZE, console_t::currentLine, console_t::displayLine, i, console_t::lineWidth, console_t::text, console_t::totalLines, viddef, and viddef_t::width.

Referenced by SCR_DrawConsole().

static void Con_Clear_f ( void   )  [static]

Clears the console buffer.

Definition at line 110 of file cl_console.c.

References console_t::text.

Referenced by Con_Init().

void Con_ClearNotify ( void   ) 

Clear the notify times to ensure that every message will disappear from screen.

Definition at line 131 of file cl_console.c.

References i, NUM_CON_TIMES, and console_t::times.

Referenced by Con_CheckResize(), Con_ToggleChat_f(), Con_ToggleConsole_f(), and SCR_EndLoadingPlaque().

void Con_Close ( void   ) 

Hide the gameconsole if active.

Definition at line 376 of file cl_console.c.

References cls, key_console, key_game, Key_SetDest(), and client_static_s::keyDest.

static void Con_DisplayString ( int  x,
int  y,
const char *  s 
) [static]

Definition at line 67 of file cl_console.c.

References con_fontWidth, and R_DrawChar().

Referenced by Con_DrawNotify().

void Con_DrawConsole ( float  frac  ) 
static void Con_DrawInput ( void   )  [static]
void Con_DrawNotify ( void   ) 
void Con_Init ( void   ) 
static void Con_Linefeed ( void   )  [static]
void Con_LoadConsoleHistory ( void   ) 
static void Con_MessageModeSay_f ( void   )  [static]

Definition at line 139 of file cl_console.c.

References CL_OnBattlescape(), GAME_IsSingleplayer, key_message, Key_SetDest(), MSG_SAY, and msgMode.

Referenced by Con_Init().

static void Con_MessageModeSayTeam_f ( void   )  [static]

Definition at line 149 of file cl_console.c.

References CL_OnBattlescape(), GAME_IsSingleplayer, key_message, Key_SetDest(), MSG_SAY_TEAM, and msgMode.

Referenced by Con_Init().

void Con_Print ( const char *  txt  ) 

Handles cursor positioning, line wrapping, etc All console printing must go through this in order to be logged to disk If no console is visible, the text will appear at the top of the game window.

See also:
Sys_ConsoleOutput

Definition at line 306 of file cl_console.c.

Referenced by Com_vPrintf().

void Con_SaveConsoleHistory ( void   ) 

Stores the console history.

See also:
Con_LoadConsoleHistory

Definition at line 235 of file cl_console.c.

References Com_Printf(), CONSOLE_HISTORY_FILENAME, qFILE_s::f, f, FILE_WRITE, FS_CloseFile(), FS_OpenFile(), FS_Write(), historyLine, i, cvar_s::integer, keyLines, and MAXCMDLINE.

Referenced by CL_Shutdown().

void Con_Scroll ( int  scroll  ) 

Scrolls the console.

Parameters:
[in] scroll Lines to scroll

Definition at line 119 of file cl_console.c.

References console_t::currentLine, and console_t::displayLine.

Referenced by Key_Console().

static void Con_ToggleChat_f ( void   )  [static]
void Con_ToggleConsole_f ( void   ) 
static void Key_ClearTyping ( void   )  [static]

Definition at line 76 of file cl_console.c.

References editLine, keyLinePos, and keyLines.

Referenced by Con_ToggleChat_f(), and Con_ToggleConsole_f().


Variable Documentation

console_t con [static]

Definition at line 59 of file cl_console.c.

Definition at line 62 of file cl_console.c.

const int con_fontHeight = 12

Definition at line 63 of file cl_console.c.

Referenced by Con_DrawConsole(), Con_DrawInput(), Con_DrawNotify(), and R_DrawChar().

const int con_fontShift = 3

Definition at line 65 of file cl_console.c.

Referenced by Con_CheckResize(), Con_DrawConsole(), Con_DrawInput(), and Con_DrawNotify().

const int con_fontWidth = 10
cvar_t* con_history [static]

Definition at line 61 of file cl_console.c.

Definition at line 60 of file cl_console.c.


Generated by  doxygen 1.6.2