gratuitous_diff--

This commit is contained in:
Bill Currie 2001-08-28 22:46:02 +00:00
parent baaa452345
commit 11489550ba
22 changed files with 183 additions and 196 deletions

View file

@ -48,7 +48,7 @@ R_LineGraph (int x, int y, int *h_vals, int count)
int h, i, s, color;
byte *dest;
// FIXME: should be disabled on no-buffer adapters, or should be in the driver
// FIXME: disable on no-buffer adapters, or put in the driver
s = r_graphheight->int_val;
while (count--) {

View file

@ -318,7 +318,7 @@ R_AliasClipTriangle (mtriangle_t *ptri)
r_affinetridesc.ptriangles = &mtri;
r_affinetridesc.pfinalverts = fv[pingpong];
// FIXME: do all at once as trifan?
// FIXME: do all at once as trifan?
mtri.vertindex[0] = 0;
for (i = 1; i < k - 1; i++) {
mtri.vertindex[1] = i;

View file

@ -378,7 +378,6 @@ R_AliasSetUpTransform (int trivial_accept)
aliastransform[1][i] *= aliasyscale *
(1.0 / ((float) 0x8000 * 0x10000));
aliastransform[2][i] *= 1.0 / ((float) 0x8000 * 0x10000);
}
}
}
@ -463,8 +462,7 @@ R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
temp += (int) (r_shadelight * lightcos);
// clamp; because we limited the minimum ambient and shading
// light, we
// don't have to clamp low light, just bright
// light, we don't have to clamp low light, just bright
if (temp < 0)
temp = 0;
}

View file

@ -217,7 +217,7 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
// horizontal edge is less than epsilon above a scan, and numeric error
// causes it to incorrectly extend to the scan, and the extension of the
// line goes off the edge of the screen
// FIXME: is this actually needed?
// FIXME: is this actually needed?
if (edge->u < r_refdef.vrect_x_adj_shift20)
edge->u = r_refdef.vrect_x_adj_shift20;
if (edge->u > r_refdef.vrectright_adj_shift20)
@ -468,8 +468,8 @@ R_RenderFace (msurface_t *fa, int clipflags)
}
// if there was a clip off the left edge, add that edge too
// FIXME: faster to do in screen space?
// FIXME: share clipped edges?
// FIXME: faster to do in screen space?
// FIXME: share clipped edges?
if (makeleftedge) {
r_pedge = &tedge;
r_lastvertvalid = false;
@ -555,8 +555,8 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
r_nearzi = 0;
r_nearzionly = false;
makeleftedge = makerightedge = false;
// FIXME: keep clipped bmodel edges in clockwise order so last vertex caching
// can be used?
// FIXME: keep clipped bmodel edges in clockwise order so last vertex
// caching can be used?
r_lastvertvalid = false;
for (; pedges; pedges = pedges->pnext) {
@ -570,8 +570,8 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
}
// if there was a clip off the left edge, add that edge too
// FIXME: faster to do in screen space?
// FIXME: share clipped edges?
// FIXME: faster to do in screen space?
// FIXME: share clipped edges?
if (makeleftedge) {
r_pedge = &tedge;
R_ClipEdge (&r_leftexit, &r_leftenter, pclip->next);
@ -628,8 +628,8 @@ R_RenderPoly (msurface_t *fa, int clipflags)
int vertpage, newverts, newpage, lastvert;
qboolean visible;
// FIXME: clean this up and make it faster
// FIXME: guard against running out of vertices
// FIXME: clean this up and make it faster
// FIXME: guard against running out of vertices
s_axis = t_axis = 0; // keep compiler happy
@ -644,7 +644,7 @@ R_RenderPoly (msurface_t *fa, int clipflags)
}
// reconstruct the polygon
// FIXME: these should be precalculated and loaded off disk
// FIXME: these should be precalculated and loaded off disk
pedges = currententity->model->edges;
lnumverts = fa->numedges;
vertpage = 0;
@ -800,7 +800,7 @@ R_ZDrawSubmodelPolys (model_t *pmodel)
// draw the polygon
if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
(!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON))) {
// FIXME: use bounding-box-based frustum clipping info?
// FIXME: use bounding-box-based frustum clipping info?
R_RenderPoly (psurf, 15);
}
}

View file

@ -43,7 +43,7 @@
coherence ? low depth complexity-- 1 to 3 or so this breaks spans at every
edge, even hidden ones (bad)
have a sentinal at both ends
have a sentinal at both ends?
*/
edge_t *auxedges;
@ -51,9 +51,11 @@ edge_t *r_edges, *edge_p, *edge_max;
surf_t *surfaces, *surface_p, *surf_max;
// surfaces are generated in back to front order by the bsp, so if a surf
// pointer is greater than another one, it should be drawn in front
// surfaces[1] is the background, and is used as the active surface stack
/*
surfaces are generated in back to front order by the bsp, so if a surf
pointer is greater than another one, it should be drawn in front
surfaces[1] is the background, and is used as the active surface stack
*/
edge_t *newedges[MAXHEIGHT];
edge_t *removeedges[MAXHEIGHT];
@ -161,7 +163,7 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
do {
next_edge = edgestoadd->next;
edgesearch:
edgesearch:
if (edgelist->u >= edgestoadd->u)
goto addedge;
edgelist = edgelist->next;
@ -177,7 +179,7 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
goto edgesearch;
// insert edgestoadd before edgelist
addedge:
addedge:
edgestoadd->next = edgelist;
edgestoadd->prev = edgelist->prev;
edgelist->prev->next = edgestoadd;
@ -326,7 +328,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
goto gotposition;
newtop:
newtop:
// emit a span (obscures current top)
iu = edge->u >> 20;
@ -341,7 +343,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
// set last_u on the new span
surf->last_u = iu;
gotposition:
gotposition:
// insert before surf2
surf->next = surf2;
surf->prev = surf2->prev;
@ -438,9 +440,8 @@ R_LeadingEdge (edge_t *edge)
} while (surf->key > surf2->key);
if (surf->key == surf2->key) {
// if it's two surfaces on the same plane, the one that's
// already active is in front, so keep going unless it's a
// bmodel
// if it's two surfaces on the same plane, the already active
// one is in front, so keep going unless it's a bmodel
if (!surf->insubmodel)
goto continue_search;
@ -574,7 +575,7 @@ R_ScanEdges (void)
span_p = basespan_p;
// clear active edges to just the background edges around the whole screen
// FIXME: most of this only needs to be set up once
// FIXME: most of this only needs to be set up once
edge_head.u = r_refdef.vrect.x << 20;
edge_head_u_shift20 = edge_head.u >> 20;
edge_head.u_step = 0;
@ -596,7 +597,7 @@ R_ScanEdges (void)
edge_aftertail.next = &edge_sentinel;
edge_aftertail.prev = &edge_tail;
// FIXME: do we need this now that we clamp x in r_draw.c?
// FIXME: do we need this now that we clamp x in r_draw.c?
edge_sentinel.u = 2000 << 24; // make sure nothing sorts past this
edge_sentinel.prev = &edge_aftertail;

View file

@ -242,7 +242,7 @@ R_SetUpFrustumIndexes (void)
}
}
// FIXME: do just once at start
// FIXME: do just once at start
pfrustum_indexes[i] = pindex;
pindex += 6;
}

View file

@ -114,7 +114,7 @@ R_ReadPointFile_f (void)
particle_t *p;
char name[MAX_OSPATH];
// FIXME snprintf (name, sizeof (name), "maps/%s.pts", sv.name);
// FIXME snprintf (name, sizeof (name), "maps/%s.pts", sv.name);
COM_FOpenFile (name, &f);
if (!f) {
@ -512,7 +512,7 @@ R_DrawParticles (void)
float time1;
float dvel;
float frametime;
D_StartParticles ();
VectorScale (vright, xscaleshrink, r_pright);

View file

@ -289,7 +289,7 @@ R_DrawSprite (void)
sprite_width = r_spritedesc.pspriteframe->width;
sprite_height = r_spritedesc.pspriteframe->height;
// TODO: make this caller-selectable
// TODO: make this caller-selectable
if (psprite->type == SPR_FACING_UPRIGHT) {
// generate the sprite's axes, with vup straight up in worldspace, and
// r_spritedesc.vright perpendicular to modelorg.
@ -311,9 +311,8 @@ R_DrawSprite (void)
r_spritedesc.vup[1] = 0;
r_spritedesc.vup[2] = 1;
r_spritedesc.vright[0] = tvec[1];
//CrossProduct(r_spritedesc.vup, -modelorg,
//CrossProduct(r_spritedesc.vup, -modelorg, r_spritedesc.vright)
r_spritedesc.vright[1] = -tvec[0];
//r_spritedesc.vright)
r_spritedesc.vright[2] = 0;
VectorNormalize (r_spritedesc.vright);
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];

View file

@ -186,7 +186,7 @@ R_BuildLightMap (void)
texture_t *
R_TextureAnimation (texture_t *base)
{
int reletive;
int relative;
int count;
if (currententity->frame) {
@ -197,10 +197,10 @@ R_TextureAnimation (texture_t *base)
if (!base->anim_total)
return base;
reletive = (int) (r_realtime * 10) % base->anim_total;
relative = (int) (r_realtime * 10) % base->anim_total;
count = 0;
while (base->anim_min > reletive || base->anim_max <= reletive) {
while (base->anim_min > relative || base->anim_max <= relative) {
base = base->anim_next;
if (!base)
Sys_Error ("R_TextureAnimation: broken cycle");
@ -214,12 +214,12 @@ R_TextureAnimation (texture_t *base)
void
R_DrawSurface (void)
{
unsigned char *basetptr;
byte *basetptr;
int smax, tmax, twidth;
int u;
int soffset, basetoffset, texwidth;
int horzblockstep;
unsigned char *pcolumndest;
byte *pcolumndest;
void (*pblockdrawer) (void);
texture_t *mt;

View file

@ -29,6 +29,7 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif

View file

@ -29,12 +29,6 @@
#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 "QF/cvar.h"
#include "QF/draw.h"
@ -45,57 +39,62 @@
#include "r_cvar.h"
/*
R_LineGraph
R_LineGraph
Only called by R_DisplayTime
Only called by R_DisplayTime
*/
void
R_LineGraph (int x, int y, int *h_vals, int count)
{
int h, i, s, color;
int h, i, s, color;
// FIXME: disable on no-buffer adapters, or put in the driver
// FIXME: disable on no-buffer adapters, or put in the driver
s = r_graphheight->int_val;
h = *h_vals++;
while (count--) {
h = *h_vals++;
if (h == 10000)
color = 0x6f; // yellow
else if (h == 9999)
color = 0x4f; // red
else if (h == 9998)
color = 0xd0; // blue
else
color = 0xfe; // white // LordHavoc: was pink (0xff)
if (h > s)
h = s;
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;
switch(r_pixbytes) {
case 1:
{
byte *dest = (byte *) vid.buffer + vid.rowbytes * y + x;
for (i = 0; i < h; i++, dest -= vid.rowbytes * 2)
*dest = color;
}
break;
case 2:
{
short *dest = (short *) vid.buffer + (vid.rowbytes >> 1) * y + x;
color = d_8to16table[color];
for (i = 0; i < h; i++, dest -= vid.rowbytes)
*dest = color;
}
break;
case 4:
{
int *dest = (int *) vid.buffer + (vid.rowbytes >> 2) * y + x;
color = d_8to24table[color];
for (i = 0; i < h; i++, dest -= (vid.rowbytes >> 1))
*dest = color;
}
break;
default:
Sys_Error("R_LineGraph: unsupported r_pixbytes %i\n", r_pixbytes);
switch(r_pixbytes) {
case 1:
{
byte *dest = (byte *) vid.buffer + vid.rowbytes * y + x;
for (i = 0; i < h; i++, dest -= vid.rowbytes * 2)
*dest = color;
}
break;
case 2:
{
short *dest = (short *) vid.buffer +
(vid.rowbytes >> 1) * y + x;
color = d_8to16table[color];
for (i = 0; i < h; i++, dest -= vid.rowbytes)
*dest = color;
}
break;
case 4:
{
int *dest = (int *) vid.buffer +
(vid.rowbytes >> 2) * y + x;
color = d_8to24table[color];
for (i = 0; i < h; i++, dest -= (vid.rowbytes >> 1))
*dest = color;
}
break;
default:
Sys_Error("R_LineGraph: unsupported r_pixbytes %i\n",
r_pixbytes);
}
}
}

View file

@ -99,6 +99,7 @@ R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
out->flags |= ALIAS_BOTTOM_CLIP;
}
void
R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
@ -118,6 +119,7 @@ R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
}
void
R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
@ -137,6 +139,7 @@ R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
}
void
R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
@ -156,6 +159,7 @@ R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
}
void
R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
@ -177,6 +181,7 @@ R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
}
int
R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
void (*clip) (finalvert_t *pfv0, finalvert_t *pfv1,
@ -215,6 +220,7 @@ R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
return k;
}
void
R_AliasClipTriangle (mtriangle_t *ptri)
{

View file

@ -39,7 +39,7 @@
#include "d_ifacea.h"
#include "r_local.h"
#define LIGHT_MIN 5 // lowest light value we'll allow, to
#define LIGHT_MIN 5 // lowest light value we'll allow, to
// avoid the need for inner-loop light
// clamping
@ -111,7 +111,6 @@ R_AliasCheckBBox (void)
int minz;
// expand, rotate, and translate points into worldspace
currententity->trivial_accept = 0;
pmodel = currententity->model;
pahdr = Mod_Extradata (pmodel);
@ -241,6 +240,7 @@ R_AliasCheckBBox (void)
return true;
}
void
R_AliasTransformVector (vec3_t in, vec3_t out)
{
@ -249,6 +249,7 @@ R_AliasTransformVector (vec3_t in, vec3_t out)
out[2] = DotProduct (in, aliastransform[2]) + aliastransform[2][3];
}
/*
R_AliasPreparePoints
@ -311,6 +312,7 @@ R_AliasPreparePoints (void)
}
}
void
R_AliasSetUpTransform (int trivial_accept)
{
@ -380,6 +382,7 @@ R_AliasSetUpTransform (int trivial_accept)
}
}
void
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
trivertx_t *pverts, stvert_t *pstverts)
@ -478,6 +481,7 @@ R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
fv->v[1] = (av->fv[1] * aliasyscale * zi) + aliasycenter;
}
void
R_AliasPrepareUnclippedPoints (void)
{
@ -496,6 +500,7 @@ R_AliasPrepareUnclippedPoints (void)
D_PolysetDraw ();
}
void
R_AliasSetupSkin (void)
{
@ -584,6 +589,7 @@ R_AliasSetupLighting (alight_t *plighting)
r_plightvec[2] = DotProduct (plighting->plightvec, alias_up);
}
/*
R_AliasSetupFrame
@ -630,6 +636,7 @@ R_AliasSetupFrame (void)
((byte *) paliashdr + paliasgroup->frames[i].frame);
}
void
R_AliasDrawModel (alight_t *plighting)
{

View file

@ -48,8 +48,6 @@ zpointdesc_t r_zpointdesc;
polydesc_t r_polydesc;
clipplane_t *entity_clipplanes;
clipplane_t view_clipplanes[4];
clipplane_t world_clipplanes[16];
@ -165,7 +163,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
r_ceilv1 = (int) ceil (r_v1);
// create the edge
if (ceilv0 == r_ceilv1) {
// we cache unclipped horizontal edges as fully clipped
@ -210,10 +207,10 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
edge->u_step = u_step * 0x100000;
edge->u = u * 0x100000 + 0xFFFFF;
// we need to do this to avoid stepping off the edges if a very nearly
// horizontal edge is less than epsilon above a scan, and numeric error causes
// it to incorrectly extend to the scan, and the extension of the line goes off
// the edge of the screen
// we need to do this to avoid stepping off the edges if a very nearly
// horizontal edge is less than epsilon above a scan, and numeric error
// causes it to incorrectly extend to the scan, and the extension of the
// line goes off the edge of the screen
// FIXME: is this actually needed?
if (edge->u < r_refdef.vrect_x_adj_shift20)
edge->u = r_refdef.vrect_x_adj_shift20;
@ -240,6 +237,7 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
removeedges[v2] = edge;
}
void
R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
{
@ -321,6 +319,7 @@ R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
R_EmitEdge (pv0, pv1);
}
void
R_EmitCachedEdge (void)
{
@ -339,6 +338,7 @@ R_EmitCachedEdge (void)
r_emitted = 1;
}
void
R_RenderFace (msurface_t *fa, int clipflags)
{
@ -504,6 +504,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
surface_p++;
}
void
R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
{
@ -603,6 +604,7 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
surface_p++;
}
void
R_RenderPoly (msurface_t *fa, int clipflags)
{
@ -769,6 +771,7 @@ R_RenderPoly (msurface_t *fa, int clipflags)
D_DrawPoly ();
}
void
R_ZDrawSubmodelPolys (model_t *pmodel)
{

View file

@ -38,11 +38,12 @@
/*
FIXME
the complex cases add new polys on most lines,
so dont optimize for keeping them the same have multiple free span lists to
try to get better coherence ? low depth complexity-- 1 to 3 or so this
breaks spans at every edge, even hidden ones (bad)
have a sentinal at both ends ?
the complex cases add new polys on most lines, so dont optimize for
keeping them the same have multiple free span lists to try to get better
coherence ? low depth complexity-- 1 to 3 or so this breaks spans at every
edge, even hidden ones (bad)
have a sentinal at both ends?
*/
edge_t *auxedges;
@ -51,9 +52,9 @@ edge_t *r_edges, *edge_p, *edge_max;
surf_t *surfaces, *surface_p, *surf_max;
/*
surfaces are generated in back to front order by the bsp, so if a surf
pointer is greater than another one, it should be drawn in front
surfaces[1] is the background, and is used as the active surface stack
surfaces are generated in back to front order by the bsp, so if a surf
pointer is greater than another one, it should be drawn in front
surfaces[1] is the background, and is used as the active surface stack
*/
edge_t *newedges[MAXHEIGHT];
@ -78,17 +79,11 @@ edge_t edge_sentinel;
float fv;
void
R_GenerateSpans (void);
void
R_GenerateSpansBackward (void);
void
R_LeadingEdge (edge_t *edge);
void
R_LeadingEdgeBackwards (edge_t *edge);
void
R_TrailingEdge (surf_t *surf, edge_t *edge);
void R_GenerateSpans (void);
void R_GenerateSpansBackward (void);
void R_LeadingEdge (edge_t *edge);
void R_LeadingEdgeBackwards (edge_t *edge);
void R_TrailingEdge (surf_t *surf, edge_t *edge);
void
@ -136,17 +131,9 @@ R_BeginEdgeFrame (void)
surfaces[1].flags = SURF_DRAWBACKGROUND;
// put the background behind everything in the world
/*
if (r_draworder->int_val) {
pdrawfunc = R_GenerateSpansBackward;
surfaces[1].key = 0;
r_currentkey = 1;
} else {
*/
pdrawfunc = R_GenerateSpans;
surfaces[1].key = 0x7FFFFFFF;
r_currentkey = 0;
// }
pdrawfunc = R_GenerateSpans;
surfaces[1].key = 0x7FFFFFFF;
r_currentkey = 0;
// FIXME: set with memset
for (v = r_refdef.vrect.y; v < r_refdef.vrectbottom; v++) {
@ -438,7 +425,7 @@ R_LeadingEdge (edge_t *edge)
if (surf->key == surf2->key) {
// if it's two surfaces on the same plane, the already active
// one is in front, so keep going unless it's abmodel
// one is in front, so keep going unless it's a bmodel
if (!surf->insubmodel)
goto continue_search;
@ -612,8 +599,7 @@ R_ScanEdges (void)
// for the next scan
if (span_p > max_span_p) {
VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if
// going slow
S_ExtraUpdate (); // don't let sound get messed up if going slow
VID_LockBuffer ();
if (r_drawculledpolys)

View file

@ -207,8 +207,6 @@ R_Init (void)
r_refdef.xOrigin = XCENTERING;
r_refdef.yOrigin = YCENTERING;
R_InitParticles ();
D_Init ();
}

View file

@ -40,8 +40,6 @@
#include "compat.h"
#include "r_local.h"
qboolean allowskybox; // whether or not to allow skyboxes --KB
void
R_CheckVariables (void)
@ -56,13 +54,13 @@ R_CheckVariables (void)
void
Show (void)
{
vrect_t vr;
vr.x = vr.y = 0;
vr.width = vid.width;
vr.height = vid.height;
vr.pnext = NULL;
VID_Update (&vr);
vrect_t vr;
vr.x = vr.y = 0;
vr.width = vid.width;
vr.height = vid.height;
vr.pnext = NULL;
VID_Update (&vr);
}
/*
@ -76,7 +74,7 @@ R_TimeRefresh_f (void)
int i;
float start, stop, time;
int startangle;
vrect_t vr;
vrect_t vr;
startangle = r_refdef.viewangles[1];
@ -252,7 +250,6 @@ R_SetupFrame (void)
float w, h;
// don't allow cheats in multiplayer
// Cvar_SetValue (r_draworder, 0);
Cvar_SetValue (r_ambient, 0);
Cvar_SetValue (r_drawflat, 0);

View file

@ -33,21 +33,16 @@
#include <stdlib.h>
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/cvar.h"
#include "QF/qargs.h"
#include "QF/vfs.h"
#include "QF/render.h"
#include "QF/vfs.h"
#include "QF/render.h"
#include "compat.h"
#include "r_cvar.h"
#include "r_dynamic.h"
#include "r_local.h"
#define MAX_PARTICLES 2048 // default max # of particles at one
// time
#define ABSOLUTE_MIN_PARTICLES 512 // no fewer than this no matter what's
// on the command line
int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
int ramp3[8] = { 0x6d, 0x6b, 6, 5, 4, 3 };
@ -59,7 +54,6 @@ int r_numparticles;
vec3_t r_pright, r_pup, r_ppn;
/*
R_MaxParticlesCheck
@ -95,24 +89,6 @@ R_Particles_Init_Cvars (void)
"Maximum amount of particles to display. No maximum, minimum is 1.");
}
void
R_InitParticles (void)
{
int i;
i = COM_CheckParm ("-particles");
if (i) {
r_numparticles = (int) (atoi (com_argv[i + 1]));
if (r_numparticles < ABSOLUTE_MIN_PARTICLES)
r_numparticles = ABSOLUTE_MIN_PARTICLES;
} else {
r_numparticles = MAX_PARTICLES;
}
particles = (particle_t *)
Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles");
}
void
R_ClearParticles (void)
@ -127,6 +103,7 @@ R_ClearParticles (void)
particles[r_numparticles - 1].next = NULL;
}
void
R_ReadPointFile_f (void)
{
@ -176,6 +153,7 @@ R_ReadPointFile_f (void)
Con_Printf ("%i points read\n", c);
}
void
R_RunSpikeEffect (vec3_t pos, particle_effect_t type)
{
@ -192,11 +170,12 @@ R_RunSpikeEffect (vec3_t pos, particle_effect_t type)
case PE_SUPERSPIKE:
R_RunParticleEffect (pos, 0, 20);
break;
default: // FIXME: this right?
default:
break;
}
}
void
R_RunPuffEffect (vec3_t pos, particle_effect_t type, byte cnt)
{
@ -213,11 +192,12 @@ R_RunPuffEffect (vec3_t pos, particle_effect_t type, byte cnt)
case PE_LIGHTNINGBLOOD:
R_RunParticleEffect (pos, 225, 50);
break;
default: // FIXME: this right?
default:
break;
}
}
void
R_ParticleExplosion (vec3_t org)
{
@ -254,6 +234,7 @@ R_ParticleExplosion (vec3_t org)
}
}
void
R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
{
@ -283,6 +264,7 @@ R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
}
}
void
R_BlobExplosion (vec3_t org)
{
@ -320,6 +302,7 @@ R_BlobExplosion (vec3_t org)
}
}
void
R_RunParticleEffect (vec3_t org, int color, int count)
{
@ -355,6 +338,7 @@ R_RunParticleEffect (vec3_t org, int color, int count)
}
}
void
R_LavaSplash (vec3_t org)
{
@ -394,6 +378,7 @@ R_LavaSplash (vec3_t org)
}
}
void
R_TeleportSplash (vec3_t org)
{
@ -433,6 +418,7 @@ R_TeleportSplash (vec3_t org)
}
}
void
R_RocketTrail (int type, entity_t *ent)
{
@ -515,6 +501,7 @@ R_RocketTrail (int type, entity_t *ent)
}
}
void
R_DrawParticles (void)
{
@ -605,11 +592,11 @@ R_DrawParticles (void)
case pt_grav:
p->vel[2] -= grav;
break;
default: // FIXME: is this right?
default:
Con_DPrintf ("unhandled particle type %d\n", p->type);
break;
}
}
}
D_EndParticles ();
}

View file

@ -82,9 +82,11 @@ R_InitSky (texture_t *mt)
src = (byte *) mt + mt->offsets[0];
for (i = 0; i < 128; i++)
for (j = 0; j < 128; j++)
for (i = 0; i < 128; i++) {
for (j = 0; j < 128; j++) {
newsky[(i * 256) + j + 128] = src[i * 256 + j + 128];
}
}
for (i = 0; i < 128; i++) {
for (j = 0; j < 131; j++) {
@ -238,6 +240,7 @@ R_MakeSky (void)
r_skymade = 1;
}
void
R_SetSkyFrame (void)
{
@ -254,10 +257,10 @@ R_SetSkyFrame (void)
skytime = r_realtime - ((int) (r_realtime / temp) * temp);
r_skymade = 0;
}
/*
R_LoadSkys

View file

@ -64,6 +64,7 @@ R_RotateSprite (float beamlength)
VectorSubtract (modelorg, vec, modelorg);
}
/*
R_ClipSpriteFace
@ -81,7 +82,7 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
clipdist = pclipplane->dist;
pclipnormal = pclipplane->normal;
// calc dists
// calc dists
if (clip_current) {
in = clip_verts[1][0];
outstep = clip_verts[0][0];
@ -109,7 +110,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
if (dists[i] >= 0) {
memcpy (outstep, instep, sizeof (vec5_t));
outstep += sizeof (vec5_t) / sizeof (float);
outcount++;
}
@ -138,6 +138,7 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
return outcount;
}
void
R_SetupAndDrawSprite (void)
{
@ -231,6 +232,7 @@ R_SetupAndDrawSprite (void)
D_DrawSprite ();
}
mspriteframe_t *
R_GetSpriteframe (msprite_t *psprite)
{
@ -257,8 +259,7 @@ R_GetSpriteframe (msprite_t *psprite)
time = r_realtime + currententity->syncbase;
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval
// values
// are positive, so we don't have to worry about division by 0
// values are positive, so we don't have to worry about division by 0
targettime = time - ((int) (time / fullinterval)) * fullinterval;
for (i = 0; i < (numframes - 1); i++) {
@ -272,6 +273,7 @@ R_GetSpriteframe (msprite_t *psprite)
return pspriteframe;
}
void
R_DrawSprite (void)
{
@ -291,7 +293,7 @@ R_DrawSprite (void)
if (psprite->type == SPR_FACING_UPRIGHT) {
// generate the sprite's axes, with vup straight up in worldspace, and
// r_spritedesc.vright perpendicular to modelorg.
// This will not work if the view direction is very close to straight
// 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 vectors and starts to approach an undefined state, so we
// don't draw if the two vectors are less than 1 degree apart
@ -309,15 +311,14 @@ R_DrawSprite (void)
r_spritedesc.vup[1] = 0;
r_spritedesc.vup[2] = 1;
r_spritedesc.vright[0] = tvec[1];
// CrossProduct(r_spritedesc.vup, -modelorg, r_spritedesc.vright)
//CrossProduct(r_spritedesc.vup, -modelorg, r_spritedesc.vright)
r_spritedesc.vright[1] = -tvec[0];
r_spritedesc.vright[2] = 0;
VectorNormalize (r_spritedesc.vright);
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
r_spritedesc.vpn[2] = 0;
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup,
// r_spritedesc.vpn)
//CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
} else if (psprite->type == SPR_VP_PARALLEL) {
// generate the sprite's axes, completely parallel to the viewplane.
// There are no problem situations, because the sprite is always in the
@ -344,15 +345,14 @@ R_DrawSprite (void)
r_spritedesc.vup[1] = 0;
r_spritedesc.vup[2] = 1;
r_spritedesc.vright[0] = vpn[1];
// CrossProduct (r_spritedesc.vup, vpn,
//CrossProduct (r_spritedesc.vup, vpn,
r_spritedesc.vright[1] = -vpn[0]; // r_spritedesc.vright)
r_spritedesc.vright[2] = 0;
VectorNormalize (r_spritedesc.vright);
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
r_spritedesc.vpn[2] = 0;
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup,
// r_spritedesc.vpn)
//CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
} else if (psprite->type == SPR_ORIENTED) {
// generate the sprite's axes, according to the sprite's world
// orientation

View file

@ -183,8 +183,7 @@ R_BuildLightMap (void)
// add all the lightmaps
if (lightmap)
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
maps++) {
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) {
scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
for (i = 0; i < size; i++)
blocklights[i] += lightmap[i] * scale;
@ -218,7 +217,7 @@ R_BuildLightMap (void)
Returns the proper texture for a given time and base texture
*/
texture_t *
texture_t *
R_TextureAnimation (texture_t *base)
{
int relative;
@ -249,7 +248,7 @@ R_TextureAnimation (texture_t *base)
void
R_DrawSurface (void)
{
unsigned char *basetptr;
byte *basetptr;
int smax, tmax, twidth;
int u;
int soffset, basetoffset, texwidth;
@ -267,8 +266,8 @@ R_DrawSurface (void)
r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip];
// the fractional light values should range from 0 to (VID_GRADES - 1) << 16
// from a source range of 0 - 255
// the fractional light values should range from 0 to
// (VID_GRADES - 1) << 16 from a source range of 0 - 255
texwidth = mt->width >> r_drawsurf.surfmip;

View file

@ -31,10 +31,10 @@
#endif
#ifdef HAVE_STRING_H
#include <string.h>
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
# include <strings.h>
#endif
#include "QF/model.h"
@ -176,9 +176,11 @@ Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin)
{
}
void
Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin)
{
}
void
@ -186,6 +188,7 @@ Skin_Init_Translation (void)
{
}
void
Skin_Process (skin_t *skin, struct tex_s *tex)
{