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; 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--) {

View file

@ -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;
} }

View file

@ -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) {

View file

@ -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];
@ -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;

View file

@ -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];

View file

@ -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;

View file

@ -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

View file

@ -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"
@ -57,6 +51,7 @@ R_LineGraph (int x, int y, int *h_vals, int count)
// 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;
while (count--) {
h = *h_vals++; h = *h_vals++;
if (h == 10000) if (h == 10000)
@ -66,7 +61,7 @@ R_LineGraph (int x, int y, int *h_vals, int count)
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;
@ -81,7 +76,8 @@ R_LineGraph (int x, int y, int *h_vals, int count)
break; break;
case 2: case 2:
{ {
short *dest = (short *) vid.buffer + (vid.rowbytes >> 1) * y + x; short *dest = (short *) vid.buffer +
(vid.rowbytes >> 1) * y + x;
color = d_8to16table[color]; color = d_8to16table[color];
for (i = 0; i < h; i++, dest -= vid.rowbytes) for (i = 0; i < h; i++, dest -= vid.rowbytes)
*dest = color; *dest = color;
@ -89,13 +85,16 @@ R_LineGraph (int x, int y, int *h_vals, int count)
break; break;
case 4: case 4:
{ {
int *dest = (int *) vid.buffer + (vid.rowbytes >> 2) * y + x; int *dest = (int *) vid.buffer +
(vid.rowbytes >> 2) * y + x;
color = d_8to24table[color]; color = d_8to24table[color];
for (i = 0; i < h; i++, dest -= (vid.rowbytes >> 1)) for (i = 0; i < h; i++, dest -= (vid.rowbytes >> 1))
*dest = color; *dest = color;
} }
break; break;
default: default:
Sys_Error("R_LineGraph: unsupported r_pixbytes %i\n", r_pixbytes); 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; 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)
{ {

View file

@ -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)
{ {

View file

@ -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
@ -211,9 +208,9 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
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)
{ {

View file

@ -38,10 +38,11 @@
/* /*
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?
*/ */
@ -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
/*
if (r_draworder->int_val) {
pdrawfunc = R_GenerateSpansBackward;
surfaces[1].key = 0;
r_currentkey = 1;
} else {
*/
pdrawfunc = R_GenerateSpans; pdrawfunc = R_GenerateSpans;
surfaces[1].key = 0x7FFFFFFF; surfaces[1].key = 0x7FFFFFFF;
r_currentkey = 0; 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++) {
@ -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)

View file

@ -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 ();
} }

View file

@ -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)
@ -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);

View file

@ -43,11 +43,6 @@
#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 ();
} }

View file

@ -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

View file

@ -64,6 +64,7 @@ R_RotateSprite (float beamlength)
VectorSubtract (modelorg, vec, modelorg); VectorSubtract (modelorg, vec, modelorg);
} }
/* /*
R_ClipSpriteFace R_ClipSpriteFace
@ -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)
{ {
@ -316,8 +318,7 @@ R_DrawSprite (void)
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
@ -351,8 +352,7 @@ R_DrawSprite (void)
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

View file

@ -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;
@ -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;

View file

@ -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)
{ {