コード例 #1
0
ファイル: SpriteBatch.cs プロジェクト: meds/ChicksnVixens
        public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
        {
            if (blendState != null)
            {
                fixedBlendState = blendState.fixedBlendState;
                tintEffectMode  = blendState.tintEffectMode;
            }
            else
            {
                fixedBlendState = FixedBlendState.AlphaBlend;
                tintEffectMode  = TintEffectMode.Normal;
            }

            Debug.Assert(samplerState == null);
            Debug.Assert(depthStencilState == null);
            Debug.Assert(rasterizerState == null);

            if (effect != null)
            {
                throw new NotSupportedException("Effect on SpriteBatch is not supported by ExEnSilver");
            }

            currentMatrix = transformMatrix;

            #region Matrix Check
            // Sprite.Transform assumes that the matrix is affine, check that:
            Debug.Assert(transformMatrix.M13 == 0f);
            Debug.Assert(transformMatrix.M14 == 0f);
            Debug.Assert(transformMatrix.M23 == 0f);
            Debug.Assert(transformMatrix.M23 == 0f);
            Debug.Assert(transformMatrix.M31 == 0f);
            Debug.Assert(transformMatrix.M32 == 0f);
            Debug.Assert(transformMatrix.M33 == 1f);
            Debug.Assert(transformMatrix.M34 == 0f);
            Debug.Assert(transformMatrix.M43 == 0f);
            Debug.Assert(transformMatrix.M44 == 1f);
            #endregion
        }
コード例 #2
0
ファイル: BlendState.cs プロジェクト: mikairi/SoshiLand
 private BlendState(FixedBlendState fixedBlendState, TintEffectMode mode, string name)
 {
     this.fixedBlendState = fixedBlendState;
     this.tintEffectMode = mode;
     this.Name = name;
 }
コード例 #3
0
ファイル: BlendState.cs プロジェクト: meds/ChicksnVixens
 private BlendState(FixedBlendState fixedBlendState, TintEffectMode mode, string name)
 {
     this.fixedBlendState = fixedBlendState;
     this.tintEffectMode  = mode;
     this.Name            = name;
 }
コード例 #4
0
ファイル: SpriteBatch.cs プロジェクト: meds/ChicksnVixens
        public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
        {
            if(blendState != null)
            {
                fixedBlendState = blendState.fixedBlendState;
                tintEffectMode = blendState.tintEffectMode;
            }
            else
            {
                fixedBlendState = FixedBlendState.AlphaBlend;
                tintEffectMode = TintEffectMode.Normal;
            }

            Debug.Assert(samplerState == null);
            Debug.Assert(depthStencilState == null);
            Debug.Assert(rasterizerState == null);

            if(effect != null)
                throw new NotSupportedException("Effect on SpriteBatch is not supported by ExEnSilver");

            currentMatrix = transformMatrix;

            #region Matrix Check
            // Sprite.Transform assumes that the matrix is affine, check that:
            Debug.Assert(transformMatrix.M13 == 0f);
            Debug.Assert(transformMatrix.M14 == 0f);
            Debug.Assert(transformMatrix.M23 == 0f);
            Debug.Assert(transformMatrix.M23 == 0f);
            Debug.Assert(transformMatrix.M31 == 0f);
            Debug.Assert(transformMatrix.M32 == 0f);
            Debug.Assert(transformMatrix.M33 == 1f);
            Debug.Assert(transformMatrix.M34 == 0f);
            Debug.Assert(transformMatrix.M43 == 0f);
            Debug.Assert(transformMatrix.M44 == 1f);
            #endregion
        }