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