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

Master for refresh, status bar, console, chat, notify, etc. More...

#include "client.h"
#include "cl_screen.h"
#include "cl_console.h"
#include "battlescape/cl_localentity.h"
#include "battlescape/cl_actor.h"
#include "battlescape/cl_view.h"
#include "battlescape/cl_hud.h"
#include "renderer/r_main.h"
#include "renderer/r_draw.h"
#include "renderer/r_local.h"
#include "ui/ui_main.h"
#include "ui/ui_draw.h"
#include "ui/ui_nodes.h"
#include "ui/ui_windows.h"
#include "ui/ui_dragndrop.h"
#include "ui/ui_render.h"
#include "../ports/system.h"
Include dependency graph for cl_screen.cpp:

Go to the source code of this file.

Functions

static void SCR_DrawString (int x, int y, const char *string)
static void SCR_DrawLoadingBar (int x, int y, int w, int h, int percent)
void SCR_DrawLoadingScreen (bool string, int percent)
 Precache and loading screen at startup.
static void SCR_DrawDownloading (void)
 Draws the current downloading status.
void SCR_DrawLoading (int percent)
 Draws the current loading pic of the map from base/pics/maps/loading.
static void SCR_TouchPics (void)
 Allows rendering code to cache all needed sbar graphics.
static void SCR_DrawCursor (void)
 Draws the 3D-cursor in battlemode and the icons/info next to it.
void SCR_RunConsole (void)
 Scroll it up or down.
static void SCR_DrawConsole (void)
void SCR_BeginLoadingPlaque (void)
void SCR_EndLoadingPlaque (void)
static void SCR_TimeRefresh_f (void)
void SCR_UpdateScreen (void)
 This is called every frame, and can also be called explicitly to flush text to the screen.
void SCR_ChangeCursor (int cursor)
void SCR_Init (void)
void SCR_Shutdown (void)

Variables

static float scr_con_current
static float scr_conlines
static bool screenInitialized = false
static cvar_tscr_conspeed
static cvar_tscr_consize
static cvar_tscr_rspeed
static cvar_tscr_cursor
static cvar_tscr_showcursor
static char cursorImage [MAX_QPATH]

Detailed Description

Master for refresh, status bar, console, chat, notify, etc.

Full screen console. Put up loading plaque. Blanked background with loading plaque. Blanked background with menu. Full screen image for quit and victory. End of unit intermissions.

Definition in file cl_screen.cpp.

Function Documentation

◆ SCR_BeginLoadingPlaque()

void SCR_BeginLoadingPlaque ( void )
See also
SCR_UpdateScreen
SCR_EndLoadingPlaque
SCR_DrawLoading

Definition at line 269 of file cl_screen.cpp.

References CL_Milliseconds(), and cls.

Referenced by CL_CanMultiplayerStart(), and SV_Map().

◆ SCR_ChangeCursor()

void SCR_ChangeCursor ( int cursor)

Definition at line 370 of file cl_screen.cpp.

References Cvar_SetValue().

Referenced by CL_ActorMouseTrace(), IN_SetMouseSpace(), and SCR_TouchPics().

◆ SCR_DrawConsole()

void SCR_DrawConsole ( void )
static
See also
SCR_UpdateScreen
Con_DrawConsole
Con_DrawNotify

Definition at line 247 of file cl_screen.cpp.

References Con_CheckResize(), Con_DrawConsole(), scr_con_current, and viddef.

Referenced by SCR_UpdateScreen().

◆ SCR_DrawCursor()

void SCR_DrawCursor ( void )
static

◆ SCR_DrawDownloading()

void SCR_DrawDownloading ( void )
static

Draws the current downloading status.

See also
SCR_DrawLoadingBar
CL_StartHTTPDownload
CL_HTTP_Progress

Definition at line 124 of file cl_screen.cpp.

References _, ALIGN_UC, cls, SCR_DrawLoadingBar(), UI_DrawString(), va(), and viddef.

Referenced by SCR_DrawLoading().

◆ SCR_DrawLoading()

void SCR_DrawLoading ( int percent)

Draws the current loading pic of the map from base/pics/maps/loading.

See also
SCR_DrawLoadingBar

Definition at line 140 of file cl_screen.cpp.

References cls, R_BeginFrame(), R_EndFrame(), SCR_DrawDownloading(), SCR_DrawLoadingBar(), UI_Draw(), and viddef.

Referenced by CL_SendCommand(), and CL_ViewLoadMedia().

◆ SCR_DrawLoadingBar()

void SCR_DrawLoadingBar ( int x,
int y,
int w,
int h,
int percent )
static
See also
SCR_DrawLoading

Definition at line 81 of file cl_screen.cpp.

References R_DrawFill().

Referenced by SCR_DrawDownloading(), SCR_DrawLoading(), and SCR_DrawLoadingScreen().

◆ SCR_DrawLoadingScreen()

void SCR_DrawLoadingScreen ( bool string,
int percent )

Precache and loading screen at startup.

See also
CL_InitAfter
Parameters
[in]stringDraw the loading string - if the scripts are not parsed, this is not possible, so use false for very early calls
percentProgress value for the status bar

Definition at line 100 of file cl_screen.cpp.

References ALIGN_UC, image_t::height, it_pic, R_BeginFrame(), R_DrawImage(), R_EndFrame(), R_FindImage(), SCR_DrawLoadingBar(), UI_DrawString(), viddef, and image_t::width.

Referenced by CL_Init(), CL_ParseClientData(), CL_PrecacheCharacterModels(), CL_ViewPrecacheModels(), and R_ReloadImages().

◆ SCR_DrawString()

void SCR_DrawString ( int x,
int y,
const char * string )
static
See also
Font_DrawString

Definition at line 70 of file cl_screen.cpp.

References Con_DrawString(), and Q_strnull().

Referenced by SCR_UpdateScreen().

◆ SCR_EndLoadingPlaque()

void SCR_EndLoadingPlaque ( void )
See also
SCR_BeginLoadingPlaque

Definition at line 277 of file cl_screen.cpp.

References cls.

Referenced by CL_Drop(), CL_ViewLoadMedia(), and Qcommon_Init().

◆ SCR_Init()

void SCR_Init ( void )
See also
CL_Init
Todo
remove me - but this was an archive cvar once

Definition at line 379 of file cl_screen.cpp.

References Cmd_AddCommand(), CVAR_ARCHIVE, Cvar_Get(), scr_consize, scr_conspeed, scr_cursor, scr_rspeed, scr_showcursor, SCR_TimeRefresh_f(), SCR_TouchPics(), and screenInitialized.

Referenced by CL_Init().

◆ SCR_RunConsole()

void SCR_RunConsole ( void )

Scroll it up or down.

Definition at line 222 of file cl_screen.cpp.

References cls, key_console, scr_con_current, scr_conlines, scr_consize, and scr_conspeed.

Referenced by CL_Frame().

◆ SCR_Shutdown()

void SCR_Shutdown ( void )

Definition at line 397 of file cl_screen.cpp.

References screenInitialized.

Referenced by CL_Shutdown().

◆ SCR_TimeRefresh_f()

void SCR_TimeRefresh_f ( void )
static

◆ SCR_TouchPics()

void SCR_TouchPics ( void )
static

Allows rendering code to cache all needed sbar graphics.

Definition at line 159 of file cl_screen.cpp.

References Com_Printf(), Com_sprintf(), cursorImage, it_pic, R_FindImage(), SCR_ChangeCursor(), and scr_cursor.

Referenced by SCR_DrawCursor(), and SCR_Init().

◆ SCR_UpdateScreen()

void SCR_UpdateScreen ( void )

Variable Documentation

◆ cursorImage

char cursorImage[MAX_QPATH]
static

Definition at line 65 of file cl_screen.cpp.

Referenced by SCR_DrawCursor(), and SCR_TouchPics().

◆ scr_con_current

float scr_con_current
static

Definition at line 54 of file cl_screen.cpp.

Referenced by SCR_DrawConsole(), and SCR_RunConsole().

◆ scr_conlines

float scr_conlines
static

Definition at line 55 of file cl_screen.cpp.

Referenced by SCR_RunConsole().

◆ scr_consize

cvar_t* scr_consize
static

Definition at line 60 of file cl_screen.cpp.

Referenced by SCR_Init(), and SCR_RunConsole().

◆ scr_conspeed

cvar_t* scr_conspeed
static

Definition at line 59 of file cl_screen.cpp.

Referenced by SCR_Init(), and SCR_RunConsole().

◆ scr_cursor

cvar_t* scr_cursor
static

Definition at line 62 of file cl_screen.cpp.

Referenced by SCR_DrawCursor(), SCR_Init(), and SCR_TouchPics().

◆ scr_rspeed

cvar_t* scr_rspeed
static

Definition at line 61 of file cl_screen.cpp.

Referenced by SCR_Init(), and SCR_UpdateScreen().

◆ scr_showcursor

cvar_t* scr_showcursor
static

Definition at line 63 of file cl_screen.cpp.

Referenced by SCR_DrawCursor(), and SCR_Init().

◆ screenInitialized

bool screenInitialized = false
static

Definition at line 57 of file cl_screen.cpp.

Referenced by SCR_Init(), SCR_Shutdown(), and SCR_UpdateScreen().