mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
massive merging madness mounds
This commit is contained in:
parent
eb65d61322
commit
7b4e395dcb
17 changed files with 486 additions and 602 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_aclip.c
|
||||
|
||||
@description@
|
||||
clip routines for drawing Alias models directly to the screen
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -53,11 +53,9 @@ void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_Alias_clip_z
|
||||
R_Alias_clip_z
|
||||
|
||||
pfv0 is the unclipped vertex, pfv1 is the z-clipped vertex
|
||||
================
|
||||
pfv0 is the unclipped vertex, pfv1 is the z-clipped vertex
|
||||
*/
|
||||
void
|
||||
R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
||||
|
@ -105,7 +103,7 @@ R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
|||
}
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
void
|
||||
R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
||||
|
@ -231,16 +229,14 @@ R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasClipTriangle
|
||||
================
|
||||
R_AliasClipTriangle
|
||||
*/
|
||||
void
|
||||
R_AliasClipTriangle (mtriangle_t *ptri)
|
||||
{
|
||||
int i, k, pingpong;
|
||||
mtriangle_t mtri;
|
||||
unsigned clipflags;
|
||||
unsigned int clipflags;
|
||||
|
||||
// copy vertexes and fix seam texture coordinates
|
||||
if (ptri->facesfront) {
|
||||
|
|
|
@ -96,9 +96,7 @@ void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasCheckBBox
|
||||
================
|
||||
R_AliasCheckBBox
|
||||
*/
|
||||
qboolean
|
||||
R_AliasCheckBBox (void)
|
||||
|
@ -110,7 +108,7 @@ R_AliasCheckBBox (void)
|
|||
auxvert_t *pa0, *pa1, viewaux[16];
|
||||
maliasframedesc_t *pframedesc;
|
||||
qboolean zclipped, zfullyclipped;
|
||||
unsigned anyclip, allclip;
|
||||
unsigned int anyclip, allclip;
|
||||
int minz;
|
||||
|
||||
// expand, rotate, and translate points into worldspace
|
||||
|
@ -248,9 +246,7 @@ R_AliasCheckBBox (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasTransformVector
|
||||
================
|
||||
R_AliasTransformVector
|
||||
*/
|
||||
void
|
||||
R_AliasTransformVector (vec3_t in, vec3_t out)
|
||||
|
@ -262,11 +258,9 @@ R_AliasTransformVector (vec3_t in, vec3_t out)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasPreparePoints
|
||||
R_AliasPreparePoints
|
||||
|
||||
General clipped case
|
||||
================
|
||||
General clipped case
|
||||
*/
|
||||
void
|
||||
R_AliasPreparePoints (void)
|
||||
|
@ -329,9 +323,7 @@ R_AliasPreparePoints (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasSetUpTransform
|
||||
================
|
||||
R_AliasSetUpTransform
|
||||
*/
|
||||
void
|
||||
R_AliasSetUpTransform (int trivial_accept)
|
||||
|
@ -405,9 +397,7 @@ R_AliasSetUpTransform (int trivial_accept)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasTransformFinalVert
|
||||
================
|
||||
R_AliasTransformFinalVert
|
||||
*/
|
||||
void
|
||||
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
||||
|
@ -447,12 +437,10 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
|||
}
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasTransformAndProjectFinalVerts
|
||||
================
|
||||
R_AliasTransformAndProjectFinalVerts
|
||||
*/
|
||||
void
|
||||
R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
|
||||
|
@ -506,9 +494,7 @@ R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasProjectFinalVert
|
||||
================
|
||||
R_AliasProjectFinalVert
|
||||
*/
|
||||
void
|
||||
R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
|
||||
|
@ -526,9 +512,7 @@ R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasPrepareUnclippedPoints
|
||||
================
|
||||
R_AliasPrepareUnclippedPoints
|
||||
*/
|
||||
void
|
||||
R_AliasPrepareUnclippedPoints (void)
|
||||
|
@ -555,9 +539,7 @@ R_AliasPrepareUnclippedPoints (void)
|
|||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_AliasSetupSkin
|
||||
===============
|
||||
R_AliasSetupSkin
|
||||
*/
|
||||
void
|
||||
R_AliasSetupSkin (void)
|
||||
|
@ -609,9 +591,7 @@ R_AliasSetupSkin (void)
|
|||
}
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasSetupLighting
|
||||
================
|
||||
R_AliasSetupLighting
|
||||
*/
|
||||
void
|
||||
R_AliasSetupLighting (alight_t *plighting)
|
||||
|
@ -643,11 +623,9 @@ R_AliasSetupLighting (alight_t *plighting)
|
|||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_AliasSetupFrame
|
||||
R_AliasSetupFrame
|
||||
|
||||
set r_apverts
|
||||
=================
|
||||
set r_apverts
|
||||
*/
|
||||
void
|
||||
R_AliasSetupFrame (void)
|
||||
|
@ -694,9 +672,7 @@ R_AliasSetupFrame (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_AliasDrawModel
|
||||
================
|
||||
R_AliasDrawModel
|
||||
*/
|
||||
void
|
||||
R_AliasDrawModel (alight_t *plighting)
|
||||
|
@ -729,7 +705,7 @@ R_AliasDrawModel (alight_t *plighting)
|
|||
if (r_affinetridesc.drawtype) {
|
||||
D_PolysetUpdateTables (); // FIXME: precalc...
|
||||
} else {
|
||||
#ifdef USE_INTEL_ASM
|
||||
#ifdef USE_INTEL_ASM
|
||||
D_Aff8Patch (currententity->colormap);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_bsp.c
|
||||
|
||||
@description@
|
||||
(description)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
|
@ -74,9 +76,7 @@ static qboolean makeclippededge;
|
|||
//===========================================================================
|
||||
|
||||
/*
|
||||
================
|
||||
R_EntityRotate
|
||||
================
|
||||
R_EntityRotate
|
||||
*/
|
||||
void
|
||||
R_EntityRotate (vec3_t vec)
|
||||
|
@ -91,9 +91,7 @@ R_EntityRotate (vec3_t vec)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_RotateBmodel
|
||||
================
|
||||
R_RotateBmodel
|
||||
*/
|
||||
void
|
||||
R_RotateBmodel (void)
|
||||
|
@ -171,9 +169,7 @@ R_RotateBmodel (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_RecursiveClipBPoly
|
||||
================
|
||||
R_RecursiveClipBPoly
|
||||
*/
|
||||
void
|
||||
R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
||||
|
@ -323,9 +319,7 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSolidClippedSubmodelPolygons
|
||||
================
|
||||
R_DrawSolidClippedSubmodelPolygons
|
||||
*/
|
||||
void
|
||||
R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
||||
|
@ -398,9 +392,7 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSubmodelPolygons
|
||||
================
|
||||
R_DrawSubmodelPolygons
|
||||
*/
|
||||
void
|
||||
R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
||||
|
@ -435,9 +427,7 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_RecursiveWorldNode
|
||||
================
|
||||
R_RecursiveWorldNode
|
||||
*/
|
||||
void
|
||||
R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
||||
|
@ -510,8 +500,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
}
|
||||
|
||||
pleaf->key = r_currentkey;
|
||||
r_currentkey++; // all bmodels in a leaf share the
|
||||
// same key
|
||||
r_currentkey++; // all bmodels in a leaf share the same key
|
||||
} else {
|
||||
// node is just a decision point, so go down the apropriate sides
|
||||
|
||||
|
@ -520,17 +509,17 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
|
||||
switch (plane->type) {
|
||||
case PLANE_X:
|
||||
dot = modelorg[0] - plane->dist;
|
||||
break;
|
||||
dot = modelorg[0] - plane->dist;
|
||||
break;
|
||||
case PLANE_Y:
|
||||
dot = modelorg[1] - plane->dist;
|
||||
break;
|
||||
dot = modelorg[1] - plane->dist;
|
||||
break;
|
||||
case PLANE_Z:
|
||||
dot = modelorg[2] - plane->dist;
|
||||
break;
|
||||
dot = modelorg[2] - plane->dist;
|
||||
break;
|
||||
default:
|
||||
dot = DotProduct (modelorg, plane->normal) - plane->dist;
|
||||
break;
|
||||
dot = DotProduct (modelorg, plane->normal) - plane->dist;
|
||||
break;
|
||||
}
|
||||
|
||||
if (dot >= 0)
|
||||
|
@ -603,9 +592,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_RenderWorld
|
||||
================
|
||||
R_RenderWorld
|
||||
*/
|
||||
void
|
||||
R_RenderWorld (void)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_edge.c
|
||||
|
||||
@description@
|
||||
(description)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -92,9 +92,7 @@ R_TrailingEdge (surf_t *surf, edge_t *edge);
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_DrawCulledPolys
|
||||
==============
|
||||
R_DrawCulledPolys
|
||||
*/
|
||||
void
|
||||
R_DrawCulledPolys (void)
|
||||
|
@ -129,9 +127,7 @@ R_DrawCulledPolys (void)
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_BeginEdgeFrame
|
||||
==============
|
||||
R_BeginEdgeFrame
|
||||
*/
|
||||
void
|
||||
R_BeginEdgeFrame (void)
|
||||
|
@ -164,17 +160,16 @@ R_BeginEdgeFrame (void)
|
|||
}
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
==============
|
||||
R_InsertNewEdges
|
||||
R_InsertNewEdges
|
||||
|
||||
Adds the edges in the linked list edgestoadd, adding them to the edges in the
|
||||
linked list edgelist. edgestoadd is assumed to be sorted on u, and non-empty (this is actually newedges[v]). edgelist is assumed to be sorted on u, with a
|
||||
sentinel at the end (actually, this is the active edge table starting at
|
||||
edge_head.next).
|
||||
==============
|
||||
Adds the edges in the linked list edgestoadd, adding them to the edges
|
||||
in the linked list edgelist. edgestoadd is assumed to be sorted on u,
|
||||
and non-empty (this is actually newedges[v]). edgelist is assumed to
|
||||
be sorted on u, with a sentinel at the end (actually, this is the
|
||||
active edge table starting at edge_head.next).
|
||||
*/
|
||||
void
|
||||
R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
|
||||
|
@ -209,9 +204,7 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_RemoveEdges
|
||||
==============
|
||||
R_RemoveEdges
|
||||
*/
|
||||
void
|
||||
R_RemoveEdges (edge_t *pedge)
|
||||
|
@ -225,9 +218,7 @@ R_RemoveEdges (edge_t *pedge)
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_StepActiveU
|
||||
==============
|
||||
R_StepActiveU
|
||||
*/
|
||||
void
|
||||
R_StepActiveU (edge_t *pedge)
|
||||
|
@ -288,16 +279,14 @@ R_StepActiveU (edge_t *pedge)
|
|||
}
|
||||
}
|
||||
|
||||
#endif // USE_INTEL_ASM
|
||||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_CleanupSpan
|
||||
==============
|
||||
R_CleanupSpan
|
||||
*/
|
||||
void
|
||||
R_CleanupSpan ()
|
||||
R_CleanupSpan (void)
|
||||
{
|
||||
surf_t *surf;
|
||||
int iu;
|
||||
|
@ -324,9 +313,7 @@ R_CleanupSpan ()
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_LeadingEdgeBackwards
|
||||
==============
|
||||
R_LeadingEdgeBackwards
|
||||
*/
|
||||
void
|
||||
R_LeadingEdgeBackwards (edge_t *edge)
|
||||
|
@ -401,9 +388,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_TrailingEdge
|
||||
==============
|
||||
R_TrailingEdge
|
||||
*/
|
||||
void
|
||||
R_TrailingEdge (surf_t *surf, edge_t *edge)
|
||||
|
@ -439,12 +424,10 @@ R_TrailingEdge (surf_t *surf, edge_t *edge)
|
|||
}
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
==============
|
||||
R_LeadingEdge
|
||||
==============
|
||||
R_LeadingEdge
|
||||
*/
|
||||
void
|
||||
R_LeadingEdge (edge_t *edge)
|
||||
|
@ -559,9 +542,7 @@ R_LeadingEdge (edge_t *edge)
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_GenerateSpans
|
||||
==============
|
||||
R_GenerateSpans
|
||||
*/
|
||||
void
|
||||
R_GenerateSpans (void)
|
||||
|
@ -594,13 +575,11 @@ R_GenerateSpans (void)
|
|||
R_CleanupSpan ();
|
||||
}
|
||||
|
||||
#endif // USE_INTEL_ASM
|
||||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_GenerateSpansBackward
|
||||
==============
|
||||
R_GenerateSpansBackward
|
||||
*/
|
||||
void
|
||||
R_GenerateSpansBackward (void)
|
||||
|
@ -627,16 +606,14 @@ R_GenerateSpansBackward (void)
|
|||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_ScanEdges
|
||||
R_ScanEdges
|
||||
|
||||
Input:
|
||||
newedges[] array
|
||||
this has links to edges, which have links to surfaces
|
||||
Input:
|
||||
newedges[] array
|
||||
this has links to edges, which have links to surfaces
|
||||
|
||||
Output:
|
||||
Each surface has a linked list of its visible spans
|
||||
==============
|
||||
Output:
|
||||
Each surface has a linked list of its visible spans
|
||||
*/
|
||||
void
|
||||
R_ScanEdges (void)
|
||||
|
@ -703,14 +680,13 @@ R_ScanEdges (void)
|
|||
if (span_p >= max_span_p) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
// going slow
|
||||
VID_LockBuffer ();
|
||||
|
||||
if (r_drawculledpolys) {
|
||||
if (r_drawculledpolys)
|
||||
R_DrawCulledPolys ();
|
||||
} else {
|
||||
else
|
||||
D_DrawSurfaces ();
|
||||
}
|
||||
|
||||
// clear the surface span pointers
|
||||
for (s = &surfaces[1]; s < surface_p; s++)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_light.c
|
||||
|
||||
@description@
|
||||
(description)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -37,9 +37,7 @@ int r_dlightframecount;
|
|||
|
||||
|
||||
/*
|
||||
==================
|
||||
R_AnimateLight
|
||||
==================
|
||||
R_AnimateLight
|
||||
*/
|
||||
void
|
||||
R_AnimateLight (void)
|
||||
|
@ -64,17 +62,11 @@ R_AnimateLight (void)
|
|||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS
|
||||
|
||||
=============================================================================
|
||||
DYNAMIC LIGHTS
|
||||
*/
|
||||
|
||||
/*
|
||||
=============
|
||||
R_MarkLights
|
||||
=============
|
||||
R_MarkLights
|
||||
*/
|
||||
void
|
||||
R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
||||
|
@ -114,9 +106,7 @@ R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
|||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_PushDlights
|
||||
=============
|
||||
R_PushDlights
|
||||
*/
|
||||
void
|
||||
R_PushDlights (vec3_t entorigin)
|
||||
|
@ -139,11 +129,7 @@ R_PushDlights (vec3_t entorigin)
|
|||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
LIGHT SAMPLING
|
||||
|
||||
=============================================================================
|
||||
LIGHT SAMPLING
|
||||
*/
|
||||
|
||||
int
|
||||
|
@ -159,7 +145,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
int i;
|
||||
mtexinfo_t *tex;
|
||||
byte *lightmap;
|
||||
unsigned scale;
|
||||
unsigned int scale;
|
||||
int maps;
|
||||
|
||||
if (node->contents < 0)
|
||||
|
@ -187,7 +173,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return r; // hit something
|
||||
|
||||
if ((back < 0) == side)
|
||||
return -1; // didn't hit anuthing
|
||||
return -1; // didn't hit anything
|
||||
|
||||
// check for impact on this node
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_main.c
|
||||
|
||||
@description@
|
||||
(description)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -29,19 +29,30 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "QF/cmd.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/locs.h"
|
||||
#include "QF/mathlib.h"
|
||||
#include "QF/screen.h"
|
||||
#include "QF/sound.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "chase.h"
|
||||
#include "client.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "view.h"
|
||||
|
||||
//define PASSAGES
|
||||
|
||||
void *colormap;
|
||||
vec3_t viewlightvec;
|
||||
|
@ -139,13 +150,13 @@ float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
|
|||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
void CreatePassages (void);
|
||||
void SetVisibilityByPassages (void);
|
||||
extern cvar_t *scr_fov;
|
||||
|
||||
void R_NetGraph (void);
|
||||
void R_ZGraph (void);
|
||||
|
||||
/*
|
||||
==================
|
||||
R_Textures_Init
|
||||
==================
|
||||
R_Textures_Init
|
||||
*/
|
||||
void
|
||||
R_Textures_Init (void)
|
||||
|
@ -177,24 +188,24 @@ R_Textures_Init (void)
|
|||
}
|
||||
}
|
||||
|
||||
void R_LoadSky_f (void);
|
||||
|
||||
/*
|
||||
===============
|
||||
R_Init
|
||||
===============
|
||||
R_Init
|
||||
*/
|
||||
void
|
||||
R_Init (void)
|
||||
{
|
||||
int dummy;
|
||||
|
||||
// get stack position so we can guess if we are going to overflow
|
||||
// get stack position so we can guess if we are going to overflow
|
||||
r_stack_start = (byte *) & dummy;
|
||||
|
||||
R_InitTurb ();
|
||||
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "No Description");
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "No Description");
|
||||
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current refresh rate for the current location");
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "Load a pointfile to determine map leaks");
|
||||
Cmd_AddCommand ("loadsky", R_LoadSky_f, "Load a skybox");
|
||||
|
||||
Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES);
|
||||
Cvar_SetValue (r_maxsurfs, (float) NUMSTACKSURFACES);
|
||||
|
@ -212,7 +223,7 @@ R_Init (void)
|
|||
R_InitParticles ();
|
||||
|
||||
// TODO: collect 386-specific code in one place
|
||||
#ifdef USE_INTEL_ASM
|
||||
#ifdef USE_INTEL_ASM
|
||||
Sys_MakeCodeWriteable ((long) R_EdgeCodeStart,
|
||||
(long) R_EdgeCodeEnd - (long) R_EdgeCodeStart);
|
||||
#endif // USE_INTEL_ASM
|
||||
|
@ -221,9 +232,7 @@ R_Init (void)
|
|||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_NewMap
|
||||
===============
|
||||
R_NewMap
|
||||
*/
|
||||
void
|
||||
R_NewMap (void)
|
||||
|
@ -274,16 +283,11 @@ R_NewMap (void)
|
|||
|
||||
r_dowarpold = false;
|
||||
r_viewchanged = false;
|
||||
#ifdef PASSAGES
|
||||
CreatePassages ();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_SetVrect
|
||||
===============
|
||||
R_SetVrect
|
||||
*/
|
||||
void
|
||||
R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
||||
|
@ -293,7 +297,7 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
qboolean full = false;
|
||||
|
||||
if (scr_viewsize->int_val >= 100) {
|
||||
size = 100;
|
||||
size = 100.0;
|
||||
full = true;
|
||||
} else {
|
||||
size = scr_viewsize->int_val;
|
||||
|
@ -301,10 +305,10 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
|
||||
if (cl.intermission) {
|
||||
full = true;
|
||||
size = 100;
|
||||
size = 100.0;
|
||||
lineadj = 0;
|
||||
}
|
||||
size /= 100;
|
||||
size /= 100.0;
|
||||
|
||||
if (!cl_sbar->int_val && full)
|
||||
h = pvrectin->height;
|
||||
|
@ -335,23 +339,18 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
pvrect->height &= ~1;
|
||||
|
||||
pvrect->x = (pvrectin->width - pvrect->width) / 2;
|
||||
pvrect->y = (h - pvrect->height) / 2;
|
||||
|
||||
if (full)
|
||||
pvrect->y = 0;
|
||||
else
|
||||
pvrect->y = (h - pvrect->height) / 2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_ViewChanged
|
||||
R_ViewChanged
|
||||
|
||||
Called every time the vid structure or r_refdef changes.
|
||||
Guaranteed to be called before the first refresh
|
||||
===============
|
||||
Called every time the vid structure or r_refdef changes.
|
||||
Guaranteed to be called before the first refresh
|
||||
*/
|
||||
void
|
||||
R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect)
|
||||
|
@ -460,7 +459,7 @@ R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect)
|
|||
r_fov_greater_than_90 = true;
|
||||
|
||||
// TODO: collect 386-specific code in one place
|
||||
#ifdef USE_INTEL_ASM
|
||||
#ifdef USE_INTEL_ASM
|
||||
if (r_pixbytes == 1) {
|
||||
Sys_MakeCodeWriteable ((long) R_Surf8Start,
|
||||
(long) R_Surf8End - (long) R_Surf8Start);
|
||||
|
@ -479,9 +478,7 @@ R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect)
|
|||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_MarkLeaves
|
||||
===============
|
||||
R_MarkLeaves
|
||||
*/
|
||||
void
|
||||
R_MarkLeaves (void)
|
||||
|
@ -511,11 +508,35 @@ R_MarkLeaves (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_ShowNearestLoc
|
||||
=============
|
||||
*/
|
||||
static void
|
||||
R_ShowNearestLoc (void)
|
||||
{
|
||||
location_t *nearloc;
|
||||
vec3_t trueloc;
|
||||
dlight_t *dl;
|
||||
|
||||
if (r_drawentities->int_val)
|
||||
return;
|
||||
nearloc = locs_find (r_origin);
|
||||
if (nearloc) {
|
||||
dl = CL_AllocDlight (4096);
|
||||
VectorCopy (nearloc->loc, dl->origin);
|
||||
dl->radius = 200;
|
||||
dl->die = cl.time + 0.1;
|
||||
dl->color[1]=1;
|
||||
|
||||
VectorCopy(nearloc->loc,trueloc);
|
||||
R_RunParticleEffect(trueloc,252,10);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
R_DrawEntitiesOnList
|
||||
=============
|
||||
R_DrawEntitiesOnList
|
||||
*/
|
||||
void
|
||||
R_DrawEntitiesOnList (void)
|
||||
|
@ -529,8 +550,10 @@ R_DrawEntitiesOnList (void)
|
|||
vec3_t dist;
|
||||
float add;
|
||||
|
||||
if (!r_drawentities->int_val)
|
||||
if (!r_drawentities->int_val) {
|
||||
R_ShowNearestLoc();
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < cl_numvisedicts; i++) {
|
||||
currententity = cl_visedicts[i];
|
||||
|
@ -544,57 +567,56 @@ R_DrawEntitiesOnList (void)
|
|||
|
||||
switch (currententity->model->type) {
|
||||
case mod_sprite:
|
||||
VectorCopy (currententity->origin, r_entorigin);
|
||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
R_DrawSprite ();
|
||||
break;
|
||||
VectorCopy (currententity->origin, r_entorigin);
|
||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
R_DrawSprite ();
|
||||
break;
|
||||
|
||||
case mod_alias:
|
||||
VectorCopy (currententity->origin, r_entorigin);
|
||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
VectorCopy (currententity->origin, r_entorigin);
|
||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
|
||||
// see if the bounding box lets us trivially reject, also sets
|
||||
// trivial accept status
|
||||
if (R_AliasCheckBBox ()) {
|
||||
j = R_LightPoint (currententity->origin);
|
||||
// see if the bounding box lets us trivially reject, also
|
||||
// sets
|
||||
// trivial accept status
|
||||
if (R_AliasCheckBBox ()) {
|
||||
j = R_LightPoint (currententity->origin);
|
||||
|
||||
lighting.ambientlight = j;
|
||||
lighting.shadelight = j;
|
||||
lighting.ambientlight = j;
|
||||
lighting.shadelight = j;
|
||||
|
||||
lighting.plightvec = lightvec;
|
||||
lighting.plightvec = lightvec;
|
||||
|
||||
for (lnum = 0; lnum < MAX_DLIGHTS; lnum++) {
|
||||
if (cl_dlights[lnum].die >= cl.time) {
|
||||
VectorSubtract (currententity->origin,
|
||||
cl_dlights[lnum].origin, dist);
|
||||
add = cl_dlights[lnum].radius - Length (dist);
|
||||
for (lnum = 0; lnum < MAX_DLIGHTS; lnum++) {
|
||||
if (cl_dlights[lnum].die >= cl.time) {
|
||||
VectorSubtract (currententity->origin,
|
||||
cl_dlights[lnum].origin, dist);
|
||||
add = cl_dlights[lnum].radius - Length (dist);
|
||||
|
||||
if (add > 0)
|
||||
lighting.ambientlight += add;
|
||||
if (add > 0)
|
||||
lighting.ambientlight += add;
|
||||
}
|
||||
}
|
||||
|
||||
// clamp lighting so it doesn't overbright as much
|
||||
if (lighting.ambientlight > 128)
|
||||
lighting.ambientlight = 128;
|
||||
if (lighting.ambientlight + lighting.shadelight > 192)
|
||||
lighting.shadelight = 192 - lighting.ambientlight;
|
||||
|
||||
R_AliasDrawModel (&lighting);
|
||||
}
|
||||
|
||||
// clamp lighting so it doesn't overbright as much
|
||||
if (lighting.ambientlight > 128)
|
||||
lighting.ambientlight = 128;
|
||||
if (lighting.ambientlight + lighting.shadelight > 192)
|
||||
lighting.shadelight = 192 - lighting.ambientlight;
|
||||
|
||||
R_AliasDrawModel (&lighting);
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
R_DrawViewModel
|
||||
=============
|
||||
R_DrawViewModel
|
||||
*/
|
||||
void
|
||||
R_DrawViewModel (void)
|
||||
|
@ -607,7 +629,8 @@ R_DrawViewModel (void)
|
|||
float add;
|
||||
dlight_t *dl;
|
||||
|
||||
if (!r_drawviewmodel->int_val || r_fov_greater_than_90)
|
||||
if (!r_drawviewmodel->int_val
|
||||
|| !r_drawentities->int_val)
|
||||
return;
|
||||
|
||||
if (chase_active->int_val)
|
||||
|
@ -660,18 +683,12 @@ R_DrawViewModel (void)
|
|||
|
||||
r_viewlighting.plightvec = lightvec;
|
||||
|
||||
#ifdef QUAKE2
|
||||
cl.light_level = r_viewlighting.ambientlight;
|
||||
#endif
|
||||
|
||||
R_AliasDrawModel (&r_viewlighting);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_BmodelCheckBBox
|
||||
=============
|
||||
R_BmodelCheckBBox
|
||||
*/
|
||||
int
|
||||
R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
||||
|
@ -730,9 +747,7 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
|||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_DrawBEntitiesOnList
|
||||
=============
|
||||
R_DrawBEntitiesOnList
|
||||
*/
|
||||
void
|
||||
R_DrawBEntitiesOnList (void)
|
||||
|
@ -755,101 +770,98 @@ R_DrawBEntitiesOnList (void)
|
|||
switch (currententity->model->type) {
|
||||
case mod_brush:
|
||||
|
||||
clmodel = currententity->model;
|
||||
clmodel = currententity->model;
|
||||
|
||||
// see if the bounding box lets us trivially reject, also sets
|
||||
// trivial accept status
|
||||
for (j = 0; j < 3; j++) {
|
||||
minmaxs[j] = currententity->origin[j] + clmodel->mins[j];
|
||||
minmaxs[3 + j] = currententity->origin[j] + clmodel->maxs[j];
|
||||
}
|
||||
|
||||
clipflags = R_BmodelCheckBBox (clmodel, minmaxs);
|
||||
|
||||
if (clipflags != BMODEL_FULLY_CLIPPED) {
|
||||
VectorCopy (currententity->origin, r_entorigin);
|
||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
// FIXME: is this needed?
|
||||
VectorCopy (modelorg, r_worldmodelorg);
|
||||
|
||||
r_pcurrentvertbase = clmodel->vertexes;
|
||||
|
||||
// FIXME: stop transforming twice
|
||||
R_RotateBmodel ();
|
||||
|
||||
// calculate dynamic lighting for bmodel if it's not an
|
||||
// instanced model
|
||||
if (clmodel->firstmodelsurface != 0) {
|
||||
vec3_t lightorigin;
|
||||
|
||||
for (k = 0; k < MAX_DLIGHTS; k++) {
|
||||
if ((cl_dlights[k].die < cl.time) ||
|
||||
(!cl_dlights[k].radius)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
VectorSubtract (cl_dlights[k].origin,
|
||||
currententity->origin, lightorigin);
|
||||
R_MarkLights (lightorigin, &cl_dlights[k], 1 << k,
|
||||
clmodel->nodes +
|
||||
clmodel->hulls[0].firstclipnode);
|
||||
}
|
||||
}
|
||||
// if the driver wants polygons, deliver those. Z-buffering
|
||||
// is on
|
||||
// at this point, so no clipping to the world tree is needed,
|
||||
//
|
||||
//
|
||||
// just
|
||||
// frustum clipping
|
||||
if (r_drawpolys | r_drawculledpolys) {
|
||||
R_ZDrawSubmodelPolys (clmodel);
|
||||
} else {
|
||||
r_pefragtopnode = NULL;
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
r_emins[j] = minmaxs[j];
|
||||
r_emaxs[j] = minmaxs[3 + j];
|
||||
}
|
||||
|
||||
R_SplitEntityOnNode2 (cl.worldmodel->nodes);
|
||||
|
||||
if (r_pefragtopnode) {
|
||||
currententity->topnode = r_pefragtopnode;
|
||||
|
||||
if (r_pefragtopnode->contents >= 0) {
|
||||
// not a leaf; has to be clipped to the world BSP
|
||||
r_clipflags = clipflags;
|
||||
R_DrawSolidClippedSubmodelPolygons (clmodel);
|
||||
} else {
|
||||
// falls entirely in one leaf, so we just put all
|
||||
//
|
||||
//
|
||||
// the
|
||||
// edges in the edge list and let 1/z sorting
|
||||
// handle
|
||||
// drawing order
|
||||
R_DrawSubmodelPolygons (clmodel, clipflags);
|
||||
}
|
||||
|
||||
currententity->topnode = NULL;
|
||||
}
|
||||
// see if the bounding box lets us trivially reject, also
|
||||
// sets
|
||||
// trivial accept status
|
||||
for (j = 0; j < 3; j++) {
|
||||
minmaxs[j] = currententity->origin[j] + clmodel->mins[j];
|
||||
minmaxs[3 + j] = currententity->origin[j] +
|
||||
clmodel->maxs[j];
|
||||
}
|
||||
|
||||
// put back world rotation and frustum clipping
|
||||
// FIXME: R_RotateBmodel should just work off base_vxx
|
||||
VectorCopy (base_vpn, vpn);
|
||||
VectorCopy (base_vup, vup);
|
||||
VectorCopy (base_vright, vright);
|
||||
VectorCopy (base_modelorg, modelorg);
|
||||
VectorCopy (oldorigin, modelorg);
|
||||
R_TransformFrustum ();
|
||||
}
|
||||
clipflags = R_BmodelCheckBBox (clmodel, minmaxs);
|
||||
|
||||
break;
|
||||
if (clipflags != BMODEL_FULLY_CLIPPED) {
|
||||
VectorCopy (currententity->origin, r_entorigin);
|
||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
// FIXME: is this needed?
|
||||
VectorCopy (modelorg, r_worldmodelorg);
|
||||
|
||||
r_pcurrentvertbase = clmodel->vertexes;
|
||||
|
||||
// FIXME: stop transforming twice
|
||||
R_RotateBmodel ();
|
||||
|
||||
// calculate dynamic lighting for bmodel if it's not an
|
||||
// instanced model
|
||||
if (clmodel->firstmodelsurface != 0) {
|
||||
vec3_t lightorigin;
|
||||
|
||||
for (k = 0; k < MAX_DLIGHTS; k++) {
|
||||
if ((cl_dlights[k].die < cl.time) ||
|
||||
(!cl_dlights[k].radius)) continue;
|
||||
|
||||
VectorSubtract (cl_dlights[k].origin,
|
||||
currententity->origin, lightorigin);
|
||||
R_MarkLights (lightorigin, &cl_dlights[k], 1 << k,
|
||||
clmodel->nodes +
|
||||
clmodel->hulls[0].firstclipnode);
|
||||
}
|
||||
}
|
||||
// if the driver wants polygons, deliver those.
|
||||
// Z-buffering is on
|
||||
// at this point, so no clipping to the world tree is
|
||||
// needed, just
|
||||
// frustum clipping
|
||||
if (r_drawpolys | r_drawculledpolys) {
|
||||
R_ZDrawSubmodelPolys (clmodel);
|
||||
} else {
|
||||
r_pefragtopnode = NULL;
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
r_emins[j] = minmaxs[j];
|
||||
r_emaxs[j] = minmaxs[3 + j];
|
||||
}
|
||||
|
||||
R_SplitEntityOnNode2 (cl.worldmodel->nodes);
|
||||
|
||||
if (r_pefragtopnode) {
|
||||
currententity->topnode = r_pefragtopnode;
|
||||
|
||||
if (r_pefragtopnode->contents >= 0) {
|
||||
// not a leaf; has to be clipped to the world
|
||||
// BSP
|
||||
r_clipflags = clipflags;
|
||||
R_DrawSolidClippedSubmodelPolygons (clmodel);
|
||||
} else {
|
||||
// falls entirely in one leaf, so we just put
|
||||
// all the
|
||||
// edges in the edge list and let 1/z sorting
|
||||
// handle
|
||||
// drawing order
|
||||
R_DrawSubmodelPolygons (clmodel, clipflags);
|
||||
}
|
||||
|
||||
currententity->topnode = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// put back world rotation and frustum clipping
|
||||
// FIXME: R_RotateBmodel should just work off base_vxx
|
||||
VectorCopy (base_vpn, vpn);
|
||||
VectorCopy (base_vup, vup);
|
||||
VectorCopy (base_vright, vright);
|
||||
VectorCopy (base_modelorg, modelorg);
|
||||
VectorCopy (oldorigin, modelorg);
|
||||
R_TransformFrustum ();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -858,9 +870,7 @@ R_DrawBEntitiesOnList (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_EdgeDrawing
|
||||
================
|
||||
R_EdgeDrawing
|
||||
*/
|
||||
void
|
||||
R_EdgeDrawing (void)
|
||||
|
@ -919,7 +929,7 @@ R_EdgeDrawing (void)
|
|||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
// going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -927,14 +937,11 @@ R_EdgeDrawing (void)
|
|||
R_ScanEdges ();
|
||||
}
|
||||
|
||||
void R_SetupFrame (void);
|
||||
|
||||
/*
|
||||
================
|
||||
R_RenderView
|
||||
R_RenderView
|
||||
|
||||
r_refdef must be set before the first call
|
||||
================
|
||||
r_refdef must be set before the first call
|
||||
*/
|
||||
void
|
||||
R_RenderView_ (void)
|
||||
|
@ -946,14 +953,12 @@ R_RenderView_ (void)
|
|||
if (r_timegraph->int_val || r_speeds->int_val || r_dspeeds->int_val)
|
||||
r_time1 = Sys_DoubleTime ();
|
||||
|
||||
R_PushDlights (vec3_origin);
|
||||
|
||||
R_SetupFrame ();
|
||||
|
||||
#ifdef PASSAGES
|
||||
SetVisibilityByPassages ();
|
||||
#else
|
||||
R_MarkLeaves (); // done here so we know if we're in
|
||||
// water
|
||||
#endif
|
||||
// water
|
||||
|
||||
// make FDIV fast. This reduces timing precision after we've been running for a
|
||||
// while, so we don't do it globally. This also sets chop mode, and we do it
|
||||
|
@ -967,7 +972,7 @@ R_RenderView_ (void)
|
|||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
// going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -976,7 +981,7 @@ R_RenderView_ (void)
|
|||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
// going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -1054,9 +1059,7 @@ R_RenderView (void)
|
|||
}
|
||||
|
||||
/*
|
||||
================
|
||||
R_InitTurb
|
||||
================
|
||||
R_InitTurb
|
||||
*/
|
||||
void
|
||||
R_InitTurb (void)
|
||||
|
@ -1065,10 +1068,7 @@ R_InitTurb (void)
|
|||
|
||||
for (i = 0; i < (SIN_BUFFER_SIZE); i++) {
|
||||
sintable[i] = AMP + sin (i * 3.14159 * 2 / CYCLE) * AMP;
|
||||
intsintable[i] = AMP2 + sin (i * 3.14159 * 2 / CYCLE) * AMP2; // AMP2,
|
||||
//
|
||||
//
|
||||
// not
|
||||
// 20
|
||||
intsintable[i] = AMP2 + sin (i * 3.14159 * 2 / CYCLE) * AMP2;
|
||||
// AMP2 not 20
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_misc.c
|
||||
|
||||
@description@
|
||||
(description)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -30,8 +30,11 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "QF/sys.h"
|
||||
#include "QF/compat.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/cmd.h"
|
||||
#include "QF/draw.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "host.h"
|
||||
#include "r_local.h"
|
||||
|
@ -40,11 +43,11 @@
|
|||
#include "server.h"
|
||||
#include "view.h"
|
||||
|
||||
/*
|
||||
===============
|
||||
R_CheckVariables
|
||||
===============
|
||||
*/
|
||||
qboolean allowskybox; // whether or not to allow skyboxes
|
||||
|
||||
// --KB
|
||||
|
||||
|
||||
void
|
||||
R_CheckVariables (void)
|
||||
{
|
||||
|
@ -58,11 +61,9 @@ R_CheckVariables (void)
|
|||
|
||||
|
||||
/*
|
||||
============
|
||||
Show
|
||||
Show
|
||||
|
||||
Debugging use
|
||||
============
|
||||
Debugging use
|
||||
*/
|
||||
void
|
||||
Show (void)
|
||||
|
@ -78,11 +79,9 @@ Show (void)
|
|||
|
||||
|
||||
/*
|
||||
====================
|
||||
R_TimeRefresh_f
|
||||
R_TimeRefresh_f
|
||||
|
||||
For program optimization
|
||||
====================
|
||||
For program optimization
|
||||
*/
|
||||
void
|
||||
R_TimeRefresh_f (void)
|
||||
|
@ -119,12 +118,22 @@ R_TimeRefresh_f (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
R_LineGraph
|
||||
void
|
||||
R_LoadSky_f (void)
|
||||
{
|
||||
if (Cmd_Argc () != 2) {
|
||||
Con_Printf ("loadsky <name> : load a skybox\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Only called by R_DisplayTime
|
||||
================
|
||||
R_LoadSkys (Cmd_Argv (1));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_LineGraph
|
||||
|
||||
Only called by R_DisplayTime
|
||||
*/
|
||||
void
|
||||
R_LineGraph (int x, int y, int h)
|
||||
|
@ -132,38 +141,49 @@ R_LineGraph (int x, int y, int h)
|
|||
int i;
|
||||
byte *dest;
|
||||
int s;
|
||||
int color;
|
||||
|
||||
// FIXME: should be disabled on no-buffer adapters, or should be in the driver
|
||||
|
||||
x += r_refdef.vrect.x;
|
||||
y += r_refdef.vrect.y;
|
||||
// x += r_refdef.vrect.x;
|
||||
// y += r_refdef.vrect.y;
|
||||
|
||||
dest = vid.buffer + vid.rowbytes * y + x;
|
||||
|
||||
s = r_graphheight->int_val;
|
||||
|
||||
if (h == 10000)
|
||||
color = 0x6f; // yellow
|
||||
else if (h == 9999)
|
||||
color = 0x4f; // red
|
||||
else if (h == 9998)
|
||||
color = 0xd0; // blue
|
||||
else
|
||||
color = 0xff; // pink
|
||||
|
||||
if (h > s)
|
||||
h = s;
|
||||
|
||||
for (i = 0; i < h; i++, dest -= vid.rowbytes * 2) {
|
||||
dest[0] = 0xff;
|
||||
*(dest - vid.rowbytes) = 0x30;
|
||||
for (i = 0; i < h; i++, dest -= vid.rowbytes) {
|
||||
dest[0] = color;
|
||||
// *(dest-vid.rowbytes) = 0x30;
|
||||
}
|
||||
#if 0
|
||||
for (; i < s; i++, dest -= vid.rowbytes * 2) {
|
||||
dest[0] = 0x30;
|
||||
*(dest - vid.rowbytes) = 0x30;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
R_TimeGraph
|
||||
R_TimeGraph
|
||||
|
||||
Performance monitoring tool
|
||||
==============
|
||||
Performance monitoring tool
|
||||
*/
|
||||
#define MAX_TIMINGS 100
|
||||
extern float mouse_x, mouse_y;
|
||||
int graphval;
|
||||
void
|
||||
R_TimeGraph (void)
|
||||
{
|
||||
|
@ -178,9 +198,13 @@ R_TimeGraph (void)
|
|||
a = (r_time2 - r_time1) / 0.01;
|
||||
//a = fabs(mouse_y * 0.05);
|
||||
//a = (int)((r_refdef.vieworg[2] + 1024)/1)%(int)r_graphheight->value;
|
||||
//a = (int)((pmove.velocity[2] + 500)/10);
|
||||
//a = fabs(velocity[0])/20;
|
||||
//a = ((int)fabs(origin[0])/8)%20;
|
||||
//a = (cl.idealpitch + 30)/5;
|
||||
//a = (int)(cl.simangles[YAW] * 64/360) & 63;
|
||||
a = graphval;
|
||||
|
||||
r_timings[timex] = a;
|
||||
a = timex;
|
||||
|
||||
|
@ -192,7 +216,7 @@ R_TimeGraph (void)
|
|||
R_LineGraph (x, r_refdef.vrect.height - 2, r_timings[a]);
|
||||
if (x == 0)
|
||||
break; // screen too small to hold entire
|
||||
// thing
|
||||
// thing
|
||||
x--;
|
||||
a--;
|
||||
if (a == -1)
|
||||
|
@ -203,11 +227,63 @@ R_TimeGraph (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_PrintTimes
|
||||
=============
|
||||
*/
|
||||
void
|
||||
R_NetGraph (void)
|
||||
{
|
||||
#if 0
|
||||
int a, x, y, h, i;
|
||||
int lost;
|
||||
char st[80];
|
||||
|
||||
x = cl_hudswap->int_val ? vid.width - (NET_TIMINGS + 16): 0;
|
||||
y = vid.height - sb_lines - 24 - r_graphheight->int_val - 1;
|
||||
|
||||
h = r_graphheight->int_val % 8;
|
||||
|
||||
Draw_TextBox (x, y, NET_TIMINGS / 8, r_graphheight->int_val / 8 + 1);
|
||||
|
||||
lost = CL_CalcNet ();
|
||||
x = cl_hudswap->int_val ? vid.width - (NET_TIMINGS + 8) : 8;
|
||||
y = vid.height - sb_lines - 9;
|
||||
|
||||
y -= h;
|
||||
for (a = 0; a < NET_TIMINGS; a++) {
|
||||
i = (cls.netchan.outgoing_sequence - a) & NET_TIMINGSMASK;
|
||||
R_LineGraph (x + NET_TIMINGS - 1 - a, y, packet_latency[i]);
|
||||
}
|
||||
|
||||
y -= vid.height - sb_lines - 24 - r_graphheight->int_val + 7;
|
||||
snprintf (st, sizeof (st), "%3i%% packet loss", lost);
|
||||
if (cl_hudswap->int_val) {
|
||||
Draw_String8 (vid.width - ((strlen (st) * 8) + 8), y, st);
|
||||
} else {
|
||||
Draw_String8 (8, y, st);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_ZGraph (void)
|
||||
{
|
||||
int a, x, w, i;
|
||||
static int height[256];
|
||||
|
||||
if (r_refdef.vrect.width <= 256)
|
||||
w = r_refdef.vrect.width;
|
||||
else
|
||||
w = 256;
|
||||
|
||||
height[r_framecount & 255] = ((int) r_origin[2]) & 31;
|
||||
|
||||
x = 0;
|
||||
for (a = 0; a < w; a++) {
|
||||
i = (r_framecount - a) & 255;
|
||||
R_LineGraph (x + w - 1 - a, r_refdef.vrect.height - 2, height[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_PrintTimes (void)
|
||||
{
|
||||
|
@ -224,11 +300,6 @@ R_PrintTimes (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_PrintDSpeeds
|
||||
=============
|
||||
*/
|
||||
void
|
||||
R_PrintDSpeeds (void)
|
||||
{
|
||||
|
@ -252,11 +323,6 @@ R_PrintDSpeeds (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_PrintAliasStats
|
||||
=============
|
||||
*/
|
||||
void
|
||||
R_PrintAliasStats (void)
|
||||
{
|
||||
|
@ -287,11 +353,6 @@ WarpPalette (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
===================
|
||||
R_TransformFrustum
|
||||
===================
|
||||
*/
|
||||
void
|
||||
R_TransformFrustum (void)
|
||||
{
|
||||
|
@ -314,13 +375,8 @@ R_TransformFrustum (void)
|
|||
}
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
================
|
||||
TransformVector
|
||||
================
|
||||
*/
|
||||
void
|
||||
TransformVector (vec3_t in, vec3_t out)
|
||||
{
|
||||
|
@ -332,11 +388,6 @@ TransformVector (vec3_t in, vec3_t out)
|
|||
#endif
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
R_TransformPlane
|
||||
================
|
||||
*/
|
||||
void
|
||||
R_TransformPlane (mplane_t *p, float *normal, float *dist)
|
||||
{
|
||||
|
@ -349,11 +400,6 @@ R_TransformPlane (mplane_t *p, float *normal, float *dist)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_SetUpFrustumIndexes
|
||||
===============
|
||||
*/
|
||||
void
|
||||
R_SetUpFrustumIndexes (void)
|
||||
{
|
||||
|
@ -379,11 +425,6 @@ R_SetUpFrustumIndexes (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_SetupFrame
|
||||
===============
|
||||
*/
|
||||
void
|
||||
R_SetupFrame (void)
|
||||
{
|
||||
|
@ -391,13 +432,10 @@ R_SetupFrame (void)
|
|||
vrect_t vrect;
|
||||
float w, h;
|
||||
|
||||
// don't allow cheats in multiplayer
|
||||
if (cl.maxclients > 1) {
|
||||
Cvar_Set (r_draworder, "0");
|
||||
Cvar_Set (r_fullbright, "0");
|
||||
Cvar_Set (r_ambient, "0");
|
||||
Cvar_Set (r_drawflat, "0");
|
||||
}
|
||||
// don't allow cheats in multiplayer
|
||||
Cvar_SetValue (r_draworder, 0);
|
||||
Cvar_SetValue (r_ambient, 0);
|
||||
Cvar_SetValue (r_drawflat, 0);
|
||||
|
||||
if (r_numsurfs->int_val) {
|
||||
if ((surface_p - surfaces) > r_maxsurfsseen)
|
||||
|
@ -417,10 +455,7 @@ R_SetupFrame (void)
|
|||
r_numallocatededges, r_maxedgesseen);
|
||||
}
|
||||
|
||||
r_refdef.ambientlight = r_ambient->value;
|
||||
|
||||
if (r_refdef.ambientlight < 0)
|
||||
r_refdef.ambientlight = 0;
|
||||
r_refdef.ambientlight = max (r_ambient->value, 0);
|
||||
|
||||
if (!sv.active)
|
||||
Cvar_SetValue (r_draworder, 0); // don't let cheaters look behind
|
||||
|
@ -434,7 +469,7 @@ R_SetupFrame (void)
|
|||
|
||||
numbtofpolys = 0;
|
||||
|
||||
// debugging
|
||||
// debugging
|
||||
#if 0
|
||||
r_refdef.vieworg[0] = 80;
|
||||
r_refdef.vieworg[1] = 64;
|
||||
|
@ -444,13 +479,13 @@ R_SetupFrame (void)
|
|||
r_refdef.viewangles[2] = 0;
|
||||
#endif
|
||||
|
||||
// build the transformation matrix for the given view angles
|
||||
// build the transformation matrix for the given view angles
|
||||
VectorCopy (r_refdef.vieworg, modelorg);
|
||||
VectorCopy (r_refdef.vieworg, r_origin);
|
||||
|
||||
AngleVectors (r_refdef.viewangles, vpn, vright, vup);
|
||||
|
||||
// current viewleaf
|
||||
// current viewleaf
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
|
||||
|
||||
|
@ -534,5 +569,4 @@ R_SetupFrame (void)
|
|||
void
|
||||
R_TranslatePlayerSkin (int playernum)
|
||||
{
|
||||
// stub
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
|
||||
/*
|
||||
r_sprite.c
|
||||
|
||||
@description@
|
||||
(description)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -30,9 +29,17 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "QF/sys.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "client.h"
|
||||
#include "r_local.h"
|
||||
|
@ -45,9 +52,7 @@ spritedesc_t r_spritedesc;
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_RotateSprite
|
||||
================
|
||||
R_RotateSprite
|
||||
*/
|
||||
void
|
||||
R_RotateSprite (float beamlength)
|
||||
|
@ -64,12 +69,10 @@ R_RotateSprite (float beamlength)
|
|||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_ClipSpriteFace
|
||||
R_ClipSpriteFace
|
||||
|
||||
Clips the winding at clip_verts[clip_current] and changes clip_current
|
||||
Throws out the back side
|
||||
==============
|
||||
Clips the winding at clip_verts[clip_current] and changes clip_current
|
||||
Throws out the back side
|
||||
*/
|
||||
int
|
||||
R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
||||
|
@ -142,12 +145,10 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_SetupAndDrawSprite
|
||||
================
|
||||
R_SetupAndDrawSprite
|
||||
*/
|
||||
void
|
||||
R_SetupAndDrawSprite ()
|
||||
R_SetupAndDrawSprite (void)
|
||||
{
|
||||
int i, nump;
|
||||
float dot, scale, *pv;
|
||||
|
@ -241,9 +242,7 @@ R_SetupAndDrawSprite ()
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_GetSpriteframe
|
||||
================
|
||||
R_GetSpriteframe
|
||||
*/
|
||||
mspriteframe_t *
|
||||
R_GetSpriteframe (msprite_t *psprite)
|
||||
|
@ -288,9 +287,7 @@ R_GetSpriteframe (msprite_t *psprite)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSprite
|
||||
================
|
||||
R_DrawSprite
|
||||
*/
|
||||
void
|
||||
R_DrawSprite (void)
|
||||
|
@ -313,8 +310,6 @@ R_DrawSprite (void)
|
|||
// and
|
||||
// r_spritedesc.vright perpendicular to modelorg.
|
||||
// This will not work if the view direction is very close to straight
|
||||
//
|
||||
//
|
||||
// up or
|
||||
// down, because the cross product will be between two nearly
|
||||
// parallel
|
||||
|
@ -326,10 +321,10 @@ R_DrawSprite (void)
|
|||
tvec[2] = -modelorg[2];
|
||||
VectorNormalize (tvec);
|
||||
dot = tvec[2]; // same as DotProduct (tvec,
|
||||
// r_spritedesc.vup) because
|
||||
// r_spritedesc.vup) because
|
||||
// r_spritedesc.vup is 0, 0, 1
|
||||
if ((dot > 0.999848) || (dot < -0.999848)) // cos(1 degree) =
|
||||
// 0.999848
|
||||
// 0.999848
|
||||
return;
|
||||
r_spritedesc.vup[0] = 0;
|
||||
r_spritedesc.vup[1] = 0;
|
||||
|
@ -361,8 +356,6 @@ R_DrawSprite (void)
|
|||
// and
|
||||
// r_spritedesc.vright parallel to the viewplane.
|
||||
// This will not work if the view direction is very close to straight
|
||||
//
|
||||
//
|
||||
// up or
|
||||
// down, because the cross product will be between two nearly
|
||||
// parallel
|
||||
|
@ -370,10 +363,10 @@ R_DrawSprite (void)
|
|||
// draw if
|
||||
// the two vectors are less than 1 degree apart
|
||||
dot = vpn[2]; // same as DotProduct (vpn,
|
||||
// r_spritedesc.vup) because
|
||||
// r_spritedesc.vup) because
|
||||
// r_spritedesc.vup is 0, 0, 1
|
||||
if ((dot > 0.999848) || (dot < -0.999848)) // cos(1 degree) =
|
||||
// 0.999848
|
||||
// 0.999848
|
||||
return;
|
||||
r_spritedesc.vup[0] = 0;
|
||||
r_spritedesc.vup[1] = 0;
|
||||
|
@ -395,8 +388,6 @@ R_DrawSprite (void)
|
|||
r_spritedesc.vright, r_spritedesc.vup);
|
||||
} else if (psprite->type == SPR_VP_PARALLEL_ORIENTED) {
|
||||
// generate the sprite's axes, parallel to the viewplane, but rotated
|
||||
//
|
||||
//
|
||||
// in
|
||||
// that plane around the center according to the sprite entity's roll
|
||||
// angle. So vpn stays the same, but vright and vup rotate
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_surf.c
|
||||
|
||||
@description@
|
||||
surface-related refresh code
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -40,11 +40,11 @@ drawsurf_t r_drawsurf;
|
|||
int lightleft, sourcesstep, blocksize, sourcetstep;
|
||||
int lightdelta, lightdeltastep;
|
||||
int lightright, lightleftstep, lightrightstep, blockdivshift;
|
||||
unsigned blockdivmask;
|
||||
unsigned int blockdivmask;
|
||||
void *prowdestbase;
|
||||
unsigned char *pbasesource;
|
||||
int surfrowbytes; // used by ASM files
|
||||
unsigned *r_lightptr;
|
||||
unsigned int *r_lightptr;
|
||||
int r_stepback;
|
||||
int r_lightwidth;
|
||||
int r_numhblocks, r_numvblocks;
|
||||
|
@ -62,12 +62,10 @@ static void (*surfmiptable[4]) (void) = {
|
|||
|
||||
|
||||
|
||||
unsigned blocklights[18 * 18];
|
||||
unsigned int blocklights[18 * 18];
|
||||
|
||||
/*
|
||||
===============
|
||||
R_AddDynamicLights
|
||||
===============
|
||||
R_AddDynamicLights
|
||||
*/
|
||||
void
|
||||
R_AddDynamicLights (void)
|
||||
|
@ -76,7 +74,7 @@ R_AddDynamicLights (void)
|
|||
int lnum;
|
||||
int sd, td;
|
||||
float dist, rad, minlight;
|
||||
vec3_t impact, local;
|
||||
vec3_t impact, local, lightorigin;
|
||||
int s, t;
|
||||
int i;
|
||||
int smax, tmax;
|
||||
|
@ -91,8 +89,10 @@ R_AddDynamicLights (void)
|
|||
if (!(surf->dlightbits & (1 << lnum)))
|
||||
continue; // not lit by this light
|
||||
|
||||
VectorSubtract (cl_dlights[lnum].origin, currententity->origin,
|
||||
lightorigin);
|
||||
rad = cl_dlights[lnum].radius;
|
||||
dist = DotProduct (cl_dlights[lnum].origin, surf->plane->normal) -
|
||||
dist = DotProduct (lightorigin, surf->plane->normal) -
|
||||
surf->plane->dist;
|
||||
rad -= fabs (dist);
|
||||
minlight = cl_dlights[lnum].minlight;
|
||||
|
@ -100,10 +100,8 @@ R_AddDynamicLights (void)
|
|||
continue;
|
||||
minlight = rad - minlight;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
impact[i] = cl_dlights[lnum].origin[i] -
|
||||
surf->plane->normal[i] * dist;
|
||||
}
|
||||
for (i = 0; i < 3; i++)
|
||||
impact[i] = lightorigin[i] - surf->plane->normal[i] * dist;
|
||||
|
||||
local[0] = DotProduct (impact, tex->vecs[0]) + tex->vecs[0][3];
|
||||
local[1] = DotProduct (impact, tex->vecs[1]) + tex->vecs[1][3];
|
||||
|
@ -124,35 +122,16 @@ R_AddDynamicLights (void)
|
|||
else
|
||||
dist = td + (sd >> 1);
|
||||
if (dist < minlight)
|
||||
#ifdef QUAKE2
|
||||
{
|
||||
unsigned temp;
|
||||
|
||||
temp = (rad - dist) * 256;
|
||||
i = t * smax + s;
|
||||
if (!cl_dlights[lnum].dark)
|
||||
blocklights[i] += temp;
|
||||
else {
|
||||
if (blocklights[i] > temp)
|
||||
blocklights[i] -= temp;
|
||||
else
|
||||
blocklights[i] = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
blocklights[t * smax + s] += (rad - dist) * 256;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_BuildLightMap
|
||||
R_BuildLightMap
|
||||
|
||||
Combine and scale multiple lightmaps into the 8.8 format in blocklights
|
||||
===============
|
||||
Combine and scale multiple lightmaps into the 8.8 format in blocklights
|
||||
*/
|
||||
void
|
||||
R_BuildLightMap (void)
|
||||
|
@ -161,7 +140,7 @@ R_BuildLightMap (void)
|
|||
int t;
|
||||
int i, size;
|
||||
byte *lightmap;
|
||||
unsigned scale;
|
||||
unsigned int scale;
|
||||
int maps;
|
||||
msurface_t *surf;
|
||||
|
||||
|
@ -207,11 +186,9 @@ R_BuildLightMap (void)
|
|||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_TextureAnimation
|
||||
R_TextureAnimation
|
||||
|
||||
Returns the proper texture for a given time and base texture
|
||||
===============
|
||||
Returns the proper texture for a given time and base texture
|
||||
*/
|
||||
texture_t *
|
||||
R_TextureAnimation (texture_t *base)
|
||||
|
@ -243,9 +220,7 @@ R_TextureAnimation (texture_t *base)
|
|||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_DrawSurface
|
||||
===============
|
||||
R_DrawSurface
|
||||
*/
|
||||
void
|
||||
R_DrawSurface (void)
|
||||
|
@ -332,12 +307,10 @@ R_DrawSurface (void)
|
|||
|
||||
//=============================================================================
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip0
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip0
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip0 (void)
|
||||
|
@ -383,9 +356,7 @@ R_DrawSurfaceBlock8_mip0 (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip1
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip1
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip1 (void)
|
||||
|
@ -431,9 +402,7 @@ R_DrawSurfaceBlock8_mip1 (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip2
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip2
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip2 (void)
|
||||
|
@ -479,9 +448,7 @@ R_DrawSurfaceBlock8_mip2 (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip3
|
||||
================
|
||||
R_DrawSurfaceBlock8_mip3
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip3 (void)
|
||||
|
@ -527,11 +494,9 @@ R_DrawSurfaceBlock8_mip3 (void)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_DrawSurfaceBlock16
|
||||
R_DrawSurfaceBlock16
|
||||
|
||||
FIXME: make this work
|
||||
================
|
||||
FIXME: make this work
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock16 (void)
|
||||
|
@ -578,9 +543,7 @@ R_DrawSurfaceBlock16 (void)
|
|||
//============================================================================
|
||||
|
||||
/*
|
||||
================
|
||||
R_GenTurbTile
|
||||
================
|
||||
R_GenTurbTile
|
||||
*/
|
||||
void
|
||||
R_GenTurbTile (pixel_t *pbasetex, void *pdest)
|
||||
|
@ -603,9 +566,7 @@ R_GenTurbTile (pixel_t *pbasetex, void *pdest)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_GenTurbTile16
|
||||
================
|
||||
R_GenTurbTile16
|
||||
*/
|
||||
void
|
||||
R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
|
||||
|
@ -628,9 +589,7 @@ R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
|
|||
|
||||
|
||||
/*
|
||||
================
|
||||
R_GenTile
|
||||
================
|
||||
R_GenTile
|
||||
*/
|
||||
void
|
||||
R_GenTile (msurface_t *psurf, void *pdest)
|
||||
|
@ -638,12 +597,12 @@ R_GenTile (msurface_t *psurf, void *pdest)
|
|||
if (psurf->flags & SURF_DRAWTURB) {
|
||||
if (r_pixbytes == 1) {
|
||||
R_GenTurbTile ((pixel_t *)
|
||||
|
||||
|
||||
((byte *) psurf->texinfo->texture +
|
||||
psurf->texinfo->texture->offsets[0]), pdest);
|
||||
} else {
|
||||
R_GenTurbTile16 ((pixel_t *)
|
||||
|
||||
|
||||
((byte *) psurf->texinfo->texture +
|
||||
psurf->texinfo->texture->offsets[0]), pdest);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
r_vars.c
|
||||
|
||||
@description@
|
||||
global refresh variables
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -30,8 +30,7 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
// all global and static refresh variables are collected in a contiguous block
|
||||
// to avoid cache conflicts.
|
||||
|
@ -45,4 +44,4 @@
|
|||
|
||||
int r_bmodelactive;
|
||||
|
||||
#endif // USE_INTEL_ASM
|
||||
#endif // !USE_INTEL_ASM
|
||||
|
|
|
@ -31,31 +31,21 @@
|
|||
#endif
|
||||
|
||||
#include "QF/compat.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/draw.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "client.h"
|
||||
#include "host.h"
|
||||
#include "r_local.h"
|
||||
#include "view.h"
|
||||
|
||||
extern byte gammatable[256];
|
||||
extern cvar_t *cl_cshift_powerup;
|
||||
|
||||
extern qboolean V_CheckGamma (void);
|
||||
extern byte gammatable[256];
|
||||
|
||||
extern void V_CalcIntermissionRefdef (void);
|
||||
extern void V_CalcRefdef (void);
|
||||
qboolean V_CheckGamma (void);
|
||||
|
||||
extern cvar_t *cl_cshift_powerup;
|
||||
extern cvar_t *crosshair;
|
||||
extern cvar_t *scr_ofsx;
|
||||
extern cvar_t *scr_ofsy;
|
||||
extern cvar_t *scr_ofsz;
|
||||
|
||||
|
||||
void
|
||||
V_CalcPowerupCshift (void)
|
||||
{
|
||||
void
|
||||
V_CalcPowerupCshift (void)
|
||||
{
|
||||
if (!cl_cshift_powerup->int_val)
|
||||
return;
|
||||
|
||||
|
@ -109,11 +99,12 @@ V_UpdatePalette (void)
|
|||
new = true;
|
||||
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
|
||||
}
|
||||
for (j = 0; j < 3; j++)
|
||||
for (j = 0; j < 3; j++) {
|
||||
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j]) {
|
||||
new = true;
|
||||
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// drop the damage value
|
||||
|
@ -140,12 +131,9 @@ V_UpdatePalette (void)
|
|||
basepal += 3;
|
||||
|
||||
for (j = 0; j < NUM_CSHIFTS; j++) {
|
||||
r +=
|
||||
(cl.cshifts[j].percent * (cl.cshifts[j].destcolor[0] - r)) >> 8;
|
||||
g +=
|
||||
(cl.cshifts[j].percent * (cl.cshifts[j].destcolor[1] - g)) >> 8;
|
||||
b +=
|
||||
(cl.cshifts[j].percent * (cl.cshifts[j].destcolor[2] - b)) >> 8;
|
||||
r += (cl.cshifts[j].percent * (cl.cshifts[j].destcolor[0] - r)) >> 8;
|
||||
g += (cl.cshifts[j].percent * (cl.cshifts[j].destcolor[1] - g)) >> 8;
|
||||
b += (cl.cshifts[j].percent * (cl.cshifts[j].destcolor[2] - b)) >> 8;
|
||||
}
|
||||
|
||||
newpal[0] = gammatable[r];
|
||||
|
@ -153,6 +141,5 @@ V_UpdatePalette (void)
|
|||
newpal[2] = gammatable[b];
|
||||
newpal += 3;
|
||||
}
|
||||
|
||||
VID_ShiftPalette (pal);
|
||||
}
|
||||
|
|
|
@ -500,8 +500,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
}
|
||||
|
||||
pleaf->key = r_currentkey;
|
||||
r_currentkey++; // all bmodels in a leaf share the
|
||||
// same key
|
||||
r_currentkey++; // all bmodels in a leaf share the same key
|
||||
} else {
|
||||
// node is just a decision point, so go down the apropriate sides
|
||||
|
||||
|
|
|
@ -204,10 +204,6 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
|
|||
} while ((edgestoadd = next_edge) != NULL);
|
||||
}
|
||||
|
||||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_RemoveEdges
|
||||
|
@ -222,10 +218,6 @@ R_RemoveEdges (edge_t *pedge)
|
|||
} while ((pedge = pedge->nextremove) != NULL);
|
||||
}
|
||||
|
||||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_StepActiveU
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <math.h>
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/cmd.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/locs.h"
|
||||
#include "QF/mathlib.h"
|
||||
#include "QF/screen.h"
|
||||
|
@ -299,8 +299,9 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
if (scr_viewsize->int_val >= 100) {
|
||||
size = 100.0;
|
||||
full = true;
|
||||
} else
|
||||
} else {
|
||||
size = scr_viewsize->int_val;
|
||||
}
|
||||
|
||||
if (cl.intermission) {
|
||||
full = true;
|
||||
|
@ -314,23 +315,26 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
else
|
||||
h = pvrectin->height - lineadj;
|
||||
|
||||
// h = (!cl_sbar->int_val && size==1.0) ? pvrectin->height : (pvrectin->height - lineadj);
|
||||
// h = pvrectin->height - lineadj;
|
||||
if (full)
|
||||
if (full) {
|
||||
pvrect->width = pvrectin->width;
|
||||
else
|
||||
} else {
|
||||
pvrect->width = pvrectin->width * size;
|
||||
}
|
||||
|
||||
if (pvrect->width < 96) {
|
||||
size = 96.0 / pvrectin->width;
|
||||
pvrect->width = 96; // min for icons
|
||||
}
|
||||
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;
|
||||
} else {
|
||||
if (pvrect->height > pvrectin->height)
|
||||
pvrect->height = pvrectin->height;
|
||||
}
|
||||
|
||||
pvrect->height &= ~1;
|
||||
|
||||
|
|
|
@ -170,7 +170,6 @@ R_LineGraph (int x, int y, int h)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_TimeGraph
|
||||
|
||||
|
@ -485,8 +484,8 @@ R_SetupFrame (void)
|
|||
|
||||
if ((r_dowarp != r_dowarpold) || r_viewchanged) {
|
||||
if (r_dowarp) {
|
||||
if ((vid.width <= WARP_WIDTH) &&
|
||||
(vid.height <= WARP_HEIGHT)) {
|
||||
if ((vid.width <= WARP_WIDTH)
|
||||
&& (vid.height <= WARP_HEIGHT)) {
|
||||
vrect.x = 0;
|
||||
vrect.y = 0;
|
||||
vrect.width = vid.width;
|
||||
|
|
|
@ -58,7 +58,6 @@ void R_DrawSurfaceBlock8_mip3 (void);
|
|||
static void (*surfmiptable[4]) (void) = {
|
||||
R_DrawSurfaceBlock8_mip0,
|
||||
R_DrawSurfaceBlock8_mip1,
|
||||
|
||||
R_DrawSurfaceBlock8_mip2, R_DrawSurfaceBlock8_mip3};
|
||||
|
||||
|
||||
|
|
|
@ -111,12 +111,12 @@ V_UpdatePalette (void)
|
|||
|
||||
// drop the damage value
|
||||
cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime * 150;
|
||||
if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0)
|
||||
if (cl.cshifts[CSHIFT_DAMAGE].percent < 0)
|
||||
cl.cshifts[CSHIFT_DAMAGE].percent = 0;
|
||||
|
||||
// drop the bonus value
|
||||
cl.cshifts[CSHIFT_BONUS].percent -= host_frametime * 100;
|
||||
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
|
||||
if (cl.cshifts[CSHIFT_BONUS].percent < 0)
|
||||
cl.cshifts[CSHIFT_BONUS].percent = 0;
|
||||
|
||||
force = V_CheckGamma ();
|
||||
|
|
Loading…
Reference in a new issue