public override void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, System.Drawing.Rectangle[] rois, int startIndex, int length) { CloudsEffectConfigToken token = (CloudsEffectConfigToken)parameters; UserBlendOp blendOp = token.BlendOp; if (blendOp is UserBlendOps.NormalBlendOp && EnvironmentParameters.PrimaryColor.A == 255 && EnvironmentParameters.SecondaryColor.A == 255) { // this is just an optimization blendOp = null; } this.scale = token.Amount1; this.power = token.Amount2 / 100.0f; this.seed = (byte)(token.Seed ^ instanceSeed); for (int i = startIndex; i < startIndex + length; ++i) { RenderClouds(dstArgs.Surface, rois[i]); if (blendOp != null) { blendOp.Apply(dstArgs.Surface, rois[i].Location, srcArgs.Surface, rois[i].Location, dstArgs.Surface, rois[i].Location, rois[i].Size); } } }
protected CloudsEffectConfigToken(CloudsEffectConfigToken copyMe) : base(copyMe) { this.seed = copyMe.seed; this.blendOp = copyMe.blendOp; }
protected CloudsEffectConfigToken(CloudsEffectConfigToken copyMe) : base(copyMe) { this.seed = copyMe.seed; this.blendOp = copyMe.blendOp; }