CustomProcessorContext.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // CustomProcessorContext.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using Microsoft.Xna.Framework.Graphics;
  12. using Microsoft.Xna.Framework.Content.Pipeline;
  13. #endregion
  14. namespace CompileEffect
  15. {
  16. /// <summary>
  17. /// Custom context object for running Content Pipeline processors.
  18. /// </summary>
  19. class CustomProcessorContext : ContentProcessorContext
  20. {
  21. /// <summary>
  22. /// Constructor.
  23. /// </summary>
  24. public CustomProcessorContext(TargetPlatform targetPlatform, GraphicsProfile targetProfile, ContentBuildLogger logger)
  25. {
  26. this.targetPlatform = targetPlatform;
  27. this.targetProfile = targetProfile;
  28. this.logger = logger;
  29. }
  30. /// <summary>
  31. /// Gets the build target platform.
  32. /// </summary>
  33. public override TargetPlatform TargetPlatform
  34. {
  35. get { return targetPlatform; }
  36. }
  37. TargetPlatform targetPlatform;
  38. /// <summary>
  39. /// Gets the build target profile.
  40. /// </summary>
  41. public override GraphicsProfile TargetProfile
  42. {
  43. get { return targetProfile; }
  44. }
  45. GraphicsProfile targetProfile;
  46. /// <summary>
  47. /// Gets a logger for reporting content build messages and warnings.
  48. /// </summary>
  49. public override ContentBuildLogger Logger
  50. {
  51. get { return logger; }
  52. }
  53. ContentBuildLogger logger;
  54. /// <summary>
  55. /// Gets the current build configuration (Debug, Release, etc).
  56. /// </summary>
  57. public override string BuildConfiguration
  58. {
  59. get { return string.Empty; }
  60. }
  61. /// <summary>
  62. /// Gets the intermediate directory for the current content build.
  63. /// </summary>
  64. public override string IntermediateDirectory
  65. {
  66. get { return string.Empty; }
  67. }
  68. /// <summary>
  69. /// Gets the final output directory for the current content build.
  70. /// </summary>
  71. public override string OutputDirectory
  72. {
  73. get { return string.Empty; }
  74. }
  75. /// <summary>
  76. /// Gets the final output filename for the asset currently being built.
  77. /// </summary>
  78. public override string OutputFilename
  79. {
  80. get { return string.Empty; }
  81. }
  82. /// <summary>
  83. /// Dictionary can be used to pass custom parameter data into the processor.
  84. /// </summary>
  85. public override OpaqueDataDictionary Parameters
  86. {
  87. get { return parameters; }
  88. }
  89. OpaqueDataDictionary parameters = new OpaqueDataDictionary();
  90. /// <summary>
  91. /// Records any additional input files that were read by the processor.
  92. /// </summary>
  93. public override void AddDependency(string filename)
  94. {
  95. }
  96. /// <summary>
  97. /// Records any additional output files that were written by the processor.
  98. /// </summary>
  99. public override void AddOutputFile(string filename)
  100. {
  101. }
  102. /// <summary>
  103. /// Asks the Content Pipeline to call into a different processor,
  104. /// converting an object in memory to a different format.
  105. /// </summary>
  106. public override TOutput Convert<TInput, TOutput>(TInput input, string processorName, OpaqueDataDictionary processorParameters)
  107. {
  108. throw new NotImplementedException();
  109. }
  110. /// <summary>
  111. /// Asks the Content Pipeline to call into a different importer and processor,
  112. /// reading from a source asset file and returning an object in memory.
  113. /// </summary>
  114. public override TOutput BuildAndLoadAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName)
  115. {
  116. throw new NotImplementedException();
  117. }
  118. /// <summary>
  119. /// Asks the Content Pipeline to call into a different importer and processor, building
  120. /// a source asset file into .xnb format, and returning a reference to the output .xnb.
  121. /// </summary>
  122. public override ExternalReference<TOutput> BuildAsset<TInput, TOutput>(ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName, string assetName)
  123. {
  124. throw new NotImplementedException();
  125. }
  126. }
  127. }