mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-14 00:40:55 +00:00
[qw] Move netgraph setup into cl_ngraph
This finally gets cl_screen so it can be merged.
This commit is contained in:
parent
010b61ee8b
commit
9f01cb25fe
4 changed files with 20 additions and 15 deletions
|
@ -297,8 +297,7 @@ extern struct cbuf_s *cl_stbuf;
|
||||||
struct cvar_s;
|
struct cvar_s;
|
||||||
void Cvar_Info (void *data, const struct cvar_s *cvar);
|
void Cvar_Info (void *data, const struct cvar_s *cvar);
|
||||||
|
|
||||||
extern struct view_s cl_netgraph_view;
|
void CL_NetGraph_Init (void);
|
||||||
void CL_NetGraph (struct view_s view);
|
|
||||||
void CL_NetGraph_Init_Cvars (void);
|
void CL_NetGraph_Init_Cvars (void);
|
||||||
|
|
||||||
extern struct view_s cl_screen_view;
|
extern struct view_s cl_screen_view;
|
||||||
|
|
|
@ -1510,6 +1510,7 @@ CL_Init (void)
|
||||||
Cbuf_DeleteStack (con_module->data->console->cbuf);
|
Cbuf_DeleteStack (con_module->data->console->cbuf);
|
||||||
con_module->data->console->cbuf = cl_cbuf;
|
con_module->data->console->cbuf = cl_cbuf;
|
||||||
}
|
}
|
||||||
|
CL_NetGraph_Init ();
|
||||||
|
|
||||||
S_Init (&cl.viewentity, &host_frametime);
|
S_Init (&cl.viewentity, &host_frametime);
|
||||||
CDAudio_Init ();
|
CDAudio_Init ();
|
||||||
|
|
|
@ -42,6 +42,8 @@
|
||||||
#include "QF/va.h"
|
#include "QF/va.h"
|
||||||
#include "QF/ui/view.h"
|
#include "QF/ui/view.h"
|
||||||
|
|
||||||
|
#include "client/hud.h"
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
#include "qw/include/cl_parse.h"
|
#include "qw/include/cl_parse.h"
|
||||||
|
@ -84,7 +86,8 @@ static cvar_t cl_netgraph_height_cvar = {
|
||||||
.flags = CVAR_ARCHIVE,
|
.flags = CVAR_ARCHIVE,
|
||||||
.value = { .type = &cexpr_int, .value = &cl_netgraph_height },
|
.value = { .type = &cexpr_int, .value = &cl_netgraph_height },
|
||||||
};
|
};
|
||||||
view_t cl_netgraph_view;
|
|
||||||
|
static view_t cl_netgraph_view;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cl_netgraph_f (void *data, const cvar_t *cvar)
|
cl_netgraph_f (void *data, const cvar_t *cvar)
|
||||||
|
@ -105,13 +108,11 @@ cl_netgraph_height_f (void *data, const cvar_t *cvar)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
CL_NetGraph (view_t view)
|
CL_NetGraph (view_pos_t abs, view_pos_t len)
|
||||||
{
|
{
|
||||||
int lost, a, l, x, y, i, o;
|
int lost, a, l, x, y, i, o;
|
||||||
int timings[NET_TIMINGS];
|
int timings[NET_TIMINGS];
|
||||||
view_pos_t abs = View_GetAbs (view);
|
|
||||||
view_pos_t len = View_GetLen (view);
|
|
||||||
|
|
||||||
if (cl_netgraph_box) {
|
if (cl_netgraph_box) {
|
||||||
r_funcs->Draw_TextBox (abs.x, abs.y, NET_TIMINGS / 8,
|
r_funcs->Draw_TextBox (abs.x, abs.y, NET_TIMINGS / 8,
|
||||||
|
@ -151,6 +152,18 @@ CL_NetGraph (view_t view)
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CL_NetGraph_Init (void)
|
||||||
|
{
|
||||||
|
cl_netgraph_view = View_New (hud_registry, cl_screen_view);
|
||||||
|
View_SetPos (cl_netgraph_view, 0, hud_sb_lines);
|
||||||
|
View_SetLen (cl_netgraph_view, NET_TIMINGS + 16, cl_netgraph_height + 25);
|
||||||
|
View_SetGravity (cl_netgraph_view, grav_southwest);
|
||||||
|
void *f = CL_NetGraph;
|
||||||
|
Ent_SetComponent (cl_netgraph_view.id, hud_func, cl_netgraph_view.reg, &f);
|
||||||
|
View_SetVisible (cl_netgraph_view, cl_netgraph);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CL_NetGraph_Init_Cvars (void)
|
CL_NetGraph_Init_Cvars (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -254,14 +254,6 @@ CL_Init_Screen (void)
|
||||||
View_SetGravity (pause_view, grav_center);
|
View_SetGravity (pause_view, grav_center);
|
||||||
Ent_SetComponent (pause_view.id, hud_cachepic, pause_view.reg, &name);
|
Ent_SetComponent (pause_view.id, hud_cachepic, pause_view.reg, &name);
|
||||||
View_SetVisible (pause_view, 0);
|
View_SetVisible (pause_view, 0);
|
||||||
|
|
||||||
cl_netgraph_view = View_New (hud_registry, cl_screen_view);
|
|
||||||
View_SetPos (cl_netgraph_view, 0, hud_sb_lines);
|
|
||||||
View_SetLen (cl_netgraph_view, NET_TIMINGS + 16, cl_netgraph_height + 25);
|
|
||||||
View_SetGravity (cl_netgraph_view, grav_southwest);
|
|
||||||
Ent_SetComponent (cl_netgraph_view.id, hud_func, cl_netgraph_view.reg,
|
|
||||||
CL_NetGraph);
|
|
||||||
View_SetVisible (cl_netgraph_view, cl_netgraph);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue