mirror of
https://github.com/Garux/netradiant-custom.git
synced 2026-09-28 00:00:03 +02:00
replace drawSurfRef_t
This commit is contained in:
@@ -971,13 +971,6 @@ struct mapDrawSurface_t : public mapDrawSurface_t_params
|
||||
};
|
||||
|
||||
|
||||
struct drawSurfRef_t
|
||||
{
|
||||
drawSurfRef_t *nextRef;
|
||||
int outputNum;
|
||||
};
|
||||
|
||||
|
||||
struct epair_t
|
||||
{
|
||||
CopiedString key, value;
|
||||
@@ -1072,7 +1065,7 @@ struct node_t
|
||||
int cluster; /* for portalfile writing */
|
||||
int area; /* for areaportals */
|
||||
brushlist_t brushlist; /* fragments of all brushes in this leaf */
|
||||
drawSurfRef_t *drawSurfReferences;
|
||||
std::vector<int> drawSurfReferences; /* int outputNum of bspDrawSurface_t*/
|
||||
|
||||
int occupied; /* 1 or greater can reach entity */
|
||||
const entity_t *occupant; /* for leak file testing */
|
||||
|
||||
@@ -1455,28 +1455,19 @@ void ClipSidesIntoTree( entity_t& e, const tree_t& tree ){
|
||||
*/
|
||||
|
||||
static int AddReferenceToLeaf( mapDrawSurface_t& ds, node_t *node ){
|
||||
drawSurfRef_t *dsr;
|
||||
const int numBSPDrawSurfaces = bspDrawSurfaces.size();
|
||||
|
||||
|
||||
/* dummy check */
|
||||
if ( node->planenum != PLANENUM_LEAF || node->opaque ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const int numBSPDrawSurfaces = bspDrawSurfaces.size();
|
||||
|
||||
/* try to find an existing reference */
|
||||
for ( dsr = node->drawSurfReferences; dsr; dsr = dsr->nextRef )
|
||||
{
|
||||
if ( dsr->outputNum == numBSPDrawSurfaces ) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if( std::ranges::find( node->drawSurfReferences, numBSPDrawSurfaces ) != node->drawSurfReferences.cend() )
|
||||
return 0;
|
||||
|
||||
/* add a new reference */
|
||||
dsr = safe_malloc( sizeof( *dsr ) );
|
||||
dsr->outputNum = numBSPDrawSurfaces;
|
||||
dsr->nextRef = node->drawSurfReferences;
|
||||
node->drawSurfReferences = dsr;
|
||||
node->drawSurfReferences.push_back( numBSPDrawSurfaces );
|
||||
|
||||
/* ydnar: sky/skybox surfaces */
|
||||
if ( node->skybox ) {
|
||||
|
||||
@@ -142,10 +142,8 @@ static void EmitLeaf( node_t *node ){
|
||||
|
||||
/* add the drawSurfRef_t drawsurfs */
|
||||
leaf.firstBSPLeafSurface = bspLeafSurfaces.size();
|
||||
for ( const drawSurfRef_t *dsr = node->drawSurfReferences; dsr; dsr = dsr->nextRef )
|
||||
{
|
||||
bspLeafSurfaces.push_back( dsr->outputNum );
|
||||
}
|
||||
|
||||
bspLeafSurfaces.insert( bspLeafSurfaces.cend(), node->drawSurfReferences.cbegin(), node->drawSurfReferences.cend() );
|
||||
|
||||
leaf.numBSPLeafSurfaces = bspLeafSurfaces.size() - leaf.firstBSPLeafSurface;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user