mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
gratuitous_diff--
This commit is contained in:
parent
baaa452345
commit
11489550ba
22 changed files with 183 additions and 196 deletions
|
@ -48,7 +48,7 @@ R_LineGraph (int x, int y, int *h_vals, int count)
|
||||||
int h, i, s, color;
|
int h, i, s, color;
|
||||||
byte *dest;
|
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;
|
s = r_graphheight->int_val;
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
|
|
|
@ -318,7 +318,7 @@ R_AliasClipTriangle (mtriangle_t *ptri)
|
||||||
r_affinetridesc.ptriangles = &mtri;
|
r_affinetridesc.ptriangles = &mtri;
|
||||||
r_affinetridesc.pfinalverts = fv[pingpong];
|
r_affinetridesc.pfinalverts = fv[pingpong];
|
||||||
|
|
||||||
// FIXME: do all at once as trifan?
|
// FIXME: do all at once as trifan?
|
||||||
mtri.vertindex[0] = 0;
|
mtri.vertindex[0] = 0;
|
||||||
for (i = 1; i < k - 1; i++) {
|
for (i = 1; i < k - 1; i++) {
|
||||||
mtri.vertindex[1] = i;
|
mtri.vertindex[1] = i;
|
||||||
|
|
|
@ -378,7 +378,6 @@ R_AliasSetUpTransform (int trivial_accept)
|
||||||
aliastransform[1][i] *= aliasyscale *
|
aliastransform[1][i] *= aliasyscale *
|
||||||
(1.0 / ((float) 0x8000 * 0x10000));
|
(1.0 / ((float) 0x8000 * 0x10000));
|
||||||
aliastransform[2][i] *= 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);
|
temp += (int) (r_shadelight * lightcos);
|
||||||
|
|
||||||
// clamp; because we limited the minimum ambient and shading
|
// clamp; because we limited the minimum ambient and shading
|
||||||
// light, we
|
// light, we don't have to clamp low light, just bright
|
||||||
// don't have to clamp low light, just bright
|
|
||||||
if (temp < 0)
|
if (temp < 0)
|
||||||
temp = 0;
|
temp = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,7 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
||||||
// horizontal edge is less than epsilon above a scan, and numeric error
|
// 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
|
// causes it to incorrectly extend to the scan, and the extension of the
|
||||||
// line goes off the edge of the screen
|
// 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)
|
if (edge->u < r_refdef.vrect_x_adj_shift20)
|
||||||
edge->u = r_refdef.vrect_x_adj_shift20;
|
edge->u = r_refdef.vrect_x_adj_shift20;
|
||||||
if (edge->u > r_refdef.vrectright_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
|
// if there was a clip off the left edge, add that edge too
|
||||||
// FIXME: faster to do in screen space?
|
// FIXME: faster to do in screen space?
|
||||||
// FIXME: share clipped edges?
|
// FIXME: share clipped edges?
|
||||||
if (makeleftedge) {
|
if (makeleftedge) {
|
||||||
r_pedge = &tedge;
|
r_pedge = &tedge;
|
||||||
r_lastvertvalid = false;
|
r_lastvertvalid = false;
|
||||||
|
@ -555,8 +555,8 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
||||||
r_nearzi = 0;
|
r_nearzi = 0;
|
||||||
r_nearzionly = false;
|
r_nearzionly = false;
|
||||||
makeleftedge = makerightedge = false;
|
makeleftedge = makerightedge = false;
|
||||||
// FIXME: keep clipped bmodel edges in clockwise order so last vertex caching
|
// FIXME: keep clipped bmodel edges in clockwise order so last vertex
|
||||||
// can be used?
|
// caching can be used?
|
||||||
r_lastvertvalid = false;
|
r_lastvertvalid = false;
|
||||||
|
|
||||||
for (; pedges; pedges = pedges->pnext) {
|
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
|
// if there was a clip off the left edge, add that edge too
|
||||||
// FIXME: faster to do in screen space?
|
// FIXME: faster to do in screen space?
|
||||||
// FIXME: share clipped edges?
|
// FIXME: share clipped edges?
|
||||||
if (makeleftedge) {
|
if (makeleftedge) {
|
||||||
r_pedge = &tedge;
|
r_pedge = &tedge;
|
||||||
R_ClipEdge (&r_leftexit, &r_leftenter, pclip->next);
|
R_ClipEdge (&r_leftexit, &r_leftenter, pclip->next);
|
||||||
|
@ -628,8 +628,8 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
||||||
int vertpage, newverts, newpage, lastvert;
|
int vertpage, newverts, newpage, lastvert;
|
||||||
qboolean visible;
|
qboolean visible;
|
||||||
|
|
||||||
// FIXME: clean this up and make it faster
|
// FIXME: clean this up and make it faster
|
||||||
// FIXME: guard against running out of vertices
|
// FIXME: guard against running out of vertices
|
||||||
|
|
||||||
s_axis = t_axis = 0; // keep compiler happy
|
s_axis = t_axis = 0; // keep compiler happy
|
||||||
|
|
||||||
|
@ -644,7 +644,7 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
||||||
}
|
}
|
||||||
|
|
||||||
// reconstruct the polygon
|
// 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;
|
pedges = currententity->model->edges;
|
||||||
lnumverts = fa->numedges;
|
lnumverts = fa->numedges;
|
||||||
vertpage = 0;
|
vertpage = 0;
|
||||||
|
@ -800,7 +800,7 @@ R_ZDrawSubmodelPolys (model_t *pmodel)
|
||||||
// draw the polygon
|
// draw the polygon
|
||||||
if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
|
if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
|
||||||
(!(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);
|
R_RenderPoly (psurf, 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
coherence ? low depth complexity-- 1 to 3 or so this breaks spans at every
|
coherence ? low depth complexity-- 1 to 3 or so this breaks spans at every
|
||||||
edge, even hidden ones (bad)
|
edge, even hidden ones (bad)
|
||||||
|
|
||||||
have a sentinal at both ends
|
have a sentinal at both ends?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
edge_t *auxedges;
|
edge_t *auxedges;
|
||||||
|
@ -51,9 +51,11 @@ edge_t *r_edges, *edge_p, *edge_max;
|
||||||
|
|
||||||
surf_t *surfaces, *surface_p, *surf_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 are generated in back to front order by the bsp, so if a surf
|
||||||
// surfaces[1] is the background, and is used as the active surface stack
|
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 *newedges[MAXHEIGHT];
|
||||||
edge_t *removeedges[MAXHEIGHT];
|
edge_t *removeedges[MAXHEIGHT];
|
||||||
|
@ -161,7 +163,7 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
|
||||||
|
|
||||||
do {
|
do {
|
||||||
next_edge = edgestoadd->next;
|
next_edge = edgestoadd->next;
|
||||||
edgesearch:
|
edgesearch:
|
||||||
if (edgelist->u >= edgestoadd->u)
|
if (edgelist->u >= edgestoadd->u)
|
||||||
goto addedge;
|
goto addedge;
|
||||||
edgelist = edgelist->next;
|
edgelist = edgelist->next;
|
||||||
|
@ -177,7 +179,7 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
|
||||||
goto edgesearch;
|
goto edgesearch;
|
||||||
|
|
||||||
// insert edgestoadd before edgelist
|
// insert edgestoadd before edgelist
|
||||||
addedge:
|
addedge:
|
||||||
edgestoadd->next = edgelist;
|
edgestoadd->next = edgelist;
|
||||||
edgestoadd->prev = edgelist->prev;
|
edgestoadd->prev = edgelist->prev;
|
||||||
edgelist->prev->next = edgestoadd;
|
edgelist->prev->next = edgestoadd;
|
||||||
|
@ -326,7 +328,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
||||||
|
|
||||||
goto gotposition;
|
goto gotposition;
|
||||||
|
|
||||||
newtop:
|
newtop:
|
||||||
// emit a span (obscures current top)
|
// emit a span (obscures current top)
|
||||||
iu = edge->u >> 20;
|
iu = edge->u >> 20;
|
||||||
|
|
||||||
|
@ -341,7 +343,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
||||||
// set last_u on the new span
|
// set last_u on the new span
|
||||||
surf->last_u = iu;
|
surf->last_u = iu;
|
||||||
|
|
||||||
gotposition:
|
gotposition:
|
||||||
// insert before surf2
|
// insert before surf2
|
||||||
surf->next = surf2;
|
surf->next = surf2;
|
||||||
surf->prev = surf2->prev;
|
surf->prev = surf2->prev;
|
||||||
|
@ -438,9 +440,8 @@ R_LeadingEdge (edge_t *edge)
|
||||||
} while (surf->key > surf2->key);
|
} while (surf->key > surf2->key);
|
||||||
|
|
||||||
if (surf->key == surf2->key) {
|
if (surf->key == surf2->key) {
|
||||||
// if it's two surfaces on the same plane, the one that's
|
// if it's two surfaces on the same plane, the already active
|
||||||
// already active is in front, so keep going unless it's a
|
// one is in front, so keep going unless it's a bmodel
|
||||||
// bmodel
|
|
||||||
if (!surf->insubmodel)
|
if (!surf->insubmodel)
|
||||||
goto continue_search;
|
goto continue_search;
|
||||||
|
|
||||||
|
@ -574,7 +575,7 @@ R_ScanEdges (void)
|
||||||
span_p = basespan_p;
|
span_p = basespan_p;
|
||||||
|
|
||||||
// clear active edges to just the background edges around the whole screen
|
// 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 = r_refdef.vrect.x << 20;
|
||||||
edge_head_u_shift20 = edge_head.u >> 20;
|
edge_head_u_shift20 = edge_head.u >> 20;
|
||||||
edge_head.u_step = 0;
|
edge_head.u_step = 0;
|
||||||
|
@ -596,7 +597,7 @@ R_ScanEdges (void)
|
||||||
edge_aftertail.next = &edge_sentinel;
|
edge_aftertail.next = &edge_sentinel;
|
||||||
edge_aftertail.prev = &edge_tail;
|
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.u = 2000 << 24; // make sure nothing sorts past this
|
||||||
edge_sentinel.prev = &edge_aftertail;
|
edge_sentinel.prev = &edge_aftertail;
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ R_SetUpFrustumIndexes (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: do just once at start
|
// FIXME: do just once at start
|
||||||
pfrustum_indexes[i] = pindex;
|
pfrustum_indexes[i] = pindex;
|
||||||
pindex += 6;
|
pindex += 6;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ R_ReadPointFile_f (void)
|
||||||
particle_t *p;
|
particle_t *p;
|
||||||
char name[MAX_OSPATH];
|
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);
|
COM_FOpenFile (name, &f);
|
||||||
if (!f) {
|
if (!f) {
|
||||||
|
@ -512,7 +512,7 @@ R_DrawParticles (void)
|
||||||
float time1;
|
float time1;
|
||||||
float dvel;
|
float dvel;
|
||||||
float frametime;
|
float frametime;
|
||||||
|
|
||||||
D_StartParticles ();
|
D_StartParticles ();
|
||||||
|
|
||||||
VectorScale (vright, xscaleshrink, r_pright);
|
VectorScale (vright, xscaleshrink, r_pright);
|
||||||
|
|
|
@ -289,7 +289,7 @@ R_DrawSprite (void)
|
||||||
sprite_width = r_spritedesc.pspriteframe->width;
|
sprite_width = r_spritedesc.pspriteframe->width;
|
||||||
sprite_height = r_spritedesc.pspriteframe->height;
|
sprite_height = r_spritedesc.pspriteframe->height;
|
||||||
|
|
||||||
// TODO: make this caller-selectable
|
// TODO: make this caller-selectable
|
||||||
if (psprite->type == SPR_FACING_UPRIGHT) {
|
if (psprite->type == SPR_FACING_UPRIGHT) {
|
||||||
// generate the sprite's axes, with vup straight up in worldspace, and
|
// generate the sprite's axes, with vup straight up in worldspace, and
|
||||||
// r_spritedesc.vright perpendicular to modelorg.
|
// r_spritedesc.vright perpendicular to modelorg.
|
||||||
|
@ -311,9 +311,8 @@ R_DrawSprite (void)
|
||||||
r_spritedesc.vup[1] = 0;
|
r_spritedesc.vup[1] = 0;
|
||||||
r_spritedesc.vup[2] = 1;
|
r_spritedesc.vup[2] = 1;
|
||||||
r_spritedesc.vright[0] = tvec[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[1] = -tvec[0];
|
||||||
//r_spritedesc.vright)
|
|
||||||
r_spritedesc.vright[2] = 0;
|
r_spritedesc.vright[2] = 0;
|
||||||
VectorNormalize (r_spritedesc.vright);
|
VectorNormalize (r_spritedesc.vright);
|
||||||
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
||||||
|
|
|
@ -186,7 +186,7 @@ R_BuildLightMap (void)
|
||||||
texture_t *
|
texture_t *
|
||||||
R_TextureAnimation (texture_t *base)
|
R_TextureAnimation (texture_t *base)
|
||||||
{
|
{
|
||||||
int reletive;
|
int relative;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
if (currententity->frame) {
|
if (currententity->frame) {
|
||||||
|
@ -197,10 +197,10 @@ R_TextureAnimation (texture_t *base)
|
||||||
if (!base->anim_total)
|
if (!base->anim_total)
|
||||||
return base;
|
return base;
|
||||||
|
|
||||||
reletive = (int) (r_realtime * 10) % base->anim_total;
|
relative = (int) (r_realtime * 10) % base->anim_total;
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
while (base->anim_min > reletive || base->anim_max <= reletive) {
|
while (base->anim_min > relative || base->anim_max <= relative) {
|
||||||
base = base->anim_next;
|
base = base->anim_next;
|
||||||
if (!base)
|
if (!base)
|
||||||
Sys_Error ("R_TextureAnimation: broken cycle");
|
Sys_Error ("R_TextureAnimation: broken cycle");
|
||||||
|
@ -214,12 +214,12 @@ R_TextureAnimation (texture_t *base)
|
||||||
void
|
void
|
||||||
R_DrawSurface (void)
|
R_DrawSurface (void)
|
||||||
{
|
{
|
||||||
unsigned char *basetptr;
|
byte *basetptr;
|
||||||
int smax, tmax, twidth;
|
int smax, tmax, twidth;
|
||||||
int u;
|
int u;
|
||||||
int soffset, basetoffset, texwidth;
|
int soffset, basetoffset, texwidth;
|
||||||
int horzblockstep;
|
int horzblockstep;
|
||||||
unsigned char *pcolumndest;
|
byte *pcolumndest;
|
||||||
void (*pblockdrawer) (void);
|
void (*pblockdrawer) (void);
|
||||||
texture_t *mt;
|
texture_t *mt;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -29,12 +29,6 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_STRING_H
|
|
||||||
# include "string.h"
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STRINGS_H
|
|
||||||
# include "strings.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/draw.h"
|
#include "QF/draw.h"
|
||||||
|
@ -45,57 +39,62 @@
|
||||||
#include "r_cvar.h"
|
#include "r_cvar.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
R_LineGraph
|
R_LineGraph
|
||||||
|
|
||||||
Only called by R_DisplayTime
|
Only called by R_DisplayTime
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
R_LineGraph (int x, int y, int *h_vals, int count)
|
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;
|
s = r_graphheight->int_val;
|
||||||
|
|
||||||
h = *h_vals++;
|
while (count--) {
|
||||||
|
h = *h_vals++;
|
||||||
|
|
||||||
if (h == 10000)
|
if (h == 10000)
|
||||||
color = 0x6f; // yellow
|
color = 0x6f; // yellow
|
||||||
else if (h == 9999)
|
else if (h == 9999)
|
||||||
color = 0x4f; // red
|
color = 0x4f; // red
|
||||||
else if (h == 9998)
|
else if (h == 9998)
|
||||||
color = 0xd0; // blue
|
color = 0xd0; // blue
|
||||||
else
|
else
|
||||||
color = 0xfe; // white // LordHavoc: was pink (0xff)
|
color = 0xff; // pink
|
||||||
|
|
||||||
if (h > s)
|
if (h > s)
|
||||||
h = s;
|
h = s;
|
||||||
|
|
||||||
switch(r_pixbytes) {
|
switch(r_pixbytes) {
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
byte *dest = (byte *) vid.buffer + vid.rowbytes * y + x;
|
byte *dest = (byte *) vid.buffer + vid.rowbytes * y + x;
|
||||||
for (i = 0; i < h; i++, dest -= vid.rowbytes * 2)
|
for (i = 0; i < h; i++, dest -= vid.rowbytes * 2)
|
||||||
*dest = color;
|
*dest = color;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
short *dest = (short *) vid.buffer + (vid.rowbytes >> 1) * y + x;
|
short *dest = (short *) vid.buffer +
|
||||||
color = d_8to16table[color];
|
(vid.rowbytes >> 1) * y + x;
|
||||||
for (i = 0; i < h; i++, dest -= vid.rowbytes)
|
color = d_8to16table[color];
|
||||||
*dest = color;
|
for (i = 0; i < h; i++, dest -= vid.rowbytes)
|
||||||
}
|
*dest = color;
|
||||||
break;
|
}
|
||||||
case 4:
|
break;
|
||||||
{
|
case 4:
|
||||||
int *dest = (int *) vid.buffer + (vid.rowbytes >> 2) * y + x;
|
{
|
||||||
color = d_8to24table[color];
|
int *dest = (int *) vid.buffer +
|
||||||
for (i = 0; i < h; i++, dest -= (vid.rowbytes >> 1))
|
(vid.rowbytes >> 2) * y + x;
|
||||||
*dest = color;
|
color = d_8to24table[color];
|
||||||
}
|
for (i = 0; i < h; i++, dest -= (vid.rowbytes >> 1))
|
||||||
break;
|
*dest = color;
|
||||||
default:
|
}
|
||||||
Sys_Error("R_LineGraph: unsupported r_pixbytes %i\n", r_pixbytes);
|
break;
|
||||||
|
default:
|
||||||
|
Sys_Error("R_LineGraph: unsupported r_pixbytes %i\n",
|
||||||
|
r_pixbytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,7 @@ R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
||||||
out->flags |= ALIAS_BOTTOM_CLIP;
|
out->flags |= ALIAS_BOTTOM_CLIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
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
|
void
|
||||||
R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
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
|
void
|
||||||
R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
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
|
void
|
||||||
R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
|
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
|
int
|
||||||
R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
|
R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
|
||||||
void (*clip) (finalvert_t *pfv0, finalvert_t *pfv1,
|
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;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_AliasClipTriangle (mtriangle_t *ptri)
|
R_AliasClipTriangle (mtriangle_t *ptri)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "d_ifacea.h"
|
#include "d_ifacea.h"
|
||||||
#include "r_local.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
|
// avoid the need for inner-loop light
|
||||||
// clamping
|
// clamping
|
||||||
|
|
||||||
|
@ -111,7 +111,6 @@ R_AliasCheckBBox (void)
|
||||||
int minz;
|
int minz;
|
||||||
|
|
||||||
// expand, rotate, and translate points into worldspace
|
// expand, rotate, and translate points into worldspace
|
||||||
|
|
||||||
currententity->trivial_accept = 0;
|
currententity->trivial_accept = 0;
|
||||||
pmodel = currententity->model;
|
pmodel = currententity->model;
|
||||||
pahdr = Mod_Extradata (pmodel);
|
pahdr = Mod_Extradata (pmodel);
|
||||||
|
@ -241,6 +240,7 @@ R_AliasCheckBBox (void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_AliasTransformVector (vec3_t in, vec3_t out)
|
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];
|
out[2] = DotProduct (in, aliastransform[2]) + aliastransform[2][3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
R_AliasPreparePoints
|
R_AliasPreparePoints
|
||||||
|
|
||||||
|
@ -311,6 +312,7 @@ R_AliasPreparePoints (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_AliasSetUpTransform (int trivial_accept)
|
R_AliasSetUpTransform (int trivial_accept)
|
||||||
{
|
{
|
||||||
|
@ -380,6 +382,7 @@ R_AliasSetUpTransform (int trivial_accept)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
||||||
trivertx_t *pverts, stvert_t *pstverts)
|
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;
|
fv->v[1] = (av->fv[1] * aliasyscale * zi) + aliasycenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_AliasPrepareUnclippedPoints (void)
|
R_AliasPrepareUnclippedPoints (void)
|
||||||
{
|
{
|
||||||
|
@ -496,6 +500,7 @@ R_AliasPrepareUnclippedPoints (void)
|
||||||
D_PolysetDraw ();
|
D_PolysetDraw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_AliasSetupSkin (void)
|
R_AliasSetupSkin (void)
|
||||||
{
|
{
|
||||||
|
@ -584,6 +589,7 @@ R_AliasSetupLighting (alight_t *plighting)
|
||||||
r_plightvec[2] = DotProduct (plighting->plightvec, alias_up);
|
r_plightvec[2] = DotProduct (plighting->plightvec, alias_up);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
R_AliasSetupFrame
|
R_AliasSetupFrame
|
||||||
|
|
||||||
|
@ -630,6 +636,7 @@ R_AliasSetupFrame (void)
|
||||||
((byte *) paliashdr + paliasgroup->frames[i].frame);
|
((byte *) paliashdr + paliasgroup->frames[i].frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_AliasDrawModel (alight_t *plighting)
|
R_AliasDrawModel (alight_t *plighting)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,8 +48,6 @@ zpointdesc_t r_zpointdesc;
|
||||||
|
|
||||||
polydesc_t r_polydesc;
|
polydesc_t r_polydesc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
clipplane_t *entity_clipplanes;
|
clipplane_t *entity_clipplanes;
|
||||||
clipplane_t view_clipplanes[4];
|
clipplane_t view_clipplanes[4];
|
||||||
clipplane_t world_clipplanes[16];
|
clipplane_t world_clipplanes[16];
|
||||||
|
@ -165,7 +163,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
||||||
|
|
||||||
r_ceilv1 = (int) ceil (r_v1);
|
r_ceilv1 = (int) ceil (r_v1);
|
||||||
|
|
||||||
|
|
||||||
// create the edge
|
// create the edge
|
||||||
if (ceilv0 == r_ceilv1) {
|
if (ceilv0 == r_ceilv1) {
|
||||||
// we cache unclipped horizontal edges as fully clipped
|
// 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_step = u_step * 0x100000;
|
||||||
edge->u = u * 0x100000 + 0xFFFFF;
|
edge->u = u * 0x100000 + 0xFFFFF;
|
||||||
|
|
||||||
// we need to do this to avoid stepping off the edges if a very nearly
|
// 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
|
// horizontal edge is less than epsilon above a scan, and numeric error
|
||||||
// it to incorrectly extend to the scan, and the extension of the line goes off
|
// causes it to incorrectly extend to the scan, and the extension of the
|
||||||
// the edge of the screen
|
// 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)
|
if (edge->u < r_refdef.vrect_x_adj_shift20)
|
||||||
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;
|
removeedges[v2] = edge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
|
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);
|
R_EmitEdge (pv0, pv1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_EmitCachedEdge (void)
|
R_EmitCachedEdge (void)
|
||||||
{
|
{
|
||||||
|
@ -339,6 +338,7 @@ R_EmitCachedEdge (void)
|
||||||
r_emitted = 1;
|
r_emitted = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_RenderFace (msurface_t *fa, int clipflags)
|
R_RenderFace (msurface_t *fa, int clipflags)
|
||||||
{
|
{
|
||||||
|
@ -504,6 +504,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
|
||||||
surface_p++;
|
surface_p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
||||||
{
|
{
|
||||||
|
@ -603,6 +604,7 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
||||||
surface_p++;
|
surface_p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_RenderPoly (msurface_t *fa, int clipflags)
|
R_RenderPoly (msurface_t *fa, int clipflags)
|
||||||
{
|
{
|
||||||
|
@ -769,6 +771,7 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
||||||
D_DrawPoly ();
|
D_DrawPoly ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_ZDrawSubmodelPolys (model_t *pmodel)
|
R_ZDrawSubmodelPolys (model_t *pmodel)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,11 +38,12 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FIXME
|
FIXME
|
||||||
the complex cases add new polys on most lines,
|
the complex cases add new polys on most lines, so dont optimize for
|
||||||
so dont optimize for keeping them the same have multiple free span lists to
|
keeping them the same have multiple free span lists to try to get better
|
||||||
try to get better coherence ? low depth complexity-- 1 to 3 or so this
|
coherence ? low depth complexity-- 1 to 3 or so this breaks spans at every
|
||||||
breaks spans at every edge, even hidden ones (bad)
|
edge, even hidden ones (bad)
|
||||||
have a sentinal at both ends ?
|
|
||||||
|
have a sentinal at both ends?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
edge_t *auxedges;
|
edge_t *auxedges;
|
||||||
|
@ -51,9 +52,9 @@ edge_t *r_edges, *edge_p, *edge_max;
|
||||||
surf_t *surfaces, *surface_p, *surf_max;
|
surf_t *surfaces, *surface_p, *surf_max;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
surfaces are generated in back to front order by the bsp, so if a surf
|
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
|
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[1] is the background, and is used as the active surface stack
|
||||||
*/
|
*/
|
||||||
|
|
||||||
edge_t *newedges[MAXHEIGHT];
|
edge_t *newedges[MAXHEIGHT];
|
||||||
|
@ -78,17 +79,11 @@ edge_t edge_sentinel;
|
||||||
|
|
||||||
float fv;
|
float fv;
|
||||||
|
|
||||||
void
|
void R_GenerateSpans (void);
|
||||||
R_GenerateSpans (void);
|
void R_GenerateSpansBackward (void);
|
||||||
void
|
void R_LeadingEdge (edge_t *edge);
|
||||||
R_GenerateSpansBackward (void);
|
void R_LeadingEdgeBackwards (edge_t *edge);
|
||||||
|
void R_TrailingEdge (surf_t *surf, edge_t *edge);
|
||||||
void
|
|
||||||
R_LeadingEdge (edge_t *edge);
|
|
||||||
void
|
|
||||||
R_LeadingEdgeBackwards (edge_t *edge);
|
|
||||||
void
|
|
||||||
R_TrailingEdge (surf_t *surf, edge_t *edge);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -136,17 +131,9 @@ R_BeginEdgeFrame (void)
|
||||||
surfaces[1].flags = SURF_DRAWBACKGROUND;
|
surfaces[1].flags = SURF_DRAWBACKGROUND;
|
||||||
|
|
||||||
// put the background behind everything in the world
|
// put the background behind everything in the world
|
||||||
/*
|
pdrawfunc = R_GenerateSpans;
|
||||||
if (r_draworder->int_val) {
|
surfaces[1].key = 0x7FFFFFFF;
|
||||||
pdrawfunc = R_GenerateSpansBackward;
|
r_currentkey = 0;
|
||||||
surfaces[1].key = 0;
|
|
||||||
r_currentkey = 1;
|
|
||||||
} else {
|
|
||||||
*/
|
|
||||||
pdrawfunc = R_GenerateSpans;
|
|
||||||
surfaces[1].key = 0x7FFFFFFF;
|
|
||||||
r_currentkey = 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// FIXME: set with memset
|
// FIXME: set with memset
|
||||||
for (v = r_refdef.vrect.y; v < r_refdef.vrectbottom; v++) {
|
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 (surf->key == surf2->key) {
|
||||||
// if it's two surfaces on the same plane, the already active
|
// 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)
|
if (!surf->insubmodel)
|
||||||
goto continue_search;
|
goto continue_search;
|
||||||
|
|
||||||
|
@ -612,8 +599,7 @@ R_ScanEdges (void)
|
||||||
// for the next scan
|
// for the next scan
|
||||||
if (span_p > max_span_p) {
|
if (span_p > max_span_p) {
|
||||||
VID_UnlockBuffer ();
|
VID_UnlockBuffer ();
|
||||||
S_ExtraUpdate (); // don't let sound get messed up if
|
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||||
// going slow
|
|
||||||
VID_LockBuffer ();
|
VID_LockBuffer ();
|
||||||
|
|
||||||
if (r_drawculledpolys)
|
if (r_drawculledpolys)
|
||||||
|
|
|
@ -207,8 +207,6 @@ R_Init (void)
|
||||||
r_refdef.xOrigin = XCENTERING;
|
r_refdef.xOrigin = XCENTERING;
|
||||||
r_refdef.yOrigin = YCENTERING;
|
r_refdef.yOrigin = YCENTERING;
|
||||||
|
|
||||||
R_InitParticles ();
|
|
||||||
|
|
||||||
D_Init ();
|
D_Init ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,6 @@
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
|
|
||||||
qboolean allowskybox; // whether or not to allow skyboxes --KB
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_CheckVariables (void)
|
R_CheckVariables (void)
|
||||||
|
@ -56,13 +54,13 @@ R_CheckVariables (void)
|
||||||
void
|
void
|
||||||
Show (void)
|
Show (void)
|
||||||
{
|
{
|
||||||
vrect_t vr;
|
vrect_t vr;
|
||||||
|
|
||||||
vr.x = vr.y = 0;
|
vr.x = vr.y = 0;
|
||||||
vr.width = vid.width;
|
vr.width = vid.width;
|
||||||
vr.height = vid.height;
|
vr.height = vid.height;
|
||||||
vr.pnext = NULL;
|
vr.pnext = NULL;
|
||||||
VID_Update (&vr);
|
VID_Update (&vr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -76,7 +74,7 @@ R_TimeRefresh_f (void)
|
||||||
int i;
|
int i;
|
||||||
float start, stop, time;
|
float start, stop, time;
|
||||||
int startangle;
|
int startangle;
|
||||||
vrect_t vr;
|
vrect_t vr;
|
||||||
|
|
||||||
startangle = r_refdef.viewangles[1];
|
startangle = r_refdef.viewangles[1];
|
||||||
|
|
||||||
|
@ -252,7 +250,6 @@ R_SetupFrame (void)
|
||||||
float w, h;
|
float w, h;
|
||||||
|
|
||||||
// don't allow cheats in multiplayer
|
// don't allow cheats in multiplayer
|
||||||
// Cvar_SetValue (r_draworder, 0);
|
|
||||||
Cvar_SetValue (r_ambient, 0);
|
Cvar_SetValue (r_ambient, 0);
|
||||||
Cvar_SetValue (r_drawflat, 0);
|
Cvar_SetValue (r_drawflat, 0);
|
||||||
|
|
||||||
|
|
|
@ -33,21 +33,16 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "QF/console.h"
|
#include "QF/console.h"
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/vfs.h"
|
#include "QF/vfs.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "r_cvar.h"
|
#include "r_cvar.h"
|
||||||
#include "r_dynamic.h"
|
#include "r_dynamic.h"
|
||||||
#include "r_local.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 ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
|
||||||
int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
|
int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
|
||||||
int ramp3[8] = { 0x6d, 0x6b, 6, 5, 4, 3 };
|
int ramp3[8] = { 0x6d, 0x6b, 6, 5, 4, 3 };
|
||||||
|
@ -59,7 +54,6 @@ int r_numparticles;
|
||||||
|
|
||||||
vec3_t r_pright, r_pup, r_ppn;
|
vec3_t r_pright, r_pup, r_ppn;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
R_MaxParticlesCheck
|
R_MaxParticlesCheck
|
||||||
|
|
||||||
|
@ -95,24 +89,6 @@ R_Particles_Init_Cvars (void)
|
||||||
"Maximum amount of particles to display. No maximum, minimum is 1.");
|
"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
|
void
|
||||||
R_ClearParticles (void)
|
R_ClearParticles (void)
|
||||||
|
@ -127,6 +103,7 @@ R_ClearParticles (void)
|
||||||
particles[r_numparticles - 1].next = NULL;
|
particles[r_numparticles - 1].next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_ReadPointFile_f (void)
|
R_ReadPointFile_f (void)
|
||||||
{
|
{
|
||||||
|
@ -176,6 +153,7 @@ R_ReadPointFile_f (void)
|
||||||
Con_Printf ("%i points read\n", c);
|
Con_Printf ("%i points read\n", c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_RunSpikeEffect (vec3_t pos, particle_effect_t type)
|
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:
|
case PE_SUPERSPIKE:
|
||||||
R_RunParticleEffect (pos, 0, 20);
|
R_RunParticleEffect (pos, 0, 20);
|
||||||
break;
|
break;
|
||||||
default: // FIXME: this right?
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_RunPuffEffect (vec3_t pos, particle_effect_t type, byte cnt)
|
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:
|
case PE_LIGHTNINGBLOOD:
|
||||||
R_RunParticleEffect (pos, 225, 50);
|
R_RunParticleEffect (pos, 225, 50);
|
||||||
break;
|
break;
|
||||||
default: // FIXME: this right?
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_ParticleExplosion (vec3_t org)
|
R_ParticleExplosion (vec3_t org)
|
||||||
{
|
{
|
||||||
|
@ -254,6 +234,7 @@ R_ParticleExplosion (vec3_t org)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
|
R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
|
||||||
{
|
{
|
||||||
|
@ -283,6 +264,7 @@ R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_BlobExplosion (vec3_t org)
|
R_BlobExplosion (vec3_t org)
|
||||||
{
|
{
|
||||||
|
@ -320,6 +302,7 @@ R_BlobExplosion (vec3_t org)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_RunParticleEffect (vec3_t org, int color, int count)
|
R_RunParticleEffect (vec3_t org, int color, int count)
|
||||||
{
|
{
|
||||||
|
@ -355,6 +338,7 @@ R_RunParticleEffect (vec3_t org, int color, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_LavaSplash (vec3_t org)
|
R_LavaSplash (vec3_t org)
|
||||||
{
|
{
|
||||||
|
@ -394,6 +378,7 @@ R_LavaSplash (vec3_t org)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_TeleportSplash (vec3_t org)
|
R_TeleportSplash (vec3_t org)
|
||||||
{
|
{
|
||||||
|
@ -433,6 +418,7 @@ R_TeleportSplash (vec3_t org)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_RocketTrail (int type, entity_t *ent)
|
R_RocketTrail (int type, entity_t *ent)
|
||||||
{
|
{
|
||||||
|
@ -515,6 +501,7 @@ R_RocketTrail (int type, entity_t *ent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_DrawParticles (void)
|
R_DrawParticles (void)
|
||||||
{
|
{
|
||||||
|
@ -605,11 +592,11 @@ R_DrawParticles (void)
|
||||||
case pt_grav:
|
case pt_grav:
|
||||||
p->vel[2] -= grav;
|
p->vel[2] -= grav;
|
||||||
break;
|
break;
|
||||||
default: // FIXME: is this right?
|
default:
|
||||||
|
Con_DPrintf ("unhandled particle type %d\n", p->type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
D_EndParticles ();
|
D_EndParticles ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,9 +82,11 @@ R_InitSky (texture_t *mt)
|
||||||
|
|
||||||
src = (byte *) mt + mt->offsets[0];
|
src = (byte *) mt + mt->offsets[0];
|
||||||
|
|
||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++) {
|
||||||
for (j = 0; j < 128; j++)
|
for (j = 0; j < 128; j++) {
|
||||||
newsky[(i * 256) + j + 128] = src[i * 256 + j + 128];
|
newsky[(i * 256) + j + 128] = src[i * 256 + j + 128];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
for (j = 0; j < 131; j++) {
|
for (j = 0; j < 131; j++) {
|
||||||
|
@ -238,6 +240,7 @@ R_MakeSky (void)
|
||||||
r_skymade = 1;
|
r_skymade = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_SetSkyFrame (void)
|
R_SetSkyFrame (void)
|
||||||
{
|
{
|
||||||
|
@ -254,10 +257,10 @@ R_SetSkyFrame (void)
|
||||||
|
|
||||||
skytime = r_realtime - ((int) (r_realtime / temp) * temp);
|
skytime = r_realtime - ((int) (r_realtime / temp) * temp);
|
||||||
|
|
||||||
|
|
||||||
r_skymade = 0;
|
r_skymade = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
R_LoadSkys
|
R_LoadSkys
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ R_RotateSprite (float beamlength)
|
||||||
VectorSubtract (modelorg, vec, modelorg);
|
VectorSubtract (modelorg, vec, modelorg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
R_ClipSpriteFace
|
R_ClipSpriteFace
|
||||||
|
|
||||||
|
@ -81,7 +82,7 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
||||||
clipdist = pclipplane->dist;
|
clipdist = pclipplane->dist;
|
||||||
pclipnormal = pclipplane->normal;
|
pclipnormal = pclipplane->normal;
|
||||||
|
|
||||||
// calc dists
|
// calc dists
|
||||||
if (clip_current) {
|
if (clip_current) {
|
||||||
in = clip_verts[1][0];
|
in = clip_verts[1][0];
|
||||||
outstep = clip_verts[0][0];
|
outstep = clip_verts[0][0];
|
||||||
|
@ -109,7 +110,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
||||||
if (dists[i] >= 0) {
|
if (dists[i] >= 0) {
|
||||||
memcpy (outstep, instep, sizeof (vec5_t));
|
memcpy (outstep, instep, sizeof (vec5_t));
|
||||||
outstep += sizeof (vec5_t) / sizeof (float);
|
outstep += sizeof (vec5_t) / sizeof (float);
|
||||||
|
|
||||||
outcount++;
|
outcount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,6 +138,7 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
||||||
return outcount;
|
return outcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_SetupAndDrawSprite (void)
|
R_SetupAndDrawSprite (void)
|
||||||
{
|
{
|
||||||
|
@ -231,6 +232,7 @@ R_SetupAndDrawSprite (void)
|
||||||
D_DrawSprite ();
|
D_DrawSprite ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mspriteframe_t *
|
mspriteframe_t *
|
||||||
R_GetSpriteframe (msprite_t *psprite)
|
R_GetSpriteframe (msprite_t *psprite)
|
||||||
{
|
{
|
||||||
|
@ -257,8 +259,7 @@ R_GetSpriteframe (msprite_t *psprite)
|
||||||
time = r_realtime + currententity->syncbase;
|
time = r_realtime + currententity->syncbase;
|
||||||
|
|
||||||
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval
|
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval
|
||||||
// values
|
// values are positive, so we don't have to worry about division by 0
|
||||||
// are positive, so we don't have to worry about division by 0
|
|
||||||
targettime = time - ((int) (time / fullinterval)) * fullinterval;
|
targettime = time - ((int) (time / fullinterval)) * fullinterval;
|
||||||
|
|
||||||
for (i = 0; i < (numframes - 1); i++) {
|
for (i = 0; i < (numframes - 1); i++) {
|
||||||
|
@ -272,6 +273,7 @@ R_GetSpriteframe (msprite_t *psprite)
|
||||||
return pspriteframe;
|
return pspriteframe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_DrawSprite (void)
|
R_DrawSprite (void)
|
||||||
{
|
{
|
||||||
|
@ -291,7 +293,7 @@ R_DrawSprite (void)
|
||||||
if (psprite->type == SPR_FACING_UPRIGHT) {
|
if (psprite->type == SPR_FACING_UPRIGHT) {
|
||||||
// generate the sprite's axes, with vup straight up in worldspace, and
|
// generate the sprite's axes, with vup straight up in worldspace, and
|
||||||
// r_spritedesc.vright perpendicular to modelorg.
|
// 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
|
// up or down, because the cross product will be between two nearly
|
||||||
// parallel vectors and starts to approach an undefined state, so we
|
// parallel vectors and starts to approach an undefined state, so we
|
||||||
// don't draw if the two vectors are less than 1 degree apart
|
// 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[1] = 0;
|
||||||
r_spritedesc.vup[2] = 1;
|
r_spritedesc.vup[2] = 1;
|
||||||
r_spritedesc.vright[0] = tvec[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[1] = -tvec[0];
|
||||||
r_spritedesc.vright[2] = 0;
|
r_spritedesc.vright[2] = 0;
|
||||||
VectorNormalize (r_spritedesc.vright);
|
VectorNormalize (r_spritedesc.vright);
|
||||||
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
||||||
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
|
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
|
||||||
r_spritedesc.vpn[2] = 0;
|
r_spritedesc.vpn[2] = 0;
|
||||||
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup,
|
//CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
|
||||||
// r_spritedesc.vpn)
|
|
||||||
} else if (psprite->type == SPR_VP_PARALLEL) {
|
} else if (psprite->type == SPR_VP_PARALLEL) {
|
||||||
// generate the sprite's axes, completely parallel to the viewplane.
|
// generate the sprite's axes, completely parallel to the viewplane.
|
||||||
// There are no problem situations, because the sprite is always in the
|
// 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[1] = 0;
|
||||||
r_spritedesc.vup[2] = 1;
|
r_spritedesc.vup[2] = 1;
|
||||||
r_spritedesc.vright[0] = vpn[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[1] = -vpn[0]; // r_spritedesc.vright)
|
||||||
r_spritedesc.vright[2] = 0;
|
r_spritedesc.vright[2] = 0;
|
||||||
VectorNormalize (r_spritedesc.vright);
|
VectorNormalize (r_spritedesc.vright);
|
||||||
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
||||||
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
|
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
|
||||||
r_spritedesc.vpn[2] = 0;
|
r_spritedesc.vpn[2] = 0;
|
||||||
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup,
|
//CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
|
||||||
// r_spritedesc.vpn)
|
|
||||||
} else if (psprite->type == SPR_ORIENTED) {
|
} else if (psprite->type == SPR_ORIENTED) {
|
||||||
// generate the sprite's axes, according to the sprite's world
|
// generate the sprite's axes, according to the sprite's world
|
||||||
// orientation
|
// orientation
|
||||||
|
|
|
@ -183,8 +183,7 @@ R_BuildLightMap (void)
|
||||||
|
|
||||||
// add all the lightmaps
|
// add all the lightmaps
|
||||||
if (lightmap)
|
if (lightmap)
|
||||||
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
|
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) {
|
||||||
maps++) {
|
|
||||||
scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
|
scale = r_drawsurf.lightadj[maps]; // 8.8 fraction
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
blocklights[i] += lightmap[i] * scale;
|
blocklights[i] += lightmap[i] * scale;
|
||||||
|
@ -218,7 +217,7 @@ R_BuildLightMap (void)
|
||||||
|
|
||||||
Returns the proper texture for a given time and base texture
|
Returns the proper texture for a given time and base texture
|
||||||
*/
|
*/
|
||||||
texture_t *
|
texture_t *
|
||||||
R_TextureAnimation (texture_t *base)
|
R_TextureAnimation (texture_t *base)
|
||||||
{
|
{
|
||||||
int relative;
|
int relative;
|
||||||
|
@ -249,7 +248,7 @@ R_TextureAnimation (texture_t *base)
|
||||||
void
|
void
|
||||||
R_DrawSurface (void)
|
R_DrawSurface (void)
|
||||||
{
|
{
|
||||||
unsigned char *basetptr;
|
byte *basetptr;
|
||||||
int smax, tmax, twidth;
|
int smax, tmax, twidth;
|
||||||
int u;
|
int u;
|
||||||
int soffset, basetoffset, texwidth;
|
int soffset, basetoffset, texwidth;
|
||||||
|
@ -267,8 +266,8 @@ R_DrawSurface (void)
|
||||||
|
|
||||||
r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip];
|
r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip];
|
||||||
|
|
||||||
// the fractional light values should range from 0 to (VID_GRADES - 1) << 16
|
// the fractional light values should range from 0 to
|
||||||
// from a source range of 0 - 255
|
// (VID_GRADES - 1) << 16 from a source range of 0 - 255
|
||||||
|
|
||||||
texwidth = mt->width >> r_drawsurf.surfmip;
|
texwidth = mt->width >> r_drawsurf.surfmip;
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
# include <string.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "QF/model.h"
|
#include "QF/model.h"
|
||||||
|
@ -176,9 +176,11 @@ Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin)
|
Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -186,6 +188,7 @@ Skin_Init_Translation (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Skin_Process (skin_t *skin, struct tex_s *tex)
|
Skin_Process (skin_t *skin, struct tex_s *tex)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue