more (believable:) whitespace

This commit is contained in:
Bill Currie 2002-08-26 15:05:23 +00:00
parent 84f04f158e
commit 5108c3c976
4 changed files with 33 additions and 18 deletions

View file

@ -84,14 +84,14 @@ CheckStack (leaf_t *leaf, threaddata_t *thread)
Source, pass, and target are an ordering of portals.
Generates seperating planes candidates by taking two points from source and
Generates seperating planes candidates by taking two points from source and
one point from pass, and clips target by them.
If target is totally clipped away, that portal can not be seen through.
Normal clip keeps target on the same side as pass, which is correct if the
order goes source, pass, target. If the order goes pass, source, target then
flipclip should be set.
order goes source, pass, target. If the order goes pass, source, target
then flipclip should be set.
*/
winding_t *
ClipToSeperators (winding_t *source, winding_t *pass, winding_t *target,
@ -279,11 +279,13 @@ RecursiveLeafFlow (int leafnum, threaddata_t *thread, pstack_t *prevstack)
stack.portal = p;
stack.next = NULL;
target = ClipWinding(p->winding, &thread->pstack_head.portalplane, false);
target = ClipWinding(p->winding, &thread->pstack_head.portalplane,
false);
if (!target)
continue;
if (!prevstack->pass) { // the second leaf can only be blocked if coplanar
if (!prevstack->pass) {
// the second leaf can only be blocked if coplanar
stack.source = prevstack->source;
stack.pass = target;
@ -381,8 +383,8 @@ PortalFlow (portal_t *p)
}
/*
This is a rough first-order aproximation that is used to trivially reject some
of the final calculations.
This is a rough first-order aproximation that is used to trivially reject
some of the final calculations.
*/
void
SimpleFlood (portal_t *srcportal, int leafnum)
@ -429,7 +431,8 @@ BasePortalVis (void)
winding = tp->winding;
for (k = 0; k < winding->numpoints; k++) {
d = DotProduct (winding->points[k], p->plane.normal) - p->plane.dist;
d = DotProduct (winding->points[k],
p->plane.normal) - p->plane.dist;
if (d > ON_EPSILON)
break;
}
@ -438,7 +441,8 @@ BasePortalVis (void)
winding = p->winding;
for (k = 0; k < winding->numpoints; k++) {
d = DotProduct (winding->points[k], tp->plane.normal) - tp->plane.dist;
d = DotProduct (winding->points[k],
tp->plane.normal) - tp->plane.dist;
if (d < -ON_EPSILON)
break;
}

View file

@ -5,7 +5,7 @@
Copyright (C) 2002 Colin Thompson
This program is free software; you can redistribute it and/or
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

View file

@ -225,8 +225,11 @@ CopyWinding (winding_t *winding)
/*
ClipWinding
Clips the winding to the plane, returning the new winding on the positive side
Clips the winding to the plane, returning the new winding on the positive
side
Frees the input winding.
If keepon is true, an exactly on-plane winding will be saved, otherwise
it will be clipped away.
*/
@ -509,7 +512,8 @@ CalcPortalVis (void)
if (pthread_attr_setstacksize (&attrib, 0x100000) == -1)
fprintf (stderr, "pthread_attr_setstacksize failed");
for (i = 0; i < numthreads; i++) {
if (pthread_create (&work_threads[i], attrib, LeafThread, (pthread_addr_t) i) == -1)
if (pthread_create (&work_threads[i], attrib, LeafThread,
(pthread_addr_t) i) == -1)
fprintf (stderr, "pthread_create failed");
}
@ -526,7 +530,8 @@ CalcPortalVis (void)
#endif
if (options.verbosity >= 0) {
printf ("portalcheck: %i portaltest: %i portalpass: %i\n", c_portalcheck, c_portaltest, c_portalpass);
printf ("portalcheck: %i portaltest: %i portalpass: %i\n",
c_portalcheck, c_portaltest, c_portalpass);
printf ("c_vistest: %i c_mighttest: %i\n", c_vistest, c_mighttest);
}
@ -779,11 +784,13 @@ LoadPortals (char *name)
vismap_end = vismap + MAX_MAP_VISIBILITY;
for (i = 0, portal = portals; i < numportals; i++) {
if (fscanf (f, "%i %i %i ", &numpoints, &leafnums[0], &leafnums[1]) != 3)
if (fscanf (f, "%i %i %i ", &numpoints, &leafnums[0],
&leafnums[1]) != 3)
fprintf (stderr, "LoadPortals: reading portal %i", i);
if (numpoints > MAX_POINTS_ON_WINDING)
fprintf (stderr, "LoadPortals: portal %i has too many points", i);
if ((unsigned) leafnums[0] > portalleafs || (unsigned) leafnums[1] > portalleafs)
if ((unsigned) leafnums[0] > portalleafs
|| (unsigned) leafnums[1] > portalleafs)
fprintf (stderr, "LoadPortals: reading portal %i", i);
winding = portal->winding = NewWinding (numpoints);
@ -870,7 +877,8 @@ main (int argc, char **argv)
visdatasize = vismap_p - dvisdata;
if (options.verbosity >= 0)
printf ("visdatasize:%i compressed from %i\n", visdatasize, originalvismapsize);
printf ("visdatasize:%i compressed from %i\n", visdatasize,
originalvismapsize);
CalcAmbientSounds ();

View file

@ -59,8 +59,11 @@ static const char rcsid[] =
#include "vis.h"
/*
Some textures (sky, water, slime, lava) are considered ambient sound emiters.
Find an aproximate distance to the nearest emiter of each class for each leaf.
Some textures (sky, water, slime, lava) are considered ambient sound
emiters.
Find an aproximate distance to the nearest emiter of each class for each
leaf.
*/
void