Esempio n. 1
0
void ProcessBasePortalVis( int iThread, uint64 iPortal, MessageBuffer *pBuf )
{
	CTimeAdder adder( &g_CPUTime );

	BasePortalVis( iThread, iPortal );

	// Send my result to the master
	if ( pBuf )
	{
		portal_t * p = &portals[iPortal];
		pBuf->write( p->portalfront, portalbytes );
		pBuf->write( p->portalflood, portalbytes );
	}
}
Esempio n. 2
0
/*
==================
CalcVis
==================
*/
void CalcVis (void)
{
	int		i;
	
	BasePortalVis ();
	
	CalcPortalVis ();

//
// assemble the leaf vis lists by oring and compressing the portal lists
//
	for (i=0 ; i<portalleafs ; i++)
		LeafFlow (i);
		
	printf ("average leafs visible: %i\n", totalvis / portalleafs);
}
Esempio n. 3
0
static void
CalcVis (void)
{
	int         i;

	BasePortalVis ();
	CalcPortalVis ();

	// assemble the leaf vis lists by oring and compressing the portal lists
	for (i = 0; i < portalclusters; i++)
		ClusterFlow (i);

	for (i = 0; i < numrealleafs; i++) {
		bsp->leafs[i + 1].visofs = clusters[leafcluster[i]].visofs;
	}
	if (options.verbosity >= 0)
		printf ("average clusters visible: %i\n", totalvis / portalclusters);
}
Esempio n. 4
0
/*
==================
CalcVis
==================
*/
void CalcVis (void)
{
	int		i;
	
    // For each portal, populate portals->mightsee (containing the leafs it might see).
    // There may be false positive in the set but no false negative
	BasePortalVis ();
	
    // At this point mightsee has been populated, let the serious things begin.
    // Note that the next method takes advantage of Multi-processor machine via multithreading.
	CalcPortalVis ();

//
// assemble the leaf vis lists by oring and compressing the portal lists
//
	for (i=0 ; i<portalleafs ; i++)
		LeafFlow (i);
		
	printf ("average leafs visible: %i\n", totalvis / portalleafs);
}
Esempio n. 5
0
/*
  ==================
  CalcVis
  ==================
*/
void
CalcVis(const bsp2_t *bsp)
{
    int i;

    if (LoadVisState()) {
        logprint("Loaded previous state. Resuming progress...\n");
    } else {
        logprint("Calculating Base Vis:\n");
        BasePortalVis();
    }

    logprint("Calculating Full Vis:\n");
    CalcPortalVis(bsp);

//
// assemble the leaf vis lists by oring and compressing the portal lists
//
    if (portalleafs == portalleafs_real) {
        for (i = 0; i < portalleafs; i++)
            LeafFlow(i, &bsp->dleafs[i + 1]);
    } else {
        leafbits_t *buffer;

        logprint("Expanding clusters...\n");
        buffer = malloc(LeafbitsSize(portalleafs));
        for (i = 0; i < portalleafs; i++) {
            memset(buffer, 0, LeafbitsSize(portalleafs));
            ClusterFlow(i, buffer);
        }
        free(buffer);
        
        // Set pointers
        for (i = 0; i < portalleafs_real; i++) {
            bsp->dleafs[i + 1].visofs = leafs[clustermap[i]].visofs;
        }
    }

    logprint("average leafs visible: %i\n", totalvis / portalleafs_real);
}