Engines/FlatRedBallXNA/FlatRedBall.Content/ModelAnimation/AnimatedModelProcessor.cs
/// <summary>
/// Called when a basic effect is encountered and potentially replaced by
/// BasicPaletteEffect (if not overridden).  This is called afer effects have been processed.
/// </summary>
/// <param name="skinningType">The the skinning type of the meshpart.</param>
/// <param name="meshPart">The MeshPart that contains the BasicMaterialContent.</param>
Called when a basic effect is encountered and potentially replaced by
BasicPaletteEffect (if not overridden).  This is called afer effects have been processed.
Called when a basic effect is encountered and potentially replaced by BasicPaletteEffect ( if not overridden ) . This is called afer effects have been processed .
protected virtual void ReplaceBasicEffect(SkinningType skinningType,
            ModelMeshPartContent meshPart)
        {
            BasicMaterialContent basic = meshPart.Material as BasicMaterialContent;
            if (basic != null)
            {
                PaletteSourceCode source;
                if (context.TargetPlatform != TargetPlatform.Xbox360)
                {
                    source = new PaletteSourceCode(56);
                }
                else
                {
                    source = new PaletteSourceCode(40);
                }
                PaletteInfoProcessor processor = new PaletteInfoProcessor();
                meshPart.Material = processor.Process(
                    new PaletteInfo(source.SourceCode4BonesPerVertex,
                    source.PALETTE_SIZE, basic), context);
            }
        }
protected virtual void ReplaceBasicEffect ( SkinningType skinningType , ModelMeshPartContent meshPart ) { BasicMaterialContent basic = meshPart . Material as BasicMaterialContent ; if ( basic != null ) { PaletteSourceCode source ; if ( context . TargetPlatform != TargetPlatform . Xbox360 ) { source = new PaletteSourceCode ( 56 ) ; } else { source = new PaletteSourceCode ( 40 ) ; } PaletteInfoProcessor processor = new PaletteInfoProcessor ( ) ; meshPart . Material = processor . Process ( new PaletteInfo ( source . SourceCode4BonesPerVertex , source . PALETTE_SIZE , basic ) , context ) ; } }
Called when a basic effect is encountered and potentially replaced by
BasicPaletteEffect (if not overridden).
Called when a basic effect is encountered and potentially replaced by BasicPaletteEffect ( if not overridden ) .
// Create a new PaletteSourceCode object and set its palette size // based on the platform since xbox has fewer registers. // Process the material and set the meshPart material to the new // material.
skinningType
SkinningType
The the skinning type of the meshpart.
The the skinning type of the meshpart .
meshPart
ModelMeshPartContent
The MeshPart that contains the BasicMaterialContent.
The MeshPart that contains the BasicMaterialContent .