ApplyPassUnit() public method

public ApplyPassUnit ( ) : void
return void
Example #1
0
        private void DrawUnits()
        {
            // Set Camera
            fxAnim.VP = Camera.View * Camera.Projection;

            // Loop Through Models
            G.VertexSamplerStates[0] = SamplerState.PointClamp;
            G.SamplerStates[1]       = SamplerState.LinearClamp;
            G.SamplerStates[2]       = SamplerState.LinearClamp;
            foreach (RTSUnitModel unitModel in NonFriendlyUnitModels)
            {
                fxAnim.SetTextures(G, unitModel.AnimationTexture, unitModel.ModelTexture, unitModel.ColorCodeTexture);
                fxAnim.CPrimary   = unitModel.ColorScheme.Primary;
                fxAnim.CSecondary = unitModel.ColorScheme.Secondary;
                fxAnim.CTertiary  = unitModel.ColorScheme.Tertiary;
                fxAnim.ApplyPassUnit();
                unitModel.SetInstances(G);
                unitModel.DrawInstances(G);
            }
            foreach (RTSUnitModel unitModel in FriendlyUnitModels)
            {
                fxAnim.SetTextures(G, unitModel.AnimationTexture, unitModel.ModelTexture, unitModel.ColorCodeTexture);
                fxAnim.CPrimary   = unitModel.ColorScheme.Primary;
                fxAnim.CSecondary = unitModel.ColorScheme.Secondary;
                fxAnim.CTertiary  = unitModel.ColorScheme.Tertiary;
                fxAnim.ApplyPassUnit();
                unitModel.SetInstances(G);
                unitModel.DrawInstances(G);
            }

            // Cause XNA Is Retarded Like That
            G.VertexTextures[0]      = null;
            G.VertexSamplerStates[0] = SamplerState.LinearClamp;
        }