UFO: Alien Invasion
Loading...
Searching...
No Matches
win_console.cpp File Reference

console functions for windows ports More...

#include "../../common/common.h"
#include "win_local.h"
Include dependency graph for win_console.cpp:

Go to the source code of this file.

Data Structures

struct  sysConsole_t

Macros

#define CONSOLE_WINDOW_STYLE   (WS_OVERLAPPED|WS_BORDER|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPCHILDREN|WS_GROUP)
#define CONSOLE_WINDOW_CLASS_NAME   GAME_TITLE" Console"
#define CONSOLE_WINDOW_NAME   CONSOLE_WINDOW_CLASS_NAME
#define MAX_OUTPUT   32768
#define MAX_PRINTMSG   8192

Functions

int SV_CountPlayers (void)
 Returns the number of spawned players.
static void Sys_ConsoleLoop (bool error)
 Dispatch window messages.
const char * Sys_ConsoleInput (void)
 Handles input for the console window.
void Sys_ConsoleOutput (const char *text)
void Sys_Backtrace (void)
 On platforms supporting it, print a backtrace.
void Sys_Error (const char *error,...)
void Sys_ShowConsole (bool show)
static LRESULT CALLBACK Sys_ConsoleProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static LONG WINAPI Sys_ConsoleEditProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void Sys_ConsoleShutdown (void)
 Shutdown the console.
void Sys_ConsoleInit (void)
 Initialize the console input (tty mode if possible).

Variables

static sysConsole_t sys_console

Detailed Description

console functions for windows ports

Definition in file win_console.cpp.

Macro Definition Documentation

◆ CONSOLE_WINDOW_CLASS_NAME

#define CONSOLE_WINDOW_CLASS_NAME   GAME_TITLE" Console"

Definition at line 30 of file win_console.cpp.

Referenced by Sys_ConsoleInit(), and Sys_ConsoleShutdown().

◆ CONSOLE_WINDOW_NAME

#define CONSOLE_WINDOW_NAME   CONSOLE_WINDOW_CLASS_NAME

Definition at line 35 of file win_console.cpp.

Referenced by Sys_ConsoleInit().

◆ CONSOLE_WINDOW_STYLE

#define CONSOLE_WINDOW_STYLE   (WS_OVERLAPPED|WS_BORDER|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPCHILDREN|WS_GROUP)

Definition at line 29 of file win_console.cpp.

Referenced by Sys_ConsoleInit().

◆ MAX_OUTPUT

#define MAX_OUTPUT   32768

Definition at line 38 of file win_console.cpp.

Referenced by Sys_ConsoleOutput().

◆ MAX_PRINTMSG

#define MAX_PRINTMSG   8192

Definition at line 39 of file win_console.cpp.

Referenced by Sys_ConsoleOutput().

Function Documentation

◆ SV_CountPlayers()

int SV_CountPlayers ( void )

Returns the number of spawned players.

See also
SV_ShutdownWhenEmpty

Definition at line 1096 of file sv_main.cpp.

References cl, count, cs_spawned, SV_GetNextClient(), and svs.

Referenced by Sys_ConsoleProc().

◆ Sys_Backtrace()

void Sys_Backtrace ( void )

On platforms supporting it, print a backtrace.

Note
For windows this is not handled here - see Sys_BacktraceInit

Definition at line 162 of file win_console.cpp.

References Com_BreakIntoDebugger().

Referenced by Sys_Error().

◆ Sys_ConsoleEditProc()

LONG WINAPI Sys_ConsoleEditProc ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam )
static

Definition at line 304 of file win_console.cpp.

References Com_ConsoleCompleteCommand(), Com_Printf(), and sys_console.

Referenced by Sys_ConsoleInit().

◆ Sys_ConsoleInit()

void Sys_ConsoleInit ( void )

◆ Sys_ConsoleInput()

const char * Sys_ConsoleInput ( void )

Handles input for the console window.

Returns
nullptr if there is no input in the input box

Definition at line 92 of file win_console.cpp.

References MAXCMDLINE, Q_strncpyz(), sys_console, and Sys_ConsoleLoop().

◆ Sys_ConsoleLoop()

void Sys_ConsoleLoop ( bool error)
static

Dispatch window messages.

Definition at line 71 of file win_console.cpp.

References Sys_Quit().

Referenced by Sys_ConsoleInput(), and Sys_Error().

◆ Sys_ConsoleOutput()

void Sys_ConsoleOutput ( const char * text)

Definition at line 115 of file win_console.cpp.

References len, MAX_OUTPUT, MAX_PRINTMSG, and sys_console.

Referenced by Sys_Error().

◆ Sys_ConsoleProc()

LRESULT CALLBACK Sys_ConsoleProc ( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam )
static

Definition at line 229 of file win_console.cpp.

References SV_CountPlayers(), sys_console, and Sys_Quit().

Referenced by Sys_ConsoleInit().

◆ Sys_ConsoleShutdown()

void Sys_ConsoleShutdown ( void )

Shutdown the console.

Note
Never exit without calling this, or your terminal will be left in a pretty bad state

Definition at line 351 of file win_console.cpp.

References CONSOLE_WINDOW_CLASS_NAME, global_hInstance, Sys_BacktraceShutdown(), and sys_console.

◆ Sys_Error()

void Sys_Error ( const char * error,
... )

◆ Sys_ShowConsole()

void Sys_ShowConsole ( bool show)

Definition at line 209 of file win_console.cpp.

References sys_console.

Referenced by Sys_ConsoleInit(), and Sys_Error().

Variable Documentation

◆ sys_console