Example #1
0
 public void DrawFullscreen(BaseEffect effect, Texture texture, Matrix? textureMatrix)
 {
   this.DrawFullscreen(effect, texture, textureMatrix, Color.White);
 }
Example #2
0
 public void DrawFullscreen(BaseEffect effect, Texture texture, Matrix? textureMatrix, Color color)
 {
   bool flag = effect.IgnoreCache;
   effect.IgnoreCache = true;
   if (texture != null)
     this.fullscreenPlane.Texture.Set(texture);
   if (textureMatrix.HasValue)
     this.fullscreenPlane.TextureMatrix.Set(textureMatrix.Value);
   if (color != Color.White)
   {
     this.fullscreenPlane.Material.Diffuse = color.ToVector3();
     this.fullscreenPlane.Material.Opacity = (float) color.A / (float) byte.MaxValue;
   }
   this.fullscreenPlane.Effect = effect;
   this.fullscreenPlane.Draw();
   if (color != Color.White)
   {
     this.fullscreenPlane.Material.Diffuse = Vector3.One;
     this.fullscreenPlane.Material.Opacity = 1f;
   }
   if (texture != null)
     this.fullscreenPlane.Texture.Set((Texture) null);
   if (textureMatrix.HasValue)
     this.fullscreenPlane.TextureMatrix.Set(Matrix.Identity);
   effect.IgnoreCache = flag;
 }
Example #3
0
 public void DrawFullscreen(BaseEffect effect, Color color)
 {
   this.DrawFullscreen(effect, (Texture) this.fullWhite, new Matrix?(), color);
 }
Example #4
0
 public void DrawFullscreen(BaseEffect effect, Texture texture)
 {
   this.DrawFullscreen(effect, texture, new Matrix?(), Color.White);
 }
Example #5
0
 public void DrawFullscreen(BaseEffect effect)
 {
   this.DrawFullscreen(effect, (Texture) null, new Matrix?(), Color.White);
 }
Example #6
0
 private void DrawTrileLights(Mesh m, BaseEffect effect)
 {
   GraphicsDevice graphicsDevice = this.TrilesMesh.GraphicsDevice;
   foreach (TrileMaterializer trileMaterializer in this.trileMaterializers.Values)
   {
     if (trileMaterializer.Geometry != null && trileMaterializer.Geometry.InstanceCount != 0)
     {
       ActorType type = trileMaterializer.Trile.ActorSettings.Type;
       switch (type)
       {
         case ActorType.LightningPlatform:
           continue;
         case ActorType.GoldenCube:
           GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.Sky));
           break;
       }
       if (this.LevelManager.BlinkingAlpha)
         this.TrilesEffect.Blink = type != ActorType.Crystal;
       trileMaterializer.Group.Draw(effect);
       if (type == ActorType.GoldenCube)
         GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.Level));
     }
   }
   this.TrilesEffect.Blink = false;
 }
Example #7
0
 protected virtual void DrawTriles(Mesh m, BaseEffect effect)
 {
   GraphicsDevice graphicsDevice = this.GraphicsDeviceService.GraphicsDevice;
   foreach (TrileMaterializer trileMaterializer in this.trileMaterializers.Values)
   {
     if (trileMaterializer.Geometry != null && trileMaterializer.Geometry.InstanceCount != 0 && !trileMaterializer.Geometry.Empty)
     {
       Trile trile = trileMaterializer.Trile;
       ActorType type = trile.ActorSettings.Type;
       bool flag1 = false;
       bool flag2 = false;
       if (ActorTypeExtensions.IsBomb(type))
       {
         flag1 = true;
         GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.Bomb));
       }
       else if (type == ActorType.LightningPlatform)
       {
         GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.Ghosts));
         flag1 = true;
         GraphicsDeviceExtensions.SetColorWriteChannels(graphicsDevice, ColorWriteChannels.None);
         GraphicsDeviceExtensions.GetDssCombiner(graphicsDevice).DepthBufferWriteEnable = false;
         flag2 = true;
       }
       else if (type == ActorType.Hole)
       {
         flag1 = true;
         GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.Hole));
       }
       else if (trile.Immaterial || trile.Thin || ActorTypeExtensions.IsPickable(type))
       {
         flag1 = true;
         GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.NoSilhouette));
       }
       trileMaterializer.Group.Draw(effect);
       if (flag1)
         GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.Level));
       if (flag2)
       {
         GraphicsDeviceExtensions.SetColorWriteChannels(graphicsDevice, ColorWriteChannels.All);
         GraphicsDeviceExtensions.GetDssCombiner(graphicsDevice).DepthBufferWriteEnable = true;
       }
     }
   }
   this.fallbackMaterializer.Group.Draw(effect);
 }
Example #8
0
 private void DrawArtObjects(Mesh m, BaseEffect effect)
 {
   GraphicsDevice graphicsDevice = this.GraphicsDeviceService.GraphicsDevice;
   foreach (ArtObjectInstance artObjectInstance in this.LevelArtObjects)
   {
     artObjectInstance.ArtObject.Geometry.InstanceCount = artObjectInstance.ArtObject.InstanceCount;
     artObjectInstance.Update();
   }
   GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.NoSilhouette));
   foreach (Group group in this.ArtObjectsMesh.Groups)
   {
     ArtObjectCustomData objectCustomData = (ArtObjectCustomData) group.CustomData;
     if (group.Enabled && objectCustomData.ArtObject.NoSihouette)
       group.Draw(effect);
   }
   GraphicsDeviceExtensions.PrepareStencilWrite(graphicsDevice, new StencilMask?(StencilMask.Level));
   foreach (Group group in this.ArtObjectsMesh.Groups)
   {
     ArtObjectCustomData objectCustomData = (ArtObjectCustomData) group.CustomData;
     if (group.Enabled && !objectCustomData.ArtObject.NoSihouette)
       group.Draw(effect);
   }
 }
Example #9
0
 private void DrawLayered(Mesh m, BaseEffect e)
 {
   lock (m)
   {
     foreach (Group item_0 in m.Groups)
     {
       switch (((GodRays.RayCustomData) item_0.CustomData).Layer)
       {
         case 0:
           GraphicsDeviceExtensions.PrepareStencilRead(this.GraphicsDevice, CompareFunction.Greater, StencilMask.SkyLayer3);
           break;
         case 1:
           GraphicsDeviceExtensions.PrepareStencilRead(this.GraphicsDevice, CompareFunction.Greater, StencilMask.SkyLayer2);
           break;
         case 2:
           GraphicsDeviceExtensions.PrepareStencilRead(this.GraphicsDevice, CompareFunction.Greater, StencilMask.SkyLayer1);
           break;
         case 3:
           GraphicsDeviceExtensions.PrepareStencilRead(this.GraphicsDevice, CompareFunction.Always, StencilMask.None);
           break;
       }
       item_0.Draw(e);
     }
   }
   GraphicsDeviceExtensions.PrepareStencilRead(this.GraphicsDevice, CompareFunction.Always, StencilMask.None);
 }