From 35a52bb6347f1cf203ac2926f2d517c85beb1eed Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 16 May 2001 17:20:42 +0000 Subject: [PATCH] diff noise reductions + fix what looks to be a bug with surf flushing --- nq/source/sw_redge.c | 29 ++++++++++++++++------------- qw/source/sw_redge.c | 11 ++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/nq/source/sw_redge.c b/nq/source/sw_redge.c index 921cccd6b..d379f27f1 100644 --- a/nq/source/sw_redge.c +++ b/nq/source/sw_redge.c @@ -30,12 +30,15 @@ # include "config.h" #endif -#include "client.h" +#include "QF/sound.h" + +#include "client.h" //XXX goes with cl_entities +#include "d_ifacea.h" #include "r_local.h" #include "render.h" #if 0 -// FIXME +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 @@ -43,6 +46,7 @@ have a sentinal at both ends ? #endif + edge_t *auxedges; edge_t *r_edges, *edge_p, *edge_max; @@ -76,7 +80,6 @@ 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); @@ -123,7 +126,7 @@ R_BeginEdgeFrame (void) edge_max = &r_edges[r_numallocatededges]; surface_p = &surfaces[2]; // background is surface 1, - // surface 0 is a dummy + // surface 0 is a dummy surfaces[1].spans = NULL; // no background spans yet surfaces[1].flags = SURF_DRAWBACKGROUND; @@ -321,8 +324,8 @@ R_LeadingEdgeBackwards (edge_t *edge) if (!surf->insubmodel) goto continue_search; - // must be two bmodels in the same leaf; don't care which is really - // in front, because they'll never be farthest anyway + // must be two bmodels in the same leaf; don't care which is + // really in front, because they'll never be farthest anyway } goto gotposition; @@ -399,8 +402,9 @@ R_LeadingEdge (edge_t *edge) // it's adding a new surface in, so find the correct place surf = &surfaces[edge->surfs[1]]; - // don't start a span if this is an inverted span, with the end edge - // preceding the start edge (that is, we've already seen the end edge) + // don't start a span if this is an inverted span, with the end + // edge preceding the start edge (that is, we've already seen the + // end edge) if (++surf->spanstate == 1) { if (surf->insubmodel) r_bmodelactive++; @@ -442,8 +446,8 @@ R_LeadingEdge (edge_t *edge) 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 + // already active is in front, so keep going unless it's a + // bmodel if (!surf->insubmodel) goto continue_search; @@ -624,10 +628,9 @@ R_ScanEdges (void) // flush the span list if we can't be sure we have enough spans left // for the next scan - if (span_p >= max_span_p) { + 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) diff --git a/qw/source/sw_redge.c b/qw/source/sw_redge.c index 94b59eaef..44255c843 100644 --- a/qw/source/sw_redge.c +++ b/qw/source/sw_redge.c @@ -38,10 +38,10 @@ #if 0 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) + 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 ? #endif @@ -501,9 +501,6 @@ R_LeadingEdge (edge_t *edge) } -/* - R_GenerateSpans -*/ void R_GenerateSpans (void) {