示例#1
0
/*
================
idDeclParticle::RebuildTextSource
================
*/
bool idDeclParticle::RebuildTextSource()
{
	idFile_Memory f;
	
	f.WriteFloatString( "\n\n/*\n"
						"\tGenerated by the Particle Editor.\n"
						"\tTo use the particle editor, launch the game and type 'editParticles' on the console.\n"
						"*/\n" );
						
	f.WriteFloatString( "particle %s {\n", GetName() );
	
	if( depthHack )
	{
		f.WriteFloatString( "\tdepthHack\t%f\n", depthHack );
	}
	
	for( int i = 0; i < stages.Num(); i++ )
	{
		WriteStage( &f, stages[i] );
	}
	
	f.WriteFloatString( "}" );
	
	SetText( f.GetDataPtr() );
	
	return true;
}
示例#2
0
/**
* Writes the internal dictionary data to the standard format.
*/
const char*	MaterialDoc::GenerateSourceText() {

	idFile_Memory f;

	f.WriteFloatString("\n\n/*\n"
		"\tGenerated by the Material Editor.\n"
		"\tType 'materialeditor' at the console to launch the material editor.\n"
		"*/\n" );

	f.WriteFloatString("%s\n", name.c_str());
	f.WriteFloatString( "{\n" );
	WriteMaterialDef(-1, &f, MaterialDefManager::MATERIAL_DEF_MATERIAL, 1);

	for(int i = 0; i < editMaterial.stages.Num(); i++) {
		if(editMaterial.stages[i]->enabled) {
			WriteStage(i, &f);
		}
	}

	f.WriteFloatString( "}\n" );

	return f.GetDataPtr();

}