mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-29 16:24:16 +00:00
client: add cl_showpos
This commit is contained in:
parent
e77957bc81
commit
a813be7d54
@ -31,6 +31,7 @@ static convar_t *cl_envshot_size;
|
|||||||
convar_t *v_dark;
|
convar_t *v_dark;
|
||||||
static convar_t *net_speeds;
|
static convar_t *net_speeds;
|
||||||
static convar_t *cl_showfps;
|
static convar_t *cl_showfps;
|
||||||
|
static convar_t *cl_showpos;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -104,6 +105,41 @@ void SCR_DrawFPS( int height )
|
|||||||
Con_DrawString( refState.width - offset - 4, height, fpsstring, color );
|
Con_DrawString( refState.width - offset - 4, height, fpsstring, color );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==============
|
||||||
|
SCR_DrawPos
|
||||||
|
|
||||||
|
Draw local player position, angles and velocity
|
||||||
|
==============
|
||||||
|
*/
|
||||||
|
void SCR_DrawPos( void )
|
||||||
|
{
|
||||||
|
static char msg[MAX_SYSPATH];
|
||||||
|
float speed;
|
||||||
|
cl_entity_t *ent;
|
||||||
|
rgba_t color;
|
||||||
|
|
||||||
|
if( cls.state != ca_active || !cl_showpos->value || cl.background )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ent = CL_GetLocalPlayer();
|
||||||
|
speed = VectorLength( cl.simvel );
|
||||||
|
|
||||||
|
Q_snprintf( msg, MAX_SYSPATH,
|
||||||
|
"pos: %.2f %.2f %.2f\n"
|
||||||
|
"ang: %.2f %.2f %.2f\n"
|
||||||
|
"velocity: %.2f",
|
||||||
|
cl.simorg[0], cl.simorg[1], cl.simorg[2],
|
||||||
|
// should we use entity angles or viewangles?
|
||||||
|
// view isn't always bound to player
|
||||||
|
ent->angles[0], ent->angles[1], ent->angles[2],
|
||||||
|
speed );
|
||||||
|
|
||||||
|
MakeRGBA( color, 255, 255, 255, 255 );
|
||||||
|
|
||||||
|
Con_DrawString( refState.width / 2, 4, msg, color );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==============
|
==============
|
||||||
SCR_NetSpeeds
|
SCR_NetSpeeds
|
||||||
@ -781,6 +817,7 @@ void SCR_Init( void )
|
|||||||
scr_viewsize = Cvar_Get( "viewsize", "120", FCVAR_ARCHIVE, "screen size" );
|
scr_viewsize = Cvar_Get( "viewsize", "120", FCVAR_ARCHIVE, "screen size" );
|
||||||
net_speeds = Cvar_Get( "net_speeds", "0", FCVAR_ARCHIVE, "show network packets" );
|
net_speeds = Cvar_Get( "net_speeds", "0", FCVAR_ARCHIVE, "show network packets" );
|
||||||
cl_showfps = Cvar_Get( "cl_showfps", "1", FCVAR_ARCHIVE, "show client fps" );
|
cl_showfps = Cvar_Get( "cl_showfps", "1", FCVAR_ARCHIVE, "show client fps" );
|
||||||
|
cl_showpos = Cvar_Get( "cl_showpos", "0", FCVAR_ARCHIVE, "show local player position and velocity" );
|
||||||
|
|
||||||
// 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" );
|
||||||
|
@ -475,6 +475,7 @@ void V_PostRender( void )
|
|||||||
{
|
{
|
||||||
SCR_RSpeeds();
|
SCR_RSpeeds();
|
||||||
SCR_NetSpeeds();
|
SCR_NetSpeeds();
|
||||||
|
SCR_DrawPos();
|
||||||
SCR_DrawNetGraph();
|
SCR_DrawNetGraph();
|
||||||
SV_DrawOrthoTriangles();
|
SV_DrawOrthoTriangles();
|
||||||
CL_DrawDemoRecording();
|
CL_DrawDemoRecording();
|
||||||
|
@ -880,6 +880,7 @@ void SCR_MakeLevelShot( void );
|
|||||||
void SCR_NetSpeeds( void );
|
void SCR_NetSpeeds( void );
|
||||||
void SCR_RSpeeds( void );
|
void SCR_RSpeeds( void );
|
||||||
void SCR_DrawFPS( int height );
|
void SCR_DrawFPS( int height );
|
||||||
|
void SCR_DrawPos( void );
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_netgraph.c
|
// cl_netgraph.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user