mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Mostly "merge" cl_screen.c.
Down to protocol/networking differences.
This commit is contained in:
parent
d37b85f73f
commit
aa2a8e8909
7 changed files with 44 additions and 23 deletions
|
@ -63,7 +63,6 @@ extern struct cvar_s *scr_viewsize;
|
|||
// only the refresh window will be updated unless these variables are flagged
|
||||
|
||||
extern struct qpic_s *scr_ram;
|
||||
extern struct qpic_s *scr_net;
|
||||
extern struct qpic_s *scr_turtle;
|
||||
|
||||
extern struct cvar_s *hud_fps, *hud_time;
|
||||
|
|
|
@ -101,7 +101,6 @@ int oldsbar;
|
|||
qboolean scr_initialized; // ready to draw
|
||||
|
||||
qpic_t *scr_ram;
|
||||
qpic_t *scr_net;
|
||||
qpic_t *scr_turtle;
|
||||
|
||||
int scr_fullupdate;
|
||||
|
@ -368,7 +367,6 @@ SCR_Init (void)
|
|||
Cmd_AddCommand ("sizedown", SCR_SizeDown_f, "Decreases the screen size");
|
||||
|
||||
scr_ram = vr_funcs->Draw_PicFromWad ("ram");
|
||||
scr_net = vr_funcs->Draw_PicFromWad ("net");
|
||||
scr_turtle = vr_funcs->Draw_PicFromWad ("turtle");
|
||||
|
||||
vid = *vr_data.vid; // cache
|
||||
|
|
|
@ -231,6 +231,7 @@ typedef struct {
|
|||
|
||||
int sv_cshifts;
|
||||
int chase;
|
||||
int watervis;
|
||||
int fpd;
|
||||
|
||||
lightstyle_t lightstyle[MAX_LIGHTSTYLES];
|
||||
|
|
|
@ -209,6 +209,7 @@ CL_ClearState (void)
|
|||
// wipe the entire cl structure
|
||||
memset (&cl, 0, sizeof (cl));
|
||||
cl.chase = 1;
|
||||
cl.watervis = 1;
|
||||
r_data->force_fullscreen = 0;
|
||||
r_data->lightstyle = cl.lightstyle;
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "client.h"
|
||||
#include "sbar.h"
|
||||
|
||||
static qpic_t *scr_net;
|
||||
|
||||
static void
|
||||
SCR_DrawNet (void)
|
||||
|
@ -58,9 +59,11 @@ SCR_DrawNet (void)
|
|||
if (cls.demoplayback)
|
||||
return;
|
||||
|
||||
//FIXME
|
||||
//r_funcs->Draw_Pic (r_data->scr_vrect->x + 64, r_data->scr_vrect->y,
|
||||
// scr_net);
|
||||
if (!scr_net)
|
||||
scr_net = r_funcs->Draw_PicFromWad ("net");
|
||||
|
||||
r_funcs->Draw_Pic (r_data->scr_vrect->x + 64, r_data->scr_vrect->y,
|
||||
scr_net);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -72,7 +75,7 @@ SCR_DrawLoading (void)
|
|||
return;
|
||||
pic = r_funcs->Draw_CachePic ("gfx/loading.lmp", 1);
|
||||
r_funcs->Draw_Pic ((r_data->vid->conwidth - pic->width) / 2,
|
||||
(r_data->vid->conheight - 48 - pic->height) / 2, pic);
|
||||
(r_data->vid->conheight - 48 - pic->height) / 2, pic);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -92,9 +95,9 @@ SCR_CShift (void)
|
|||
static SCR_Func scr_funcs_normal[] = {
|
||||
0, //Draw_Crosshair,
|
||||
0, //SCR_DrawRam,
|
||||
SCR_DrawNet,
|
||||
0, //SCR_DrawTurtle,
|
||||
0, //SCR_DrawPause,
|
||||
SCR_DrawNet,
|
||||
Sbar_DrawCenterPrint,
|
||||
Sbar_Draw,
|
||||
Con_DrawConsole,
|
||||
|
@ -130,11 +133,16 @@ CL_UpdateScreen (double realtime)
|
|||
index = 0;
|
||||
|
||||
//FIXME not every time
|
||||
r_data->min_wateralpha = 0;
|
||||
if (cls.state == ca_active) {
|
||||
if (cl.watervis)
|
||||
r_data->min_wateralpha = 0.0;
|
||||
else
|
||||
r_data->min_wateralpha = 1.0;
|
||||
}
|
||||
scr_funcs_normal[0] = r_funcs->Draw_Crosshair;
|
||||
scr_funcs_normal[1] = r_funcs->SCR_DrawRam;
|
||||
scr_funcs_normal[3] = r_funcs->SCR_DrawTurtle;
|
||||
scr_funcs_normal[4] = r_funcs->SCR_DrawPause;
|
||||
scr_funcs_normal[2] = r_funcs->SCR_DrawTurtle;
|
||||
scr_funcs_normal[3] = r_funcs->SCR_DrawPause;
|
||||
|
||||
V_PrepBlend ();
|
||||
r_funcs->SCR_UpdateScreen (realtime, V_RenderView, scr_funcs[index]);
|
||||
|
|
|
@ -199,6 +199,8 @@ extern client_static_t cls;
|
|||
the client_state_t structure is wiped completely at every server signon
|
||||
*/
|
||||
typedef struct {
|
||||
qboolean loading;
|
||||
|
||||
int movemessages; // Since connecting to this server throw out
|
||||
// the first couple, so the player doesn't
|
||||
// accidentally do something the first frame
|
||||
|
|
|
@ -40,20 +40,15 @@
|
|||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/draw.h"
|
||||
#include "QF/dstring.h"
|
||||
#include "QF/image.h"
|
||||
#include "QF/msg.h"
|
||||
#include "QF/pcx.h"
|
||||
#include "QF/screen.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
|
||||
#include "cl_parse.h"
|
||||
#include "client.h"
|
||||
#include "clview.h"
|
||||
#include "compat.h"
|
||||
#include "sbar.h"
|
||||
|
||||
static qpic_t *scr_net;
|
||||
|
||||
static void
|
||||
SCR_DrawNet (void)
|
||||
|
@ -64,7 +59,23 @@ SCR_DrawNet (void)
|
|||
if (cls.demoplayback)
|
||||
return;
|
||||
|
||||
//FIXME Draw_Pic (r_data->scr_vrect->x + 64, r_data->scr_vrect->y, scr_net);
|
||||
if (!scr_net)
|
||||
scr_net = r_funcs->Draw_PicFromWad ("net");
|
||||
|
||||
r_funcs->Draw_Pic (r_data->scr_vrect->x + 64, r_data->scr_vrect->y,
|
||||
scr_net);
|
||||
}
|
||||
|
||||
static void
|
||||
SCR_DrawLoading (void)
|
||||
{
|
||||
qpic_t *pic;
|
||||
|
||||
if (!cl.loading)
|
||||
return;
|
||||
pic = r_funcs->Draw_CachePic ("gfx/loading.lmp", 1);
|
||||
r_funcs->Draw_Pic ((r_data->vid->conwidth - pic->width) / 2,
|
||||
(r_data->vid->conheight - 48 - pic->height) / 2, pic);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -84,13 +95,14 @@ SCR_CShift (void)
|
|||
static SCR_Func scr_funcs_normal[] = {
|
||||
0, //Draw_Crosshair,
|
||||
0, //SCR_DrawRam,
|
||||
SCR_DrawNet,
|
||||
CL_NetGraph,
|
||||
0, //SCR_DrawTurtle,
|
||||
0, //SCR_DrawPause,
|
||||
SCR_DrawNet,
|
||||
CL_NetGraph,
|
||||
Sbar_DrawCenterPrint,
|
||||
Sbar_Draw,
|
||||
Con_DrawConsole,
|
||||
SCR_DrawLoading,
|
||||
SCR_CShift,
|
||||
0
|
||||
};
|
||||
|
@ -121,7 +133,7 @@ CL_UpdateScreen (double realtime)
|
|||
if (index >= sizeof (scr_funcs) / sizeof (scr_funcs[0]))
|
||||
index = 0;
|
||||
|
||||
// don't allow cheats in multiplayer
|
||||
//FIXME not every time
|
||||
if (cls.state == ca_active) {
|
||||
if (cl.watervis)
|
||||
r_data->min_wateralpha = 0.0;
|
||||
|
@ -130,8 +142,8 @@ CL_UpdateScreen (double realtime)
|
|||
}
|
||||
scr_funcs_normal[0] = r_funcs->Draw_Crosshair;
|
||||
scr_funcs_normal[1] = r_funcs->SCR_DrawRam;
|
||||
scr_funcs_normal[4] = r_funcs->SCR_DrawTurtle;
|
||||
scr_funcs_normal[5] = r_funcs->SCR_DrawPause;
|
||||
scr_funcs_normal[2] = r_funcs->SCR_DrawTurtle;
|
||||
scr_funcs_normal[3] = r_funcs->SCR_DrawPause;
|
||||
|
||||
V_PrepBlend ();
|
||||
r_funcs->SCR_UpdateScreen (realtime, V_RenderView, scr_funcs[index]);
|
||||
|
|
Loading…
Reference in a new issue