Engines/FlatRedBallXNA/FlatRedBall.Content/ModelAnimation/PaletteEffectContent.cs
/// <summary>
/// Processes a PaletteInfo object into a PaletteMaterialContent object.
/// </summary>
/// <param name="input">The PaletteInfo to process.</param>
/// <param name="context">The processor context.</param>
/// <returns>The processed PaletteMaterialContent</returns>
Processes a PaletteInfo object into a PaletteMaterialContent object.
Processes a PaletteInfo object into a PaletteMaterialContent object .
public override PaletteMaterialContent Process(PaletteInfo input,
            ContentProcessorContext context)
        {
#if XNA4
            throw new NotImplementedException();
#else
            EffectProcessor effectProcessor = new EffectProcessor();
            EffectContent effectContent = new EffectContent();
            effectContent.EffectCode = input.SourceCode;
            CompiledEffect compiled;
            if (context.TargetPlatform == TargetPlatform.Xbox360)
            {
                compiled = Effect.CompileEffectFromSource(
                    input.SourceCode, null, null, CompilerOptions.None, TargetPlatform.Xbox360);
            }
            else
            {
                compiled = effectProcessor.Process(effectContent, context);
            }
            PaletteMaterialContent content = new PaletteMaterialContent();
            content.PaletteSize = input.PaletteSize;
            content.ByteCode = compiled.GetEffectCode();
            BasicMaterialContent basic = input.BasicContent;
            content.Alpha = basic.Alpha;
            content.DiffuseColor = basic.DiffuseColor;
            content.EmissiveColor = basic.EmissiveColor;
            content.Name = basic.Name;
            content.SpecularColor = basic.SpecularColor;
            content.SpecularPower = basic.SpecularPower;
            content.Texture = basic.Texture;
            content.VertexColorEnabled = basic.VertexColorEnabled;
            return content;
#endif
        }
public override PaletteMaterialContent Process ( PaletteInfo input , ContentProcessorContext context ) { if XNA4 throw new NotImplementedException ( ) ; else EffectProcessor effectProcessor = new EffectProcessor ( ) ; EffectContent effectContent = new EffectContent ( ) ; effectContent . EffectCode = input . SourceCode ; CompiledEffect compiled ; if ( context . TargetPlatform == TargetPlatform . Xbox360 ) { compiled = Effect . CompileEffectFromSource ( input . SourceCode , null , null , CompilerOptions . None , TargetPlatform . Xbox360 ) ; } else { compiled = effectProcessor . Process ( effectContent , context ) ; } PaletteMaterialContent content = new PaletteMaterialContent ( ) ; content . PaletteSize = input . PaletteSize ; content . ByteCode = compiled . GetEffectCode ( ) ; BasicMaterialContent basic = input . BasicContent ; content . Alpha = basic . Alpha ; content . DiffuseColor = basic . DiffuseColor ; content . EmissiveColor = basic . EmissiveColor ; content . Name = basic . Name ; content . SpecularColor = basic . SpecularColor ; content . SpecularPower = basic . SpecularPower ; content . Texture = basic . Texture ; content . VertexColorEnabled = basic . VertexColorEnabled ; return content ; endif }
Processes a PaletteInfo object into a PaletteMaterialContent object.
Processes a PaletteInfo object into a PaletteMaterialContent object .
// Set all the variables based on the input.
The processed PaletteMaterialContent
The processed PaletteMaterialContent
input
PaletteInfo
The PaletteInfo to process.
The PaletteInfo to process .
context
ContentProcessorContext
The processor context.
The processor context .