示例#1
0
文件: misc.cpp 项目: clbr/netradiant
void BuildMiniPrt(std::list<Str>* exclusionList)
{
	// yes, we could just use -fulldetail option, but, as SPOG said
	// it'd be faster without all the hint, donotenter etc textures and
	// doors, etc

	
	
	char buffer[128];
  const char *pn = GlobalRadiant().getMapsPath();

	strcpy( buffer, pn );
	strcat( buffer, "/ac_prt.map" );
	FILE* pFile = fopen(buffer, "w");

	// ahem, thx rr2
	if(!pFile)
		return;

  Scene_forEachEntity(EntityWriteMiniPrt(pFile, exclusionList));

	fclose(pFile);

	StartBSP();
}
示例#2
0
void BuildMiniPrt( list<Str>* exclusionList ) {
    // yes, we could just use -fulldetail option, but, as SPOG said
    // it'd be faster without all the hint, donotenter etc textures and
    // doors, etc

    DEntity world;

    char buffer[128];
    const char *pn = g_FuncTable.m_pfnReadProjectKey( "mapspath" );

    strcpy( buffer, pn );
    strcat( buffer, "/ac_prt.map" );
    FILE* pFile = fopen( buffer, "w" );

    // ahem, thx rr2
    if ( !pFile ) {
        return;
    }

    int count = g_FuncTable.m_pfnGetEntityCount();
    for ( int i = 0; i < count; i++ )
    {
        entity_t* ent = (entity_t*)g_FuncTable.m_pfnGetEntityHandle( i );

        epair_t* epl = *g_EntityTable.m_pfnGetEntityKeyValList( ent );

        epair_t* ep = epl;
        while ( ep )
        {
            if ( !strcmp( ep->key, "classname" ) ) {
                if ( !strcmp( ep->value, "worldspawn" ) ) {
                    world.LoadFromEntity( i, FALSE );
                    world.RemoveNonCheckBrushes( exclusionList, TRUE );
                    world.SaveToFile( pFile );
                }
                else if ( strstr( ep->value, "info_" ) ) {
                    world.ClearBrushes();
                    world.ClearEPairs();
                    world.LoadEPairList( epl );
                    world.SaveToFile( pFile );
                }
                break;
            }

            ep = ep->next;
        }
    }

    fclose( pFile );

    StartBSP();
}