mono/MonoGame — pull request #3335 by mgarstenauer (2014-12-30 13:00:55+00:00)
Title: Fix for building external references

A few changes were required to build my existing XNA content.

`ContentProcessorContext.BuildAndLoadAsset` can be called with `processorName = null`. In this case XNA imports the asset, but does not process it. This is for example used in http://blogs.msdn.com/b/shawnhar/archive/2010/06/18/merging-animation-files.aspx.

`ContentProcessorContext.BuildAsset` does not yet generate automatic names, such as "AssetName_i". The name is currently hardcoded as "AssetName_0". But in our content project, we have multiple multiple assets with the same name. For example: a model "House.fbx" uses a material "House.drmat", which references a texture "House.tga". In this case MGCB should create "House.xnb", "House_0.xnb", "House_1.xnb".
A texture "House.tga" may be referenced by multiple materials. Sometimes "House.tga" needs to be processed multiple times with different settings. In this case multiple files need to be created ("House_1.xnb", House_2.xnb", "House_3.xnb"). When the "House.tga" is processed multiple times with the same settings, the file should be reused (create only "House_1.xnb").
I have added the necessary changes. All PipelineBuildEvents are now tracked in a dictionary. When a new asset is build, asset name and processor parameters are compared with the previous pipeline build events.

While working through the code I repeatedly got confused by "Dependencies" vs. "BuildAsset" vs. "BuildOutput" and how they relate to the XNA pipeline. I have added some code comments.

If you need more info, let me know. I have tested the new MGCB on a fairly large and complex content project.