Permalink
Browse files

Fixed all content processors to use new ContentHelper.GetMonoGamePlat…

…form().

Cleaned up namespaces used in project.
  • Loading branch information...
1 parent d18a6ac commit 2a9d5c93b02439e0b4aeeecfd4824d734be3cc9d @tomspilman tomspilman committed Jun 4, 2012
@@ -13,7 +13,7 @@
using NAudio.WindowsMediaFormat;
using Microsoft.Xna.Framework.Content.Pipeline.Audio;
-namespace MonoGameContentProcessors.Utilities
+namespace MonoGameContentProcessors
{
public static class AudioConverter
{
@@ -2,11 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
-
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
-namespace Microsoft.Xna.Framework.Content.Pipeline.Graphics
+namespace MonoGameContentProcessors.Content
{
public enum MGCompressionMode
{
@@ -5,13 +5,12 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
-using Microsoft.Xna.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Graphics;
using TwoMGFX;
using System.IO;
using System.Collections;
-namespace MonoGameContentProcessors.Processors.Effect
+namespace MonoGameContentProcessors.Processors
{
[ContentProcessor(DisplayName = "MonoGame Effect")]
class MGEffectProcessor : EffectProcessor
@@ -1,36 +1,32 @@
-namespace Microsoft.Xna.Framework.Content.Pipeline.Processors
-{
-
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
-using Microsoft.Xna.Content.Pipeline.Processors;
+using Microsoft.Xna.Framework.Content.Pipeline.Processors;
-
-[ContentProcessor(DisplayName = "MonoGame Material")]
-public class MGMaterialProcessor : MaterialProcessor
-{
-
- protected override ExternalReference<TextureContent> BuildTexture(string textureName, ExternalReference<TextureContent> texture, ContentProcessorContext context)
+namespace MonoGameContentProcessors.Processors
+{
+ [ContentProcessor(DisplayName = "MonoGame Material")]
+ public class MGMaterialProcessor : MaterialProcessor
{
- // Fall back to the default if we aren't using IOS
- if (!context.BuildConfiguration.ToUpper().Contains("IOS"))
- return base.BuildTexture(textureName, texture, context);
-
- var processorParameters = new OpaqueDataDictionary();
- processorParameters.Add("ColorKeyColor", this.ColorKeyColor);
- processorParameters.Add("ColorKeyEnabled", this.ColorKeyEnabled);
- processorParameters.Add("TextureFormat", this.TextureFormat);
- processorParameters.Add("GenerateMipmaps", this.GenerateMipmaps);
- processorParameters.Add("ResizeToPowerOfTwo", this.ResizeTexturesToPowerOfTwo);
- processorParameters.Add("PremultiplyAlpha", this.PremultiplyTextureAlpha);
-
- return context.BuildAsset<TextureContent, TextureContent>(texture, typeof(MGTextureProcessor).Name, processorParameters, null, null);
+ protected override ExternalReference<TextureContent> BuildTexture(string textureName, ExternalReference<TextureContent> texture, ContentProcessorContext context)
+ {
+ // Fallback if we aren't buiding for iOS.
+ var platform = ContentHelper.GetMonoGamePlatform();
+ if (platform != MonoGamePlatform.iOS)
+ return base.BuildTexture(textureName, texture, context);
+
+ var processorParameters = new OpaqueDataDictionary();
+ processorParameters.Add("ColorKeyColor", this.ColorKeyColor);
+ processorParameters.Add("ColorKeyEnabled", this.ColorKeyEnabled);
+ processorParameters.Add("TextureFormat", this.TextureFormat);
+ processorParameters.Add("GenerateMipmaps", this.GenerateMipmaps);
+ processorParameters.Add("ResizeToPowerOfTwo", this.ResizeTexturesToPowerOfTwo);
+ processorParameters.Add("PremultiplyAlpha", this.PremultiplyTextureAlpha);
+ return context.BuildAsset<TextureContent, TextureContent>(texture, typeof(MGTextureProcessor).Name, processorParameters, null, null);
+ }
}
-
-}
}
@@ -8,7 +8,6 @@
using System.Reflection;
using System.Collections.ObjectModel;
using System.IO;
-using MonoGameContentProcessors.Utilities;
namespace MonoGameContentProcessors.Processors
{
@@ -17,7 +16,9 @@ public class MGSongProcessor : SongProcessor
{
public override SongContent Process(AudioContent input, ContentProcessorContext context)
{
- if (!context.BuildConfiguration.ToUpper().Contains("IOS"))
+ // Fallback if we aren't buiding for iOS.
+ var platform = ContentHelper.GetMonoGamePlatform();
+ if (platform != MonoGamePlatform.iOS)
return base.Process(input, context);
//TODO: If quality isn't best and it's a .wma, don't compress to MP3. Leave it as a .wav instead
@@ -1,23 +1,25 @@
using System;
+using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Collections.ObjectModel;
+using Microsoft.Xna.Framework.Content.Pipeline;
+using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Audio;
-using MonoGameContentProcessors.Utilities;
-using System.IO;
-
using NAudio.Wave;
-namespace Microsoft.Xna.Framework.Content.Pipeline.Processors
+namespace MonoGameContentProcessors.Processors
{
[ContentProcessor(DisplayName = "MonoGame SoundEffect")]
public class MGSoundEffectProcessor : SoundEffectProcessor
{
- public override SoundEffectContent Process(Audio.AudioContent input, ContentProcessorContext context)
+ public override SoundEffectContent Process(AudioContent input, ContentProcessorContext context)
{
- if (!context.BuildConfiguration.ToUpper().Contains("IOS"))
+ // Fallback if we aren't buiding for iOS.
+ var platform = ContentHelper.GetMonoGamePlatform();
+ if (platform != MonoGamePlatform.iOS)
return base.Process(input, context);
var targetSampleRate = input.Format.SampleRate;
@@ -4,21 +4,21 @@
using System.Text;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using System.Reflection;
-using Microsoft.Xna.Content.Pipeline.Processors;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content.Pipeline;
+using Microsoft.Xna.Framework.Content.Pipeline.Processors;
+using MonoGameContentProcessors.Content;
-namespace Microsoft.Xna.Framework.Content.Pipeline.Processors
+namespace MonoGameContentProcessors.Processors
{
[ContentProcessor(DisplayName = "MonoGame SpriteFont")]
public class MGSpriteFontDescriptionProcessor : FontDescriptionProcessor
{
- public MGSpriteFontDescriptionProcessor()
- : base()
- {
- }
-
public override SpriteFontContent Process(FontDescription input, ContentProcessorContext context)
{
- if (!context.BuildConfiguration.ToUpper().Contains("IOS"))
+ // Fallback if we aren't buiding for iOS.
+ var platform = ContentHelper.GetMonoGamePlatform();
+ if (platform != MonoGamePlatform.iOS)
return base.Process(input, context);
SpriteFontContent content = base.Process(input, context);
@@ -1,18 +1,17 @@
-namespace Microsoft.Xna.Content.Pipeline.Processors
+using System;
+using System.ComponentModel;
+using System.IO;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content.Pipeline;
+using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
+using Microsoft.Xna.Framework.Content.Pipeline.Processors;
+using System.Runtime.InteropServices;
+using System.Collections.ObjectModel;
+using MonoGameContentProcessors.Content;
+
+namespace MonoGameContentProcessors.Processors
{
- using System;
- using System.ComponentModel;
- using System.IO;
- using System.Collections.Generic;
-
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Content.Pipeline;
- using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
- using Microsoft.Xna.Framework.Content.Pipeline.Processors;
- using System.Runtime.InteropServices;
- using System.Collections.ObjectModel;
-
-
[ContentProcessor(DisplayName = "MonoGame Texture")]
public class MGTextureProcessor : TextureProcessor
{
@@ -32,8 +31,9 @@ public MGCompressionMode CompressionMode
public override TextureContent Process(TextureContent input, ContentProcessorContext context)
{
- // Bail out early if we aren't building content for IOS
- if (!context.BuildConfiguration.ToUpper().Contains("IOS"))
+ // Fallback if we aren't buiding for iOS.
+ var platform = ContentHelper.GetMonoGamePlatform();
+ if (platform != MonoGamePlatform.iOS)
return base.Process(input, context);
// Only go this path if we are compressing the texture

0 comments on commit 2a9d5c9

Please sign in to comment.