2007-11-06 22:00:00 +01:00
|
|
|
|
//=======================================================================
|
|
|
|
|
// Copyright XashXT Group 2007 <20>
|
|
|
|
|
// cl_scrn.c - build client frame
|
|
|
|
|
//=======================================================================
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
2008-06-09 22:00:00 +02:00
|
|
|
|
#include "common.h"
|
2007-06-21 22:00:00 +02:00
|
|
|
|
#include "client.h"
|
2010-07-08 22:00:00 +02:00
|
|
|
|
#include "byteorder.h"
|
2010-09-10 22:00:00 +02:00
|
|
|
|
#include "qfont.h"
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
2007-11-08 22:00:00 +01:00
|
|
|
|
cvar_t *scr_viewsize;
|
|
|
|
|
cvar_t *scr_centertime;
|
|
|
|
|
cvar_t *scr_printspeed;
|
|
|
|
|
cvar_t *scr_loading;
|
2008-08-03 22:00:00 +02:00
|
|
|
|
cvar_t *scr_download;
|
2007-11-18 22:00:00 +01:00
|
|
|
|
cvar_t *scr_width;
|
|
|
|
|
cvar_t *scr_height;
|
2008-08-04 22:00:00 +02:00
|
|
|
|
cvar_t *cl_testlights;
|
2010-07-17 22:00:00 +02:00
|
|
|
|
cvar_t *cl_allow_levelshots;
|
2007-11-13 22:00:00 +01:00
|
|
|
|
cvar_t *cl_levelshot_name;
|
2008-11-09 22:00:00 +01:00
|
|
|
|
cvar_t *cl_envshot_size;
|
2007-11-06 22:00:00 +01:00
|
|
|
|
|
2010-07-20 22:00:00 +02:00
|
|
|
|
static bool scr_init = false;
|
2007-11-04 22:00:00 +01:00
|
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
|
/*
|
|
|
|
|
==============
|
|
|
|
|
SCR_DrawFPS
|
|
|
|
|
==============
|
|
|
|
|
*/
|
|
|
|
|
void SCR_DrawFPS( void )
|
|
|
|
|
{
|
|
|
|
|
float calc;
|
2010-07-20 22:00:00 +02:00
|
|
|
|
rgba_t color;
|
2008-12-26 22:00:00 +01:00
|
|
|
|
static double nexttime = 0, lasttime = 0;
|
|
|
|
|
static double framerate = 0;
|
|
|
|
|
static int framecount = 0;
|
|
|
|
|
double newtime;
|
|
|
|
|
char fpsstring[32];
|
|
|
|
|
|
|
|
|
|
if( cls.state != ca_active ) return;
|
2009-01-01 22:00:00 +01:00
|
|
|
|
if( !cl_showfps->integer ) return;
|
2009-09-23 22:00:00 +02:00
|
|
|
|
if( cls.scrshot_action != scrshot_inactive )
|
|
|
|
|
return;
|
2008-12-26 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
newtime = Sys_DoubleTime();
|
2009-09-17 22:00:00 +02:00
|
|
|
|
if( newtime >= nexttime )
|
2008-12-26 22:00:00 +01:00
|
|
|
|
{
|
|
|
|
|
framerate = framecount / (newtime - lasttime);
|
|
|
|
|
lasttime = newtime;
|
2010-07-23 22:00:00 +02:00
|
|
|
|
nexttime = max( nexttime + 1, lasttime - 1 );
|
2008-12-26 22:00:00 +01:00
|
|
|
|
framecount = 0;
|
|
|
|
|
}
|
2010-07-20 22:00:00 +02:00
|
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
|
framecount++;
|
|
|
|
|
calc = framerate;
|
|
|
|
|
|
2010-07-20 22:00:00 +02:00
|
|
|
|
if( calc < 1.0f )
|
2008-12-26 22:00:00 +01:00
|
|
|
|
{
|
|
|
|
|
com.snprintf( fpsstring, sizeof( fpsstring ), "%4i spf", (int)(1.0f / calc + 0.5));
|
2010-07-20 22:00:00 +02:00
|
|
|
|
MakeRGBA( color, 255, 0, 0, 255 );
|
2008-12-26 22:00:00 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
com.snprintf( fpsstring, sizeof( fpsstring ), "%4i fps", (int)(calc + 0.5));
|
2010-07-20 22:00:00 +02:00
|
|
|
|
MakeRGBA( color, 255, 255, 255, 255 );
|
2008-12-26 22:00:00 +01:00
|
|
|
|
}
|
2010-07-20 22:00:00 +02:00
|
|
|
|
Con_DrawString( scr_width->integer - 68, 4, fpsstring, color );
|
2008-12-26 22:00:00 +01:00
|
|
|
|
}
|
|
|
|
|
|
2010-07-26 22:00:00 +02:00
|
|
|
|
void SCR_NetSpeeds( void )
|
|
|
|
|
{
|
|
|
|
|
static char msg[MAX_SYSPATH];
|
|
|
|
|
int x, y, height;
|
|
|
|
|
char *p, *start, *end;
|
|
|
|
|
float time = sv_time();
|
|
|
|
|
rgba_t color;
|
|
|
|
|
|
|
|
|
|
if( !net_speeds->integer ) return;
|
|
|
|
|
if( cls.state != ca_active ) return;
|
|
|
|
|
|
|
|
|
|
switch( net_speeds->integer )
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
if( cls.netchan.compress )
|
|
|
|
|
{
|
|
|
|
|
com.snprintf( msg, sizeof( msg ), "Game Time: %02d:%02d\nTotal received from server:\n Huffman %s\nUncompressed %s\n",
|
|
|
|
|
(int)(time / 60.0f ), (int)fmod( time, 60.0f ), memprint( cls.netchan.total_received ), memprint( cls.netchan.total_received_uncompressed ));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
com.snprintf( msg, sizeof( msg ), "Game Time: %02d:%02d\nTotal received from server:\nUncompressed %s\n",
|
|
|
|
|
(int)(time / 60.0f ), (int)fmod( time, 60.0f ), memprint( cls.netchan.total_received_uncompressed ));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
if( cls.netchan.compress )
|
|
|
|
|
{
|
|
|
|
|
com.snprintf( msg, sizeof( msg ), "Game Time: %02d:%02d\nTotal sended to server:\nHuffman %s\nUncompressed %s\n",
|
|
|
|
|
(int)(time / 60.0f ), (int)fmod( time, 60.0f ), memprint( cls.netchan.total_sended ), memprint( cls.netchan.total_sended_uncompressed ));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
com.snprintf( msg, sizeof( msg ), "Game Time: %02d:%02d\nTotal sended to server:\nUncompressed %s\n",
|
|
|
|
|
(int)(time / 60.0f ), (int)fmod( time, 60.0f ), memprint( cls.netchan.total_sended_uncompressed ));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default: return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
x = scr_width->integer - 320;
|
|
|
|
|
y = 256;
|
|
|
|
|
|
|
|
|
|
Con_DrawStringLen( NULL, NULL, &height );
|
|
|
|
|
MakeRGBA( color, 255, 255, 255, 255 );
|
|
|
|
|
|
|
|
|
|
p = start = msg;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
end = com.strchr( p, '\n' );
|
|
|
|
|
if( end ) msg[end-start] = '\0';
|
|
|
|
|
|
|
|
|
|
Con_DrawString( x, y, p, color );
|
|
|
|
|
y += height;
|
|
|
|
|
|
|
|
|
|
if( end ) p = end + 1;
|
|
|
|
|
else break;
|
|
|
|
|
} while( 1 );
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-01 22:00:00 +02:00
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
SCR_RSpeeds
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void SCR_RSpeeds( void )
|
|
|
|
|
{
|
|
|
|
|
char msg[MAX_SYSPATH];
|
|
|
|
|
|
|
|
|
|
if( re->RSpeedsMessage( msg, sizeof( msg )))
|
|
|
|
|
{
|
|
|
|
|
int x, y, height;
|
|
|
|
|
char *p, *start, *end;
|
2009-09-10 22:00:00 +02:00
|
|
|
|
rgba_t color;
|
2009-09-01 22:00:00 +02:00
|
|
|
|
|
2010-07-20 22:00:00 +02:00
|
|
|
|
x = scr_width->integer - 320;
|
2009-09-01 22:00:00 +02:00
|
|
|
|
y = 64;
|
2010-07-20 22:00:00 +02:00
|
|
|
|
|
|
|
|
|
Con_DrawStringLen( NULL, NULL, &height );
|
2009-09-10 22:00:00 +02:00
|
|
|
|
MakeRGBA( color, 255, 255, 255, 255 );
|
2009-09-01 22:00:00 +02:00
|
|
|
|
|
|
|
|
|
p = start = msg;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
end = com.strchr( p, '\n' );
|
|
|
|
|
if( end ) msg[end-start] = '\0';
|
|
|
|
|
|
2010-07-20 22:00:00 +02:00
|
|
|
|
Con_DrawString( x, y, p, color );
|
2009-09-01 22:00:00 +02:00
|
|
|
|
y += height;
|
|
|
|
|
|
|
|
|
|
if( end ) p = end + 1;
|
|
|
|
|
else break;
|
|
|
|
|
} while( 1 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-18 22:00:00 +02:00
|
|
|
|
void SCR_MakeLevelShot( void )
|
|
|
|
|
{
|
|
|
|
|
if( cls.scrshot_request != scrshot_plaque )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// make levelshot at nextframe()
|
2010-07-13 22:00:00 +02:00
|
|
|
|
Cbuf_AddText( "wait 2\nlevelshot\n" );
|
2009-10-18 22:00:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-23 22:00:00 +02:00
|
|
|
|
void SCR_MakeScreenShot( void )
|
|
|
|
|
{
|
2010-03-26 22:00:00 +01:00
|
|
|
|
bool iRet = false;
|
|
|
|
|
|
2009-09-23 22:00:00 +02:00
|
|
|
|
if( !re && host.type == HOST_NORMAL )
|
2010-07-17 22:00:00 +02:00
|
|
|
|
return; // don't reset action - it will be wait until render initalization is done
|
2009-09-23 22:00:00 +02:00
|
|
|
|
|
|
|
|
|
switch( cls.scrshot_action )
|
|
|
|
|
{
|
|
|
|
|
case scrshot_plaque:
|
2010-03-26 22:00:00 +01:00
|
|
|
|
iRet = re->ScrShot( cls.shotname, VID_LEVELSHOT );
|
2009-09-23 22:00:00 +02:00
|
|
|
|
break;
|
|
|
|
|
case scrshot_savegame:
|
2010-01-07 22:00:00 +01:00
|
|
|
|
case scrshot_demoshot:
|
2010-03-26 22:00:00 +01:00
|
|
|
|
iRet = re->ScrShot( cls.shotname, VID_MINISHOT );
|
|
|
|
|
break;
|
|
|
|
|
case scrshot_envshot:
|
|
|
|
|
iRet = re->EnvShot( cls.shotname, cl_envshot_size->integer, cls.envshot_vieworg, false );
|
2009-09-23 22:00:00 +02:00
|
|
|
|
break;
|
2010-03-26 22:00:00 +01:00
|
|
|
|
case scrshot_skyshot:
|
|
|
|
|
iRet = re->EnvShot( cls.shotname, cl_envshot_size->integer, cls.envshot_vieworg, true );
|
|
|
|
|
break;
|
|
|
|
|
default: return; // does nothing
|
2009-09-23 22:00:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-03-26 22:00:00 +01:00
|
|
|
|
// report
|
|
|
|
|
if( iRet ) MsgDev( D_INFO, "Write %s\n", cls.shotname );
|
|
|
|
|
else MsgDev( D_ERROR, "Unable to write %s\n", cls.shotname );
|
|
|
|
|
|
|
|
|
|
cls.envshot_vieworg = NULL;
|
2009-09-23 22:00:00 +02:00
|
|
|
|
cls.scrshot_action = scrshot_inactive;
|
|
|
|
|
cls.shotname[0] = '\0';
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-18 22:00:00 +02:00
|
|
|
|
void SCR_DrawPlaque( void )
|
|
|
|
|
{
|
2010-07-17 22:00:00 +02:00
|
|
|
|
shader_t levelshot;
|
2009-10-18 22:00:00 +02:00
|
|
|
|
|
2010-08-22 22:00:00 +02:00
|
|
|
|
if( !re ) return;
|
|
|
|
|
|
|
|
|
|
if( cl_allow_levelshots->integer && !cls.changelevel )
|
2010-07-17 22:00:00 +02:00
|
|
|
|
{
|
|
|
|
|
levelshot = re->RegisterShader( cl_levelshot_name->string, SHADER_NOMIP );
|
2010-07-19 22:00:00 +02:00
|
|
|
|
re->SetParms( levelshot, kRenderNormal, 0 );
|
|
|
|
|
re->DrawStretchPic( 0, 0, scr_width->integer, scr_height->integer, 0, 0, 1, 1, levelshot );
|
2010-08-22 22:00:00 +02:00
|
|
|
|
|
|
|
|
|
CL_DrawHUD( CL_LOADING );
|
2010-07-17 22:00:00 +02:00
|
|
|
|
}
|
2009-10-18 22:00:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
|
/*
|
|
|
|
|
==================
|
2007-11-06 22:00:00 +01:00
|
|
|
|
SCR_UpdateScreen
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
2007-11-06 22:00:00 +01:00
|
|
|
|
This is called every frame, and can also be called explicitly to flush
|
|
|
|
|
text to the screen.
|
2007-06-21 22:00:00 +02:00
|
|
|
|
==================
|
|
|
|
|
*/
|
2007-11-06 22:00:00 +01:00
|
|
|
|
void SCR_UpdateScreen( void )
|
2007-06-21 22:00:00 +02:00
|
|
|
|
{
|
2010-02-10 22:00:00 +01:00
|
|
|
|
if( V_PreRender( ))
|
2007-06-21 22:00:00 +02:00
|
|
|
|
{
|
2010-02-10 22:00:00 +01:00
|
|
|
|
switch( cls.state )
|
|
|
|
|
{
|
|
|
|
|
case ca_disconnected:
|
|
|
|
|
break;
|
|
|
|
|
case ca_connecting:
|
|
|
|
|
case ca_connected:
|
|
|
|
|
SCR_DrawPlaque();
|
|
|
|
|
break;
|
|
|
|
|
case ca_active:
|
|
|
|
|
V_RenderView();
|
|
|
|
|
CL_DrawHUD( CL_ACTIVE );
|
|
|
|
|
CL_DrawDemoRecording();
|
|
|
|
|
break;
|
|
|
|
|
case ca_cinematic:
|
|
|
|
|
SCR_DrawCinematic();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
Host_Error( "SCR_UpdateScreen: bad cls.state\n" );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
V_PostRender();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( clgame.hInstance )
|
2010-07-23 22:00:00 +02:00
|
|
|
|
clgame.dllFuncs.pfnFrame( cl_time( ));
|
2007-11-05 22:00:00 +01:00
|
|
|
|
}
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
2010-07-13 22:00:00 +02:00
|
|
|
|
static void SCR_LoadCreditsFont( void )
|
2010-07-08 22:00:00 +02:00
|
|
|
|
{
|
|
|
|
|
if( !re ) return;
|
|
|
|
|
|
|
|
|
|
// setup creditsfont
|
2010-07-17 22:00:00 +02:00
|
|
|
|
if( FS_FileExists( "gfx/creditsfont.fnt" ))
|
2010-07-08 22:00:00 +02:00
|
|
|
|
{
|
|
|
|
|
byte *buffer;
|
|
|
|
|
size_t length;
|
2010-07-20 22:00:00 +02:00
|
|
|
|
int fontWidth;
|
2010-07-08 22:00:00 +02:00
|
|
|
|
qfont_t *src;
|
|
|
|
|
|
|
|
|
|
// half-life font with variable chars witdh
|
|
|
|
|
buffer = FS_LoadFile( "gfx/creditsfont.fnt", &length );
|
2010-07-20 22:00:00 +02:00
|
|
|
|
re->GetParms( &fontWidth, NULL, NULL, 0, cls.creditsFont.hFontTexture );
|
|
|
|
|
|
2010-07-08 22:00:00 +02:00
|
|
|
|
if( buffer && length >= sizeof( qfont_t ))
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
src = (qfont_t *)buffer;
|
|
|
|
|
clgame.scrInfo.iCharHeight = LittleLong( src->rowheight );
|
|
|
|
|
|
|
|
|
|
// build rectangles
|
|
|
|
|
for( i = 0; i < 256; i++ )
|
|
|
|
|
{
|
2010-07-20 22:00:00 +02:00
|
|
|
|
cls.creditsFont.fontRc[i].left = LittleShort( src->fontinfo[i].startoffset ) % fontWidth;
|
|
|
|
|
cls.creditsFont.fontRc[i].right = cls.creditsFont.fontRc[i].left + LittleShort( src->fontinfo[i].charwidth );
|
|
|
|
|
cls.creditsFont.fontRc[i].top = LittleShort( src->fontinfo[i].startoffset ) / fontWidth;
|
|
|
|
|
cls.creditsFont.fontRc[i].bottom = cls.creditsFont.fontRc[i].top + LittleLong( src->rowheight );
|
2010-07-08 22:00:00 +02:00
|
|
|
|
clgame.scrInfo.charWidths[i] = LittleLong( src->fontinfo[i].charwidth );
|
|
|
|
|
}
|
2010-07-20 22:00:00 +02:00
|
|
|
|
cls.creditsFont.valid = true;
|
2010-07-08 22:00:00 +02:00
|
|
|
|
}
|
|
|
|
|
if( buffer ) Mem_Free( buffer );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-13 22:00:00 +02:00
|
|
|
|
static void SCR_InstallParticlePalette( void )
|
|
|
|
|
{
|
|
|
|
|
rgbdata_t *pic;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
// NOTE: imagelib required this fakebuffer for loading internal palette
|
|
|
|
|
pic = FS_LoadImage( "#quake.pal", ((byte *)&i), 768 );
|
|
|
|
|
|
|
|
|
|
if( pic )
|
|
|
|
|
{
|
|
|
|
|
for( i = 0; i < 256; i++ )
|
|
|
|
|
{
|
|
|
|
|
clgame.palette[i][0] = pic->palette[i*4+0];
|
|
|
|
|
clgame.palette[i][1] = pic->palette[i*4+1];
|
|
|
|
|
clgame.palette[i][2] = pic->palette[i*4+2];
|
|
|
|
|
}
|
|
|
|
|
FS_FreeImage( pic );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for( i = 0; i < 256; i++ )
|
|
|
|
|
{
|
|
|
|
|
clgame.palette[i][0] = i;
|
|
|
|
|
clgame.palette[i][1] = i;
|
|
|
|
|
clgame.palette[i][2] = i;
|
|
|
|
|
}
|
|
|
|
|
MsgDev( D_WARN, "CL_InstallParticlePalette: failed. Force to grayscale\n" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-15 22:00:00 +01:00
|
|
|
|
void SCR_RegisterShaders( void )
|
|
|
|
|
{
|
2009-01-25 22:00:00 +01:00
|
|
|
|
if( re )
|
|
|
|
|
{
|
2010-07-20 22:00:00 +02:00
|
|
|
|
cls.fillShader = re->RegisterShader( "*white", SHADER_NOMIP ); // used for FillRGBA
|
|
|
|
|
|
|
|
|
|
// register gfx.wad images
|
2010-07-19 22:00:00 +02:00
|
|
|
|
cls.pauseIcon = re->RegisterShader( "gfx/paused", SHADER_NOMIP ); // FIXME: MAKE INTRESOURCE
|
|
|
|
|
cls.loadingBar = re->RegisterShader( "gfx/lambda", SHADER_NOMIP ); // FIXME: MAKE INTRESOURCE
|
2010-07-20 22:00:00 +02:00
|
|
|
|
cls.creditsFont.hFontTexture = re->RegisterShader( "gfx/creditsfont", SHADER_NOMIP ); // FIXME: MAKE INTRESOURCE
|
|
|
|
|
}
|
2010-07-19 22:00:00 +02:00
|
|
|
|
|
2010-07-20 22:00:00 +02:00
|
|
|
|
Mem_Set( &clgame.ds, 0, sizeof( clgame.ds )); // reset a draw state
|
|
|
|
|
Mem_Set( &gameui.ds, 0, sizeof( gameui.ds )); // reset a draw state
|
|
|
|
|
Mem_Set( &clgame.centerPrint, 0, sizeof( clgame.centerPrint ));
|
2009-12-05 22:00:00 +01:00
|
|
|
|
|
2010-07-20 22:00:00 +02:00
|
|
|
|
// update screen sizes for menu
|
|
|
|
|
gameui.globals->scrWidth = scr_width->integer;
|
|
|
|
|
gameui.globals->scrHeight = scr_height->integer;
|
2008-12-28 22:00:00 +01:00
|
|
|
|
|
|
|
|
|
// vid_state has changed
|
2009-06-24 22:00:00 +02:00
|
|
|
|
if( clgame.hInstance ) clgame.dllFuncs.pfnVidInit();
|
2010-07-18 22:00:00 +02:00
|
|
|
|
if( gameui.hInstance ) gameui.dllFuncs.pfnVidInit();
|
2010-07-19 22:00:00 +02:00
|
|
|
|
|
|
|
|
|
// restart console size
|
|
|
|
|
Con_VidInit ();
|
2008-11-15 22:00:00 +01:00
|
|
|
|
}
|
|
|
|
|
|
2007-11-05 22:00:00 +01:00
|
|
|
|
/*
|
|
|
|
|
==================
|
2007-11-06 22:00:00 +01:00
|
|
|
|
SCR_Init
|
2007-11-05 22:00:00 +01:00
|
|
|
|
==================
|
|
|
|
|
*/
|
2008-11-15 22:00:00 +01:00
|
|
|
|
void SCR_Init( void )
|
2007-11-05 22:00:00 +01:00
|
|
|
|
{
|
2009-10-02 22:00:00 +02:00
|
|
|
|
if( scr_init ) return;
|
|
|
|
|
|
2009-09-19 22:00:00 +02:00
|
|
|
|
scr_centertime = Cvar_Get( "scr_centertime", "2.5", 0, "centerprint hold time" );
|
|
|
|
|
scr_printspeed = Cvar_Get( "scr_printspeed", "8", 0, "centerprint speed of print" );
|
|
|
|
|
cl_levelshot_name = Cvar_Get( "cl_levelshot_name", MAP_DEFAULT_SHADER, 0, "contains path to current levelshot" );
|
2010-07-17 22:00:00 +02:00
|
|
|
|
cl_allow_levelshots = Cvar_Get( "allow_levelshots", "0", CVAR_ARCHIVE, "allow engine to use indivdual levelshots instead of 'loading' image" );
|
2010-07-20 22:00:00 +02:00
|
|
|
|
scr_loading = Cvar_Get( "scr_loading", "0", 0, "loading bar progress" );
|
|
|
|
|
scr_download = Cvar_Get( "scr_download", "0", 0, "downloading bar progress" );
|
|
|
|
|
cl_testlights = Cvar_Get( "cl_testlights", "0", 0, "test dynamic lights" );
|
2008-11-09 22:00:00 +01:00
|
|
|
|
cl_envshot_size = Cvar_Get( "cl_envshot_size", "256", CVAR_ARCHIVE, "envshot size of cube side" );
|
2008-11-15 22:00:00 +01:00
|
|
|
|
|
2007-11-06 22:00:00 +01:00
|
|
|
|
// register our commands
|
2008-01-20 22:00:00 +01:00
|
|
|
|
Cmd_AddCommand( "timerefresh", SCR_TimeRefresh_f, "turn quickly and print rendering statistcs" );
|
|
|
|
|
Cmd_AddCommand( "skyname", CL_SetSky_f, "set new skybox by basename" );
|
2008-08-04 22:00:00 +02:00
|
|
|
|
Cmd_AddCommand( "viewpos", SCR_Viewpos_f, "prints current player origin" );
|
2008-11-09 22:00:00 +01:00
|
|
|
|
|
2010-07-18 22:00:00 +02:00
|
|
|
|
if( !UI_LoadProgs( "GameUI.dll" ))
|
2010-07-21 22:00:00 +02:00
|
|
|
|
{
|
|
|
|
|
Msg( "^1Error: ^7can't initialize gameui.dll\n" ); // there is non fatal for us
|
|
|
|
|
if( !host.developer ) host.developer = 1; // we need console, because menu is missing
|
|
|
|
|
}
|
2010-07-18 22:00:00 +02:00
|
|
|
|
|
2010-07-13 22:00:00 +02:00
|
|
|
|
SCR_RegisterShaders ();
|
|
|
|
|
SCR_LoadCreditsFont ();
|
|
|
|
|
|
|
|
|
|
SCR_InstallParticlePalette ();
|
2010-07-08 22:00:00 +02:00
|
|
|
|
|
2009-12-20 22:00:00 +01:00
|
|
|
|
if( host.developer && FS_CheckParm( "-toconsole" ))
|
|
|
|
|
Cbuf_AddText( "toggleconsole\n" );
|
2010-07-18 22:00:00 +02:00
|
|
|
|
else UI_SetActiveMenu( true );
|
2009-11-23 22:00:00 +01:00
|
|
|
|
SCR_InitCinematic();
|
2009-10-02 22:00:00 +02:00
|
|
|
|
|
|
|
|
|
scr_init = true;
|
2008-08-04 22:00:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SCR_Shutdown( void )
|
|
|
|
|
{
|
2009-10-02 22:00:00 +02:00
|
|
|
|
if( !scr_init ) return;
|
|
|
|
|
|
|
|
|
|
Cmd_RemoveCommand( "timerefresh" );
|
|
|
|
|
Cmd_RemoveCommand( "skyname" );
|
|
|
|
|
Cmd_RemoveCommand( "viewpos" );
|
|
|
|
|
|
2010-07-18 22:00:00 +02:00
|
|
|
|
UI_SetActiveMenu( false );
|
|
|
|
|
UI_UnloadProgs();
|
2009-10-02 22:00:00 +02:00
|
|
|
|
scr_init = false;
|
2007-11-06 22:00:00 +01:00
|
|
|
|
}
|