Пример #1
0
/*
====================
WriteOutputFile
====================
*/
void WriteOutputFile( void ) {
	int				i;
	uEntity_t		*entity;
	idStr			qpath;

	// write the file
	common->Printf( "----- WriteOutputFile -----\n" );

	sprintf( qpath, "%s." PROC_FILE_EXT, dmapGlobals.mapFileBase );

	common->Printf( "writing %s\n", qpath.c_str() );
	// _D3XP used fs_cdpath
	procFile = fileSystem->OpenFileWrite( qpath, "fs_basepath" );
	if ( !procFile ) {
		common->Error( "Error opening %s", qpath.c_str() );
	}

	procFile->WriteFloatString( "%s\n\n", PROC_FILE_ID );

	// write the entity models and information, writing entities first
	for ( i=dmapGlobals.num_entities - 1 ; i >= 0 ; i-- ) {
		entity = &dmapGlobals.uEntities[i];
	
		if ( !entity->primitives ) {
			continue;
		}

		WriteOutputEntity( i );
	}

	fileSystem->CloseFile( procFile );
}
Пример #2
0
/*
====================
WriteOutputFile
====================
*/
void WriteOutputFile( void )
{
    int				i;
    uEntity_t		*entity;
    idStr			qpath;

    // write the file
    common->Printf( "----- WriteOutputFile -----\n" );

    sprintf( qpath, "%s." PROC_FILE_EXT, dmapGlobals.mapFileBase );

    common->Printf( "writing %s\n", qpath.c_str() );
    // _D3XP used fs_cdpath
    procFile = fileSystem->OpenFileWrite( qpath, "fs_devpath" );
    if ( !procFile )
    {
        common->Error( "Error opening %s", qpath.c_str() );
    }

    procFile->WriteFloatString( "%s\n\n", PROC_FILE_ID );

    // write the entity models and information, writing entities first
    for ( i=dmapGlobals.num_entities - 1 ; i >= 0 ; i-- )
    {
        entity = &dmapGlobals.uEntities[i];

        if ( !entity->primitives )
        {
            continue;
        }

        WriteOutputEntity( i );
    }

    // write the shadow volumes
    for ( i = 0 ; i < dmapGlobals.mapLights.Num() ; i++ )
    {
        mapLight_t	*light = dmapGlobals.mapLights[i];
        if ( !light->shadowTris )
        {
            continue;
        }

        procFile->WriteFloatString( "shadowModel { /* name = */ \"_prelight_%s\"\n\n", light->name );
        WriteShadowTriangles( light->shadowTris );
        procFile->WriteFloatString( "}\n\n" );

        R_FreeStaticTriSurf( light->shadowTris );
        light->shadowTris = NULL;
    }

    fileSystem->CloseFile( procFile );
}