|
|
|
@ -20,18 +20,18 @@ GNU General Public License for more details.
@@ -20,18 +20,18 @@ GNU General Public License for more details.
|
|
|
|
|
#include "input.h" |
|
|
|
|
#include "library.h" |
|
|
|
|
|
|
|
|
|
convar_t *scr_centertime; |
|
|
|
|
convar_t *scr_loading; |
|
|
|
|
convar_t *scr_download; |
|
|
|
|
convar_t *scr_viewsize; |
|
|
|
|
convar_t *cl_testlights; |
|
|
|
|
convar_t *cl_allow_levelshots; |
|
|
|
|
convar_t *cl_levelshot_name; |
|
|
|
|
static convar_t *cl_envshot_size; |
|
|
|
|
convar_t *v_dark; |
|
|
|
|
static convar_t *net_speeds; |
|
|
|
|
static convar_t *cl_showfps; |
|
|
|
|
static convar_t *cl_showpos; |
|
|
|
|
CVAR_DEFINE_AUTO( scr_centertime, "2.5", 0, "centerprint hold time" ); |
|
|
|
|
CVAR_DEFINE_AUTO( scr_loading, "0", 0, "loading bar progress" ); |
|
|
|
|
CVAR_DEFINE_AUTO( scr_download, "-1", 0, "downloading bar progress" ); |
|
|
|
|
CVAR_DEFINE( scr_viewsize, "viewsize", "120", FCVAR_ARCHIVE, "screen size (quake only)" ); |
|
|
|
|
CVAR_DEFINE_AUTO( cl_testlights, "0", 0, "test dynamic lights" ); |
|
|
|
|
CVAR_DEFINE( cl_allow_levelshots, "allow_levelshots", "0", FCVAR_ARCHIVE, "allow engine to use indivdual levelshots instead of 'loading' image" ); |
|
|
|
|
CVAR_DEFINE_AUTO( cl_levelshot_name, "*black", 0, "contains path to current levelshot" ); |
|
|
|
|
static CVAR_DEFINE_AUTO( cl_envshot_size, "256", FCVAR_ARCHIVE, "envshot size of cube side" ); |
|
|
|
|
CVAR_DEFINE_AUTO( v_dark, "0", 0, "starts level from dark screen" ); |
|
|
|
|
static CVAR_DEFINE_AUTO( net_speeds, "0", FCVAR_ARCHIVE, "show network packets" ); |
|
|
|
|
static CVAR_DEFINE_AUTO( cl_showfps, "0", FCVAR_ARCHIVE, "show client fps" ); |
|
|
|
|
static CVAR_DEFINE_AUTO( cl_showpos, "0", FCVAR_ARCHIVE, "show local player position and velocity" ); |
|
|
|
|
|
|
|
|
|
typedef struct |
|
|
|
|
{ |
|
|
|
@ -59,7 +59,7 @@ void SCR_DrawFPS( int height )
@@ -59,7 +59,7 @@ void SCR_DrawFPS( int height )
|
|
|
|
|
char fpsstring[64]; |
|
|
|
|
int offset; |
|
|
|
|
|
|
|
|
|
if( cls.state != ca_active || !cl_showfps->value || cl.background ) |
|
|
|
|
if( cls.state != ca_active || !cl_showfps.value || cl.background ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
switch( cls.scrshot_action ) |
|
|
|
@ -95,7 +95,7 @@ void SCR_DrawFPS( int height )
@@ -95,7 +95,7 @@ void SCR_DrawFPS( int height )
|
|
|
|
|
if( curfps < minfps ) minfps = curfps; |
|
|
|
|
if( curfps > maxfps ) maxfps = curfps; |
|
|
|
|
|
|
|
|
|
if( cl_showfps->value == 2 ) |
|
|
|
|
if( cl_showfps.value == 2 ) |
|
|
|
|
Q_snprintf( fpsstring, sizeof( fpsstring ), "fps: ^1%4i min, ^3%4i cur, ^2%4i max", minfps, curfps, maxfps ); |
|
|
|
|
else Q_snprintf( fpsstring, sizeof( fpsstring ), "%4i fps", curfps ); |
|
|
|
|
MakeRGBA( color, 255, 255, 255, 255 ); |
|
|
|
@ -119,7 +119,7 @@ void SCR_DrawPos( void )
@@ -119,7 +119,7 @@ void SCR_DrawPos( void )
|
|
|
|
|
cl_entity_t *ent; |
|
|
|
|
rgba_t color; |
|
|
|
|
|
|
|
|
|
if( cls.state != ca_active || !cl_showpos->value || cl.background ) |
|
|
|
|
if( cls.state != ca_active || !cl_showpos.value || cl.background ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
ent = CL_GetLocalPlayer(); |
|
|
|
@ -164,7 +164,7 @@ void SCR_NetSpeeds( void )
@@ -164,7 +164,7 @@ void SCR_NetSpeeds( void )
|
|
|
|
|
if( !host.allow_console ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if( !net_speeds->value || cls.state != ca_active ) |
|
|
|
|
if( !net_speeds.value || cls.state != ca_active ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
// prevent to get too big values at max
|
|
|
|
@ -290,7 +290,7 @@ void SCR_MakeScreenShot( void )
@@ -290,7 +290,7 @@ void SCR_MakeScreenShot( void )
|
|
|
|
|
|
|
|
|
|
if( cls.envshot_viewsize > 0 ) |
|
|
|
|
viewsize = cls.envshot_viewsize; |
|
|
|
|
else viewsize = cl_envshot_size->value; |
|
|
|
|
else viewsize = cl_envshot_size.value; |
|
|
|
|
|
|
|
|
|
switch( cls.scrshot_action ) |
|
|
|
|
{ |
|
|
|
@ -344,9 +344,9 @@ SCR_DrawPlaque
@@ -344,9 +344,9 @@ SCR_DrawPlaque
|
|
|
|
|
*/ |
|
|
|
|
void SCR_DrawPlaque( void ) |
|
|
|
|
{ |
|
|
|
|
if(( cl_allow_levelshots->value && !cls.changelevel ) || cl.background ) |
|
|
|
|
if(( cl_allow_levelshots.value && !cls.changelevel ) || cl.background ) |
|
|
|
|
{ |
|
|
|
|
int levelshot = ref.dllFuncs.GL_LoadTexture( cl_levelshot_name->string, NULL, 0, TF_IMAGE ); |
|
|
|
|
int levelshot = ref.dllFuncs.GL_LoadTexture( cl_levelshot_name.string, NULL, 0, TF_IMAGE ); |
|
|
|
|
ref.dllFuncs.GL_SetRenderMode( kRenderNormal ); |
|
|
|
|
ref.dllFuncs.R_DrawStretchPic( 0, 0, refState.width, refState.height, 0, 0, 1, 1, levelshot ); |
|
|
|
|
if( !cl.background ) CL_DrawHUD( CL_LOADING ); |
|
|
|
@ -442,7 +442,7 @@ void SCR_TileClear( void )
@@ -442,7 +442,7 @@ void SCR_TileClear( void )
|
|
|
|
|
int i, top, bottom, left, right; |
|
|
|
|
dirty_t clear; |
|
|
|
|
|
|
|
|
|
if( scr_viewsize->value >= 120 ) |
|
|
|
|
if( scr_viewsize.value >= 120 ) |
|
|
|
|
return; // full screen rendering
|
|
|
|
|
|
|
|
|
|
// erase rect will be the union of the past three frames
|
|
|
|
@ -652,13 +652,13 @@ void SCR_RegisterTextures( void )
@@ -652,13 +652,13 @@ void SCR_RegisterTextures( void )
|
|
|
|
|
|
|
|
|
|
if( FS_FileExists( "gfx/lambda.lmp", false )) |
|
|
|
|
{ |
|
|
|
|
if( cl_allow_levelshots->value ) |
|
|
|
|
if( cl_allow_levelshots.value ) |
|
|
|
|
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE ); |
|
|
|
|
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE ); |
|
|
|
|
} |
|
|
|
|
else if( FS_FileExists( "gfx/loading.lmp", false )) |
|
|
|
|
{ |
|
|
|
|
if( cl_allow_levelshots->value ) |
|
|
|
|
if( cl_allow_levelshots.value ) |
|
|
|
|
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE ); |
|
|
|
|
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE ); |
|
|
|
|
} |
|
|
|
@ -675,7 +675,7 @@ Keybinding command
@@ -675,7 +675,7 @@ Keybinding command
|
|
|
|
|
*/ |
|
|
|
|
void SCR_SizeUp_f( void ) |
|
|
|
|
{ |
|
|
|
|
Cvar_SetValue( "viewsize", Q_min( scr_viewsize->value + 10, 120 )); |
|
|
|
|
Cvar_SetValue( "viewsize", Q_min( scr_viewsize.value + 10, 120 )); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -688,7 +688,7 @@ Keybinding command
@@ -688,7 +688,7 @@ Keybinding command
|
|
|
|
|
*/ |
|
|
|
|
void SCR_SizeDown_f( void ) |
|
|
|
|
{ |
|
|
|
|
Cvar_SetValue( "viewsize", Q_max( scr_viewsize->value - 10, 30 )); |
|
|
|
|
Cvar_SetValue( "viewsize", Q_max( scr_viewsize.value - 10, 30 )); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -737,18 +737,18 @@ void SCR_Init( void )
@@ -737,18 +737,18 @@ void SCR_Init( void )
|
|
|
|
|
{ |
|
|
|
|
if( scr_init ) return; |
|
|
|
|
|
|
|
|
|
scr_centertime = Cvar_Get( "scr_centertime", "2.5", 0, "centerprint hold time" ); |
|
|
|
|
cl_levelshot_name = Cvar_Get( "cl_levelshot_name", "*black", 0, "contains path to current levelshot" ); |
|
|
|
|
cl_allow_levelshots = Cvar_Get( "allow_levelshots", "0", FCVAR_ARCHIVE, "allow engine to use indivdual levelshots instead of 'loading' image" ); |
|
|
|
|
scr_loading = Cvar_Get( "scr_loading", "0", 0, "loading bar progress" ); |
|
|
|
|
scr_download = Cvar_Get( "scr_download", "-1", 0, "downloading bar progress" ); |
|
|
|
|
cl_testlights = Cvar_Get( "cl_testlights", "0", 0, "test dynamic lights" ); |
|
|
|
|
cl_envshot_size = Cvar_Get( "cl_envshot_size", "256", FCVAR_ARCHIVE, "envshot size of cube side" ); |
|
|
|
|
v_dark = Cvar_Get( "v_dark", "0", 0, "starts level from dark screen" ); |
|
|
|
|
scr_viewsize = Cvar_Get( "viewsize", "120", FCVAR_ARCHIVE, "screen size" ); |
|
|
|
|
net_speeds = Cvar_Get( "net_speeds", "0", FCVAR_ARCHIVE, "show network packets" ); |
|
|
|
|
cl_showfps = Cvar_Get( "cl_showfps", "0", FCVAR_ARCHIVE, "show client fps" ); |
|
|
|
|
cl_showpos = Cvar_Get( "cl_showpos", "0", FCVAR_ARCHIVE, "show local player position and velocity" ); |
|
|
|
|
Cvar_RegisterVariable( &scr_centertime ); |
|
|
|
|
Cvar_RegisterVariable( &cl_levelshot_name ); |
|
|
|
|
Cvar_RegisterVariable( &cl_allow_levelshots ); |
|
|
|
|
Cvar_RegisterVariable( &scr_loading ); |
|
|
|
|
Cvar_RegisterVariable( &scr_download ); |
|
|
|
|
Cvar_RegisterVariable( &cl_testlights ); |
|
|
|
|
Cvar_RegisterVariable( &cl_envshot_size ); |
|
|
|
|
Cvar_RegisterVariable( &v_dark ); |
|
|
|
|
Cvar_RegisterVariable( &scr_viewsize ); |
|
|
|
|
Cvar_RegisterVariable( &net_speeds ); |
|
|
|
|
Cvar_RegisterVariable( &cl_showfps ); |
|
|
|
|
Cvar_RegisterVariable( &cl_showpos ); |
|
|
|
|
|
|
|
|
|
// register our commands
|
|
|
|
|
Cmd_AddCommand( "skyname", CL_SetSky_f, "set new skybox by basename" ); |
|
|
|
|