minor tweaks
This commit is contained in:
parent
e8996d0857
commit
15b391cdb3
|
|
@ -481,7 +481,7 @@ brush_t *BrushFromBounds( const Vector3& mins, const Vector3& maxs ){
|
||||||
*/
|
*/
|
||||||
float BrushVolume( brush_t *brush ){
|
float BrushVolume( brush_t *brush ){
|
||||||
int i;
|
int i;
|
||||||
winding_t *w;
|
const winding_t *w;
|
||||||
Vector3 corner;
|
Vector3 corner;
|
||||||
float volume;
|
float volume;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3573,7 +3573,7 @@ void SetupEnvelopes( bool forGrid, bool fastFlag ){
|
||||||
/* delete the light */
|
/* delete the light */
|
||||||
numCulledLights++;
|
numCulledLights++;
|
||||||
*owner = light->next;
|
*owner = light->next;
|
||||||
free( light->w );
|
FreeWinding( light->w );
|
||||||
free( light );
|
free( light );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -573,10 +573,10 @@ void SetBrushContents( brush_t *b ){
|
||||||
|
|
||||||
void AddBrushBevels( void ){
|
void AddBrushBevels( void ){
|
||||||
int axis, dir;
|
int axis, dir;
|
||||||
int i, j, k, l, order;
|
int i, k, order;
|
||||||
side_t sidetemp;
|
side_t sidetemp;
|
||||||
side_t *s, *s2;
|
side_t *s, *s2;
|
||||||
winding_t *w, *w2;
|
const winding_t *w, *w2;
|
||||||
Plane3f plane;
|
Plane3f plane;
|
||||||
Vector3 vec, vec2;
|
Vector3 vec, vec2;
|
||||||
float d, minBack;
|
float d, minBack;
|
||||||
|
|
@ -645,7 +645,7 @@ void AddBrushBevels( void ){
|
||||||
s->contentFlags = buildBrush->sides[ 0 ].contentFlags;
|
s->contentFlags = buildBrush->sides[ 0 ].contentFlags;
|
||||||
/* handle bevel surfaceflags for topmost one only: assuming that only walkable ones are meaningful */
|
/* handle bevel surfaceflags for topmost one only: assuming that only walkable ones are meaningful */
|
||||||
if( axis == 2 && dir == 1 ){
|
if( axis == 2 && dir == 1 ){
|
||||||
for ( j = 0; j < buildBrush->numsides; j++ ) {
|
for ( int j = 0; j < buildBrush->numsides; j++ ) {
|
||||||
s2 = buildBrush->sides + j;
|
s2 = buildBrush->sides + j;
|
||||||
w = s2->winding;
|
w = s2->winding;
|
||||||
if ( !w ) {
|
if ( !w ) {
|
||||||
|
|
@ -686,7 +686,7 @@ void AddBrushBevels( void ){
|
||||||
if ( !w ) {
|
if ( !w ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for ( j = 0; j < w->size(); j++ ) {
|
for ( size_t j = 0; j < w->size(); j++ ) {
|
||||||
k = ( j + 1 ) % w->size();
|
k = ( j + 1 ) % w->size();
|
||||||
vec = ( *w )[j] - ( *w )[k];
|
vec = ( *w )[j] - ( *w )[k];
|
||||||
if ( VectorNormalize( vec ) < 0.5f ) {
|
if ( VectorNormalize( vec ) < 0.5f ) {
|
||||||
|
|
@ -734,15 +734,17 @@ void AddBrushBevels( void ){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
minBack = 0.0f;
|
minBack = 0.0f;
|
||||||
for ( l = 0; l < w2->size(); l++ ) {
|
bool point_in_front = false;
|
||||||
d = plane3_distance_to_point( plane, ( *w2 )[l] );
|
for ( const Vector3& point : *w2 ) {
|
||||||
|
d = plane3_distance_to_point( plane, point );
|
||||||
if ( d > 0.1f ) {
|
if ( d > 0.1f ) {
|
||||||
|
point_in_front = true;
|
||||||
break; // point in front
|
break; // point in front
|
||||||
}
|
}
|
||||||
value_minimize( minBack, d );
|
value_minimize( minBack, d );
|
||||||
}
|
}
|
||||||
// if some point was at the front
|
// if some point was at the front
|
||||||
if ( l != w2->size() ) {
|
if ( point_in_front ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ void FreePortal( portal_t *p ){
|
||||||
returns true if the portal has non-opaque leafs on both sides
|
returns true if the portal has non-opaque leafs on both sides
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool PortalPassable( portal_t *p ){
|
bool PortalPassable( const portal_t *p ){
|
||||||
/* is this to global outside leaf? */
|
/* is this to global outside leaf? */
|
||||||
if ( !p->onnode ) {
|
if ( !p->onnode ) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,6 @@ void WriteFloat( FILE *f, float v ){
|
||||||
|
|
||||||
void CountVisportals_r( node_t *node ){
|
void CountVisportals_r( node_t *node ){
|
||||||
int s;
|
int s;
|
||||||
portal_t *p;
|
|
||||||
winding_t *w;
|
|
||||||
|
|
||||||
// decision node
|
// decision node
|
||||||
if ( node->planenum != PLANENUM_LEAF ) {
|
if ( node->planenum != PLANENUM_LEAF ) {
|
||||||
|
|
@ -75,9 +73,9 @@ void CountVisportals_r( node_t *node ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( p = node->portals ; p ; p = p->next[s] )
|
for ( const portal_t *p = node->portals; p; p = p->next[s] )
|
||||||
{
|
{
|
||||||
w = p->winding;
|
const winding_t *w = p->winding;
|
||||||
s = ( p->nodes[1] == node );
|
s = ( p->nodes[1] == node );
|
||||||
if ( w && p->nodes[0] == node ) {
|
if ( w && p->nodes[0] == node ) {
|
||||||
if ( !PortalPassable( p ) ) {
|
if ( !PortalPassable( p ) ) {
|
||||||
|
|
@ -98,8 +96,6 @@ void CountVisportals_r( node_t *node ){
|
||||||
*/
|
*/
|
||||||
void WritePortalFile_r( node_t *node ){
|
void WritePortalFile_r( node_t *node ){
|
||||||
int s, flags;
|
int s, flags;
|
||||||
portal_t *p;
|
|
||||||
winding_t *w;
|
|
||||||
|
|
||||||
// decision node
|
// decision node
|
||||||
if ( node->planenum != PLANENUM_LEAF ) {
|
if ( node->planenum != PLANENUM_LEAF ) {
|
||||||
|
|
@ -112,9 +108,9 @@ void WritePortalFile_r( node_t *node ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( p = node->portals ; p ; p = p->next[s] )
|
for (const portal_t *p = node->portals; p; p = p->next[s] )
|
||||||
{
|
{
|
||||||
w = p->winding;
|
const winding_t *w = p->winding;
|
||||||
s = ( p->nodes[1] == node );
|
s = ( p->nodes[1] == node );
|
||||||
if ( w && p->nodes[0] == node ) {
|
if ( w && p->nodes[0] == node ) {
|
||||||
if ( !PortalPassable( p ) ) {
|
if ( !PortalPassable( p ) ) {
|
||||||
|
|
@ -168,8 +164,6 @@ void WritePortalFile_r( node_t *node ){
|
||||||
|
|
||||||
void CountSolidFaces_r( node_t *node ){
|
void CountSolidFaces_r( node_t *node ){
|
||||||
int s;
|
int s;
|
||||||
portal_t *p;
|
|
||||||
winding_t *w;
|
|
||||||
|
|
||||||
// decision node
|
// decision node
|
||||||
if ( node->planenum != PLANENUM_LEAF ) {
|
if ( node->planenum != PLANENUM_LEAF ) {
|
||||||
|
|
@ -182,9 +176,9 @@ void CountSolidFaces_r( node_t *node ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( p = node->portals ; p ; p = p->next[s] )
|
for ( const portal_t *p = node->portals; p; p = p->next[s] )
|
||||||
{
|
{
|
||||||
w = p->winding;
|
const winding_t *w = p->winding;
|
||||||
s = ( p->nodes[1] == node );
|
s = ( p->nodes[1] == node );
|
||||||
if ( w ) {
|
if ( w ) {
|
||||||
if ( PortalPassable( p ) ) {
|
if ( PortalPassable( p ) ) {
|
||||||
|
|
@ -207,8 +201,6 @@ void CountSolidFaces_r( node_t *node ){
|
||||||
*/
|
*/
|
||||||
void WriteFaceFile_r( node_t *node ){
|
void WriteFaceFile_r( node_t *node ){
|
||||||
int s;
|
int s;
|
||||||
portal_t *p;
|
|
||||||
winding_t *w;
|
|
||||||
|
|
||||||
// decision node
|
// decision node
|
||||||
if ( node->planenum != PLANENUM_LEAF ) {
|
if ( node->planenum != PLANENUM_LEAF ) {
|
||||||
|
|
@ -221,9 +213,9 @@ void WriteFaceFile_r( node_t *node ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( p = node->portals ; p ; p = p->next[s] )
|
for ( const portal_t *p = node->portals; p; p = p->next[s] )
|
||||||
{
|
{
|
||||||
w = p->winding;
|
const winding_t *w = p->winding;
|
||||||
s = ( p->nodes[1] == node );
|
s = ( p->nodes[1] == node );
|
||||||
if ( w ) {
|
if ( w ) {
|
||||||
if ( PortalPassable( p ) ) {
|
if ( PortalPassable( p ) ) {
|
||||||
|
|
|
||||||
|
|
@ -1610,7 +1610,7 @@ void MakeHeadnodePortals( tree_t *tree );
|
||||||
void MakeNodePortal( node_t *node );
|
void MakeNodePortal( node_t *node );
|
||||||
void SplitNodePortals( node_t *node );
|
void SplitNodePortals( node_t *node );
|
||||||
|
|
||||||
bool PortalPassable( portal_t *p );
|
bool PortalPassable( const portal_t *p );
|
||||||
|
|
||||||
enum class EFloodEntities
|
enum class EFloodEntities
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1473,7 +1473,7 @@ bool SideInBrush( side_t *side, brush_t *b ){
|
||||||
void CullSides( entity_t *e ){
|
void CullSides( entity_t *e ){
|
||||||
int numPoints;
|
int numPoints;
|
||||||
int i, j, k, l, first, second, dir;
|
int i, j, k, l, first, second, dir;
|
||||||
winding_t *w1, *w2;
|
const winding_t *w1, *w2;
|
||||||
brush_t *b1, *b2;
|
brush_t *b1, *b2;
|
||||||
side_t *side1, *side2;
|
side_t *side1, *side2;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user