User:Monster Iestyn/Source Code Documentation/console.h

From SRB2 Wiki
Jump to navigation Jump to search
Online link GitHub entry
File type C header file
#include guard none

This header file contains the variables and prototypes of functions for handling console drawing and input.

Includes

Function prototypes

Note that the prototypes for CONS_Printf, CONS_Alert and CONS_Debug are found in doomdef.h instead of in this file.

Function name Return type Params Defined in Description
CON_InitWii void none console.c Declared only if _WII is defined

Setup the console text buffer, for Wii version

CON_Init void none console.c Declared only if _WII is not defined

Setup the console text buffer

CON_Responder boolean event_t *ev console.c Handles console key input. Returns true if the event was "eaten", false if not.
CON_SetupBackColormap void none console.c Setups or re-setups the console background colormap (consolebgmap) using the current palette and the current value of cons_backcolor. Note that the colormap is defined based on the RGB levels of each palette color, which may differ between palettes. This function is called when the console colormaps are initialised at game startup, when cons_backcolor's value is changed, and when a new map is being loaded.
CON_ClearHUD void none console.c Clears all recent console messages currently being displayed on the HUD. Note: these messages normally disappear from the HUD after a period of time determined by con_hudtime, this function however forces them to all disappear immediately.
CON_Ticker void none console.c Console ticker: handles console move in/out, cursor blinking
CON_Drawer void none console.c Console refresh drawer, call each frame
CONS_Error void const char *msg console.c Print an error message in the console, and wait for ENTER key to continue. This type of error is unused in current public releases of SRB2; it is only used by Debug builds of SRB2 at game startup when there is a problem with the IWAD or main PWADs (instead of using I_Error to display the error message), and for sound initialisation errors for DOS builds (Allegro version 3 only?).
CON_ToggleOff void none console.c Forces the console to close immediately.
CON_Ready boolean none console.c Returns true if the console is ready for prompt (i.e.: ready to accept input from the user), false if not.
CON_LogMessage void const char *msg console.c Logs the console message to the output device. All control characters except \n (linefeed) are ignored.

Externs

Data name Data type Non-extern location(s) Description
con_mutex I_mutex console.c
con_recalc boolean console.c Set to true when screen size has changed, to adapt console
con_startup boolean console.c Set to true at game startup, screen need refreshing
con_clipviewtop INT32 console.c Top clipping value for planes and sprites rendered in Software, so that the part of the view covered by the console is not drawn when not needed, this must be -1 when console is off
con_destlines INT32 console.c Vid lines used by console at final position
con_clearlines INT32 console.c Top screen lines to refresh when view reduced
con_hudupdate boolean console.c When messages scroll, we need a background refresh
con_scalefactor UINT32 console.c Text size scale factor
cons_backcolor consvar_t console.c con_backcolor console variable struct
*yellowmap
*purplemap
*lgreenmap
*bluemap
*graymap
*redmap
*orangemap
UINT8 console.c Colormap arrays for console text colors
*consolebgmap UINT8 console.c The console background color colormap array. This is automatically updated whenever con_backcolor's value is changed.