sw_rmain.c is now client and chase clean.

This commit is contained in:
Bill Currie 2001-05-20 20:38:51 +00:00
parent 7d008a5949
commit 337430a113
15 changed files with 59 additions and 77 deletions

View file

@ -170,6 +170,9 @@ void R_DrawWaterSurfaces (void);
*/
extern int reinit_surfcache; // if 1, surface cache is currently empty
extern qboolean r_cache_thrash; // set if thrashing the surface cache
extern qboolean r_inhibit_viewmodel;
extern qboolean r_force_fullscreen;
extern entity_t *r_view_model;
void *D_SurfaceCacheAddress (void);
int D_SurfaceCacheForRes (int width, int height);

View file

@ -240,6 +240,8 @@ extern drawsurf_t r_drawsurf;
void R_DrawSurface (void);
void R_GenTile (msurface_t *psurf, void *pdest);
// !!! if this is changed, it must be changed in d_iface.h too !!!
#define CACHE_SIZE 32 // used to align key data structures
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
#define TURB_TEX_SIZE 64 // base turbulent texture size

View file

@ -46,7 +46,7 @@
// !!! if this is changed, it must be changed in r_shared.h too !!!
#define MAXHEIGHT 1024
// !!! if this is changed, it must be changed in quakedef.h too !!!
// !!! if this is changed, it must be changed in d_iface.h too !!!
#define CACHE_SIZE 32 // used to align key data structures
// particle_t structure

View file

@ -56,9 +56,6 @@
#define UNALIGNED_OK 0
#endif
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
#define CACHE_SIZE 32 // used to align key data structures
#define MINIMUM_MEMORY 0x550000
#define MINIMUM_MEMORY_LEVELPAK (MINIMUM_MEMORY + 0x100000)

View file

@ -705,6 +705,12 @@ _Host_Frame (float time)
if (host_speeds->int_val)
time1 = Sys_DoubleTime ();
r_inhibit_viewmodel = (chase_active->int_val
|| (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|| cl.stats[STAT_HEALTH] <= 0);
r_force_fullscreen = cl.intermission;
r_view_model = &cl.viewent;
SCR_UpdateScreen (cl.time);
if (host_speeds->int_val)

View file

@ -1,9 +1,13 @@
#include "QF/qtypes.h"
#include "QF/render.h"
#include "r_local.h"
double r_realtime;
qboolean r_inhibit_viewmodel;
qboolean r_force_fullscreen;
double r_realtime;
dlight_t r_dlights[MAX_DLIGHTS];
entity_t *r_view_model;
dlight_t *
R_AllocDlight (int key)

View file

@ -347,7 +347,7 @@ SCR_CalcRefdef (void)
vrect.width = vid.width;
vrect.height = vid.height;
R_SetVrect (&vrect, &scr_vrect, sb_lines);
R_SetVrect (&vrect, &scr_vrect, cl_sbar->int_val ? sb_lines : 0);
// guard against going from one mode to another that's less than half the
// vertical resolution
@ -355,7 +355,7 @@ SCR_CalcRefdef (void)
scr_con_current = vid.height;
// notify the refresh of the change
R_ViewChanged (&vrect, sb_lines, vid.aspect);
R_ViewChanged (&vrect, cl_sbar->int_val ? sb_lines : 0, vid.aspect);
}

View file

@ -42,12 +42,12 @@
#include "QF/console.h"
#include "QF/locs.h"
#include "QF/mathlib.h"
#include "QF/render.h"
#include "QF/screen.h"
#include "QF/sound.h"
#include "QF/sys.h"
#include "chase.h"
#include "client.h"
#include "d_iface.h"
#include "r_cvar.h"
#include "r_dynamic.h"
#include "r_local.h"
@ -251,17 +251,15 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
size = scr_viewsize->int_val;
}
if (cl.intermission) {
if (r_force_fullscreen) {
full = true;
size = 100.0;
lineadj = 0;
}
size /= 100.0;
if (full)
lineadj = 0;
if (!cl_sbar->int_val && full)
h = pvrectin->height;
else
h = pvrectin->height - lineadj;
h = pvrectin->height - lineadj;
if (full) {
pvrect->width = pvrectin->width;
@ -276,13 +274,8 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
pvrect->width &= ~7;
pvrect->height = pvrectin->height * size;
if (cl_sbar->int_val || !full) {
if (pvrect->height > pvrectin->height - lineadj)
pvrect->height = pvrectin->height - lineadj;
} else {
if (pvrect->height > pvrectin->height)
pvrect->height = pvrectin->height;
}
if (pvrect->height > pvrectin->height - lineadj)
pvrect->height = pvrectin->height - lineadj;
pvrect->height &= ~1;
@ -497,13 +490,6 @@ R_DrawEntitiesOnList (void)
for (i = 0; i < r_numvisedicts; i++) {
currententity = r_visedicts[i];
if (currententity == &cl_entities[cl.viewentity]) {
if (!chase_active->int_val)
continue; // don't draw the player
else
currententity->angles[PITCH] *= 0.3;
}
switch (currententity->model->type) {
case mod_sprite:
VectorCopy (currententity->origin, r_entorigin);
@ -565,20 +551,12 @@ R_DrawViewModel (void)
float add;
dlight_t *dl;
if (!r_drawviewmodel->int_val
if (r_inhibit_viewmodel
|| !r_drawviewmodel->int_val
|| !r_drawentities->int_val)
return;
if (chase_active->int_val)
return;
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
return;
if (cl.stats[STAT_HEALTH] <= 0)
return;
currententity = &cl.viewent;
currententity = r_view_model;
if (!currententity->model)
return;

View file

@ -484,7 +484,7 @@ R_SetupFrame (void)
vrect.width = vid.width;
vrect.height = vid.height;
R_ViewChanged (&vrect, sb_lines, vid.aspect);
R_ViewChanged (&vrect, cl_sbar->int_val ? sb_lines : 0, vid.aspect);
} else {
w = vid.width;
h = vid.height;
@ -505,7 +505,7 @@ R_SetupFrame (void)
vrect.height = (int) h;
R_ViewChanged (&vrect,
(int) ((float) sb_lines *
(int) ((float) (cl_sbar->int_val ? sb_lines : 0) *
(h / (float) vid.height)),
vid.aspect * (h / w) * ((float) vid.width /
(float) vid.height));
@ -516,7 +516,7 @@ R_SetupFrame (void)
vrect.width = vid.width;
vrect.height = vid.height;
R_ViewChanged (&vrect, sb_lines, vid.aspect);
R_ViewChanged (&vrect, cl_sbar->int_val ? sb_lines : 0, vid.aspect);
}
r_viewchanged = false;

View file

@ -35,9 +35,6 @@
# define UNALIGNED_OK 0
#endif
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
#define CACHE_SIZE 32 // used to align key data structures
#define UNUSED(x) (x = x) // for pesky compiler / lint warnings
// Error out if we get less than 4MB

View file

@ -1480,6 +1480,12 @@ Host_Frame (float time)
if (host_speeds->int_val)
time1 = Sys_DoubleTime ();
r_inhibit_viewmodel = (!Cam_DrawViewModel ()
|| (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|| cl.stats[STAT_HEALTH] <= 0);
r_force_fullscreen = cl.intermission;
r_view_model = &cl.viewent;
SCR_UpdateScreen (realtime);
if (host_speeds->int_val)

View file

@ -1,9 +1,13 @@
#include "QF/qtypes.h"
#include "QF/render.h"
#include "r_local.h"
double r_realtime;
qboolean r_inhibit_viewmodel;
qboolean r_force_fullscreen;
double r_realtime;
dlight_t r_dlights[MAX_DLIGHTS];
entity_t *r_view_model;
dlight_t *
R_AllocDlight (int key)

View file

@ -347,7 +347,7 @@ SCR_CalcRefdef (void)
vrect.width = vid.width;
vrect.height = vid.height;
R_SetVrect (&vrect, &scr_vrect, sb_lines);
R_SetVrect (&vrect, &scr_vrect, cl_sbar->int_val ? sb_lines : 0);
// guard against going from one mode to another that's less than half the
// vertical resolution
@ -355,7 +355,7 @@ SCR_CalcRefdef (void)
scr_con_current = vid.height;
// notify the refresh of the change
R_ViewChanged (&vrect, sb_lines, vid.aspect);
R_ViewChanged (&vrect, cl_sbar->int_val ? sb_lines : 0, vid.aspect);
}

View file

@ -47,9 +47,7 @@
#include "QF/sound.h"
#include "QF/sys.h"
#include "bothdefs.h"
#include "cl_cam.h"
#include "cl_main.h"
#include "d_iface.h"
#include "r_cvar.h"
#include "r_dynamic.h"
#include "r_local.h"
@ -253,17 +251,15 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
size = scr_viewsize->int_val;
}
if (cl.intermission) {
if (r_force_fullscreen) {
full = true;
size = 100.0;
lineadj = 0;
}
size /= 100.0;
if (full)
lineadj = 0;
if (!cl_sbar->int_val && full)
h = pvrectin->height;
else
h = pvrectin->height - lineadj;
h = pvrectin->height - lineadj;
if (full) {
pvrect->width = pvrectin->width;
@ -278,13 +274,8 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
pvrect->width &= ~7;
pvrect->height = pvrectin->height * size;
if (cl_sbar->int_val || !full) {
if (pvrect->height > pvrectin->height - lineadj)
pvrect->height = pvrectin->height - lineadj;
} else {
if (pvrect->height > pvrectin->height)
pvrect->height = pvrectin->height;
}
if (pvrect->height > pvrectin->height - lineadj)
pvrect->height = pvrectin->height - lineadj;
pvrect->height &= ~1;
@ -560,18 +551,12 @@ R_DrawViewModel (void)
float add;
dlight_t *dl;
if (!r_drawviewmodel->int_val
|| !Cam_DrawViewModel ()
if (r_inhibit_viewmodel
|| !r_drawviewmodel->int_val
|| !r_drawentities->int_val)
return;
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
return;
if (cl.stats[STAT_HEALTH] <= 0)
return;
currententity = &cl.viewent;
currententity = r_view_model;
if (!currententity->model)
return;

View file

@ -482,7 +482,7 @@ R_SetupFrame (void)
vrect.width = vid.width;
vrect.height = vid.height;
R_ViewChanged (&vrect, sb_lines, vid.aspect);
R_ViewChanged (&vrect, cl_sbar->int_val ? sb_lines : 0, vid.aspect);
} else {
w = vid.width;
h = vid.height;
@ -503,7 +503,7 @@ R_SetupFrame (void)
vrect.height = (int) h;
R_ViewChanged (&vrect,
(int) ((float) sb_lines *
(int) ((float) (cl_sbar->int_val ? sb_lines : 0) *
(h / (float) vid.height)),
vid.aspect * (h / w) * ((float) vid.width /
(float) vid.height));
@ -514,7 +514,7 @@ R_SetupFrame (void)
vrect.width = vid.width;
vrect.height = vid.height;
R_ViewChanged (&vrect, sb_lines, vid.aspect);
R_ViewChanged (&vrect, cl_sbar->int_val ? sb_lines : 0, vid.aspect);
}
r_viewchanged = false;