UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"

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. More...
 
static void SCR_DrawDownloading (void)
 Draws the current downloading status. More...
 
void SCR_DrawLoading (int percent)
 Draws the current loading pic of the map from base/pics/maps/loading. More...
 
static void SCR_TouchPics (void)
 Allows rendering code to cache all needed sbar graphics. More...
 
static void SCR_DrawCursor (void)
 Draws the 3D-cursor in battlemode and the icons/info next to it. More...
 
void SCR_RunConsole (void)
 Scroll it up or down. More...
 
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. More...
 
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

void SCR_BeginLoadingPlaque ( void  )
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().

static void SCR_DrawConsole ( void  )
static
static void SCR_DrawDownloading ( void  )
static
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, client_static_s::downloadName, R_BeginFrame(), R_EndFrame(), SCR_DrawDownloading(), SCR_DrawLoadingBar(), UI_Draw(), viddef, viddef_t::virtualHeight, and viddef_t::virtualWidth.

Referenced by CL_SendCommand(), and CL_ViewLoadMedia().

static 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().

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_s::height, it_pic, R_BeginFrame(), R_DrawImage(), R_EndFrame(), R_FindImage(), SCR_DrawLoadingBar(), UI_DrawString(), viddef, viddef_t::virtualHeight, viddef_t::virtualWidth, and image_s::width.

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

static 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().

void SCR_EndLoadingPlaque ( void  )
See also
SCR_BeginLoadingPlaque

Definition at line 277 of file cl_screen.cpp.

References cls, and client_static_s::disableScreen.

Referenced by CL_Drop(), CL_ViewLoadMedia(), and Qcommon_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(), cvar_s::flags, SCR_TimeRefresh_f(), SCR_TouchPics(), and screenInitialized.

Referenced by CL_Init().

void SCR_RunConsole ( void  )

Scroll it up or down.

Definition at line 222 of file cl_screen.cpp.

References cls, client_static_s::frametime, key_console, client_static_s::keyDest, scr_con_current, scr_conlines, and cvar_s::value.

Referenced by CL_Frame().

void SCR_Shutdown ( void  )

Definition at line 397 of file cl_screen.cpp.

References screenInitialized.

Referenced by CL_Shutdown().

static 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, cvar_s::integer, it_pic, R_FindImage(), and SCR_ChangeCursor().

Referenced by SCR_DrawCursor(), and SCR_Init().

Variable Documentation

char cursorImage[MAX_QPATH]
static

Definition at line 65 of file cl_screen.cpp.

Referenced by SCR_DrawCursor(), and SCR_TouchPics().

float scr_con_current
static

Definition at line 54 of file cl_screen.cpp.

Referenced by SCR_DrawConsole(), and SCR_RunConsole().

float scr_conlines
static

Definition at line 55 of file cl_screen.cpp.

Referenced by SCR_RunConsole().

cvar_t* scr_consize
static

Definition at line 60 of file cl_screen.cpp.

cvar_t* scr_conspeed
static

Definition at line 59 of file cl_screen.cpp.

cvar_t* scr_cursor
static

Definition at line 62 of file cl_screen.cpp.

cvar_t* scr_rspeed
static

Definition at line 61 of file cl_screen.cpp.

cvar_t* scr_showcursor
static

Definition at line 63 of file cl_screen.cpp.

bool screenInitialized = false
static

Definition at line 57 of file cl_screen.cpp.

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