Пример #1
0
        protected override void LoadContent()
        {
            SplitUpCubeHost splitUpCubeHost1 = this;
            Mesh            mesh1            = new Mesh();
            Mesh            mesh2            = mesh1;

            DefaultEffect.LitTextured litTextured1 = new DefaultEffect.LitTextured();
            litTextured1.Specular        = true;
            litTextured1.Emissive        = 0.5f;
            litTextured1.AlphaIsEmissive = true;
            DefaultEffect.LitTextured litTextured2 = litTextured1;
            mesh2.Effect   = (BaseEffect)litTextured2;
            mesh1.Blending = new BlendingMode?(BlendingMode.Alphablending);
            Mesh mesh3 = mesh1;

            splitUpCubeHost1.SolidCubes = mesh3;
            SplitUpCubeHost splitUpCubeHost2 = this;
            Mesh            mesh4            = new Mesh();
            Mesh            mesh5            = mesh4;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.Fullbright      = true;
            vertexColored1.AlphaIsEmissive = false;
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh5.Effect      = (BaseEffect)vertexColored2;
            mesh4.DepthWrites = false;
            Mesh mesh6 = mesh4;

            splitUpCubeHost2.ChimeOutline = mesh6;
            this.ChimeOutline.AddWireframePolygon(Color.Yellow, new Vector3(0.0f, 0.7071068f, 0.0f), new Vector3(0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, -0.7071068f, 0.0f), new Vector3(-0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, 0.7071068f, 0.0f));
            this.ChimeOutline.AddWireframePolygon(new Color(Color.Yellow.ToVector3() * 0.3333333f), new Vector3(0.0f, 0.7071068f, 0.0f), new Vector3(0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, -0.7071068f, 0.0f), new Vector3(-0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, 0.7071068f, 0.0f));
            this.ChimeOutline.AddWireframePolygon(new Color(Color.Yellow.ToVector3() * 0.1111111f), new Vector3(0.0f, 0.7071068f, 0.0f), new Vector3(0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, -0.7071068f, 0.0f), new Vector3(-0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, 0.7071068f, 0.0f));
            this.ChimeOutline.AddWireframePolygon(new Color(Color.Yellow.ToVector3() * 0.03703704f), new Vector3(0.0f, 0.7071068f, 0.0f), new Vector3(0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, -0.7071068f, 0.0f), new Vector3(-0.7071068f, 0.0f, 0.0f), new Vector3(0.0f, 0.7071068f, 0.0f));
            this.sBitChime = this.CMProvider.Global.Load <SoundEffect>("Sounds/Collects/BitChime");
        }
Пример #2
0
        protected override void LoadContent()
        {
            this.fadeOutQuad = new Mesh()
            {
                AlwaysOnTop = true,
                DepthWrites = false
            };
            this.fadeOutQuad.AddFace(Vector3.One * 2f, Vector3.Zero, FaceOrientation.Front, Color.Black, true);
            Mesh mesh = this.fadeOutQuad;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.ForcedViewMatrix       = new Matrix?(Matrix.Identity);
            vertexColored1.ForcedProjectionMatrix = new Matrix?(Matrix.Identity);
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh.Effect        = (BaseEffect)vertexColored2;
            this.trileFadeQuad = new Mesh()
            {
                AlwaysOnTop = true,
                DepthWrites = false
            };
            this.trileFadeQuad.AddFace(Vector3.One, Vector3.Zero, FaceOrientation.Front, Color.Black, true);
            this.trileFadeQuad.Effect = (BaseEffect) new DefaultEffect.VertexColored();
            this.sound = this.CMProvider.Global.Load <SoundEffect>("Sounds/Gomez/EnterDoor");
            this.LevelManager.LevelChanged += (Action)(() =>
            {
                this.skipPreview = true;
                this.VolumeService.Exit += new Action <int>(this.RevertSkipPreview);
            });
            this.DrawOrder = 901;
        }
Пример #3
0
        public override void Initialize()
        {
            base.Initialize();
            Pixelizer pixelizer = this;
            Mesh      mesh1     = new Mesh();
            Mesh      mesh2     = mesh1;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.Fullbright = true;
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh2.Effect      = (BaseEffect)vertexColored2;
            mesh1.AlwaysOnTop = true;
            mesh1.DepthWrites = false;
            Mesh mesh3 = mesh1;

            pixelizer.GoMesh = mesh3;
            this.GomezGroup  = this.GoMesh.AddFace(Vector3.One, Vector3.Zero, FaceOrientation.Front, Color.White, true, false, false);
            this.FezGroup    = this.GoMesh.AddFace(Vector3.One / 2f, Vector3.Zero, FaceOrientation.Front, Color.Red, true, false, false);
            this.GoMesh.Effect.ForcedViewMatrix       = new Matrix?(new Matrix(1f, 0.0f, 0.0f, 0.0f, 0.0f, 1f, 0.0f, 0.0f, 0.0f, 0.0f, 1f, 0.0f, 0.0f, 0.0f, -249.95f, 1f));
            this.GoMesh.Effect.ForcedProjectionMatrix = new Matrix?(new Matrix(0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 0.3555556f, 0.0f, 0.0f, 0.0f, 0.0f, -0.0020004f, 0.0f, 0.0f, 0.0f, -0.00020004f, 1f));
            this.LevelManager.ActualAmbient           = new Color(0.25f, 0.25f, 0.25f);
            this.LevelManager.ActualDiffuse           = Color.White;
            this.OldSfxVol = this.SoundManager.SoundEffectVolume;
            this.Reset();
        }
Пример #4
0
 private void InitializeWatchers()
 {
     this.watchers = new Dictionary <TrileInstance, WatchersHost.WatcherState>();
     if (this.LevelManager.TrileSet == null)
     {
         return;
     }
     foreach (TrileInstance instance in Enumerable.SelectMany <Trile, TrileInstance>(Enumerable.Where <Trile>((IEnumerable <Trile>) this.LevelManager.TrileSet.Triles.Values, (Func <Trile, bool>)(t => t.ActorSettings.Type == ActorType.Watcher)), (Func <Trile, IEnumerable <TrileInstance> >)(t => (IEnumerable <TrileInstance>)t.Instances)))
     {
         instance.Trile.Size   = new Vector3(31.0 / 32.0);
         instance.PhysicsState = new InstancePhysicsState(instance);
         Dictionary <TrileInstance, WatchersHost.WatcherState> dictionary = this.watchers;
         TrileInstance             key           = instance;
         WatchersHost.WatcherState watcherState1 = new WatchersHost.WatcherState();
         WatchersHost.WatcherState watcherState2 = watcherState1;
         Mesh mesh1 = new Mesh();
         Mesh mesh2 = mesh1;
         DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
         vertexColored1.Fullbright = true;
         DefaultEffect.VertexColored vertexColored2 = vertexColored1;
         mesh2.Effect = (BaseEffect)vertexColored2;
         Mesh mesh3 = mesh1;
         watcherState2.Eyes             = mesh3;
         watcherState1.OriginalCenter   = instance.Center;
         watcherState1.CrashAttenuation = 1f;
         WatchersHost.WatcherState watcherState3 = watcherState1;
         dictionary.Add(key, watcherState3);
         this.watchers[instance].Eyes.AddColoredBox(Vector3.One / 16f, Vector3.Zero, new Color((int)byte.MaxValue, (int)sbyte.MaxValue, 0), false);
         this.watchers[instance].Eyes.AddColoredBox(Vector3.One / 16f, Vector3.Zero, new Color((int)byte.MaxValue, (int)sbyte.MaxValue, 0), false);
         this.watchers[instance].Eyes.AddColoredBox(Vector3.One / 16f, Vector3.Zero, new Color((int)byte.MaxValue, (int)sbyte.MaxValue, 0), false);
         this.watchers[instance].Eyes.AddColoredBox(Vector3.One / 16f, Vector3.Zero, new Color((int)byte.MaxValue, (int)sbyte.MaxValue, 0), false);
     }
 }
Пример #5
0
        public override void Initialize()
        {
            base.Initialize();
            FezGrid fezGrid1 = this;
            Mesh    mesh1    = new Mesh();
            Mesh    mesh2    = mesh1;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.Fullbright = true;
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh2.Effect = (BaseEffect)vertexColored2;
            Mesh mesh3 = mesh1;

            fezGrid1.GoMesh = mesh3;
            this.GomezGroup = this.GoMesh.AddFace(Vector3.One, Vector3.Zero, FaceOrientation.Front, Color.White, true, false, false);
            this.FezGroup   = this.GoMesh.AddFace(Vector3.One / 2f, Vector3.Zero, FaceOrientation.Front, Color.Red, true, false, false);
            FezGrid fezGrid2 = this;
            Mesh    mesh4    = new Mesh();
            Mesh    mesh5    = mesh4;

            DefaultEffect.VertexColored vertexColored3 = new DefaultEffect.VertexColored();
            vertexColored3.Fullbright = true;
            DefaultEffect.VertexColored vertexColored4 = vertexColored3;
            mesh5.Effect = (BaseEffect)vertexColored4;
            Mesh mesh6 = mesh4;

            fezGrid2.TetraMesh = mesh6;
            Vector3[] pointPairs = new Vector3[2560];
            for (int index = 0; index < 1280; ++index)
            {
                pointPairs[index * 2]     = new Vector3(-640f, 0.0f, (float)(index - 640));
                pointPairs[index * 2 + 1] = new Vector3(640f, 0.0f, (float)(index - 640));
            }
            Color[] pointColors = Enumerable.ToArray <Color>(Enumerable.Repeat <Color>(Color.Red, 2560));
            this.TetraMesh.AddLines(pointColors, pointPairs, true);
            this.TetraMesh.AddLines(pointColors, Enumerable.ToArray <Vector3>(Enumerable.Select <Vector3, Vector3>((IEnumerable <Vector3>)pointPairs, (Func <Vector3, Vector3>)(v => new Vector3(v.Z, 0.0f, v.X)))), true);
            this.CubeMesh = new Mesh()
            {
                Effect = (BaseEffect) new DefaultEffect.LitVertexColored()
            };
            this.CubeMesh.AddFlatShadedBox(Vector3.One, Vector3.Zero, Color.White, true);
            this.StencilMesh = new Mesh()
            {
                Effect      = (BaseEffect) new DefaultEffect.Textured(),
                AlwaysOnTop = true,
                DepthWrites = false
            };
            this.StencilMesh.AddFace(FezMath.XZMask * 1280f, Vector3.Zero, FaceOrientation.Top, true);
            this.LevelManager.ActualAmbient = new Color(0.25f, 0.25f, 0.25f);
            this.LevelManager.ActualDiffuse = Color.White;
            this.Reset();
        }
Пример #6
0
        private void Reset()
        {
            this.FractalMeshes.Clear();
            this.OuterShellMesh = new Mesh()
            {
                Effect = (BaseEffect) new DefaultEffect.LitVertexColored()
            };
            Fractal.AddShell(this.OuterShellMesh, true, true);
            Fractal.AddShell(this.OuterShellMesh, false, true);
            Mesh mesh1    = this.OuterShellMesh;
            bool positive = true;

            for (int index = 0; index < 15; ++index)
            {
                Mesh mesh2 = new Mesh()
                {
                    Effect   = (BaseEffect) new DefaultEffect.LitVertexColored(),
                    Material =
                    {
                        Diffuse = Color.Cyan.ToVector3()
                    }
                };
                Fractal.AddShell(mesh2, positive, false);
                mesh2.Culling    = positive ? CullMode.CullCounterClockwiseFace : CullMode.CullClockwiseFace;
                mesh2.CustomData = (object)(bool)(positive ? 1 : 0);
                mesh2.Parent     = mesh1;
                this.FractalMeshes.Add(mesh2);
                positive = !positive;
                mesh1    = mesh2;
            }
            Fractal fractal = this;
            Mesh    mesh3   = new Mesh();
            Mesh    mesh4   = mesh3;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.Fullbright = true;
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh4.Effect = (BaseEffect)vertexColored2;
            Mesh mesh5 = mesh3;

            fractal.AxisMesh = mesh5;
            this.AxisMesh.AddColoredBox(new Vector3(1f, 1f, 10000f) / 200f, Vector3.Zero, Color.Blue, false);
            this.AxisMesh.AddColoredBox(new Vector3(1f, 10000f, 1f) / 200f, Vector3.Zero, Color.Green, false);
            this.AxisMesh.AddColoredBox(new Vector3(10000f, 1f, 1f) / 200f, Vector3.Zero, Color.Red, false);
            this.OuterShellMesh.Scale = Vector3.One * 2f;
        }
Пример #7
0
        protected override void LoadContent()
        {
            float         aspectRatio   = this.GraphicsDevice.Viewport.AspectRatio;
            SaveIndicator saveIndicator = this;
            Mesh          mesh1         = new Mesh();
            Mesh          mesh2         = mesh1;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.ForcedProjectionMatrix = new Matrix?(Matrix.CreateOrthographic(14f * aspectRatio, 14f, 0.1f, 100f));
            vertexColored1.ForcedViewMatrix       = new Matrix?(Matrix.CreateLookAt(new Vector3(0.0f, 0.0f, 10f), Vector3.Zero, Vector3.Up));
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh2.Effect      = (BaseEffect)vertexColored2;
            mesh1.Blending    = new BlendingMode?(BlendingMode.Alphablending);
            mesh1.AlwaysOnTop = true;
            mesh1.DepthWrites = false;
            mesh1.Position    = new Vector3(5.5f * aspectRatio, -4.5f, 0.0f);
            Mesh mesh3 = mesh1;

            saveIndicator.mesh = mesh3;
            this.mesh.AddFace(Vector3.One, Vector3.Zero, FaceOrientation.Front, Color.Red, true);
        }
Пример #8
0
        public WakingUp(Game game)
            : base(game)
        {
            WakingUp wakingUp = this;
            Mesh     mesh1    = new Mesh();

            mesh1.AlwaysOnTop = true;
            mesh1.DepthWrites = false;
            Mesh mesh2 = mesh1;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.ForcedViewMatrix       = new Matrix?(Matrix.Identity);
            vertexColored1.ForcedProjectionMatrix = new Matrix?(Matrix.Identity);
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh2.Effect = (BaseEffect)vertexColored2;
            Mesh mesh3 = mesh1;

            wakingUp.fadePlane = mesh3;
            this.fadePlane.AddFace(Vector3.One * 2f, Vector3.Zero, FaceOrientation.Front, Color.Black, true);
            this.Visible   = false;
            this.DrawOrder = 101;
        }
Пример #9
0
        public override void Initialize()
        {
            base.Initialize();
            PolytronLogo polytronLogo = this;
            Mesh         mesh1        = new Mesh();

            mesh1.AlwaysOnTop = true;
            Mesh mesh2 = mesh1;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.ForcedProjectionMatrix = new Matrix?(Matrix.CreateOrthographic(1.428571f, 1.428571f, 0.1f, 100f));
            vertexColored1.ForcedViewMatrix       = new Matrix?(Matrix.CreateLookAt(Vector3.UnitZ, -Vector3.UnitZ, Vector3.Up));
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh2.Effect = (BaseEffect)vertexColored2;
            Mesh mesh3 = mesh1;

            polytronLogo.LogoMesh = mesh3;
            for (int index1 = 0; index1 < 4; ++index1)
            {
                FezVertexPositionColor[] vertices = new FezVertexPositionColor[202];
                for (int index2 = 0; index2 < vertices.Length; ++index2)
                {
                    vertices[index2] = new FezVertexPositionColor(Vector3.Zero, PolytronLogo.StripColors[index1]);
                }
                this.LogoMesh.AddGroup().Geometry = (IIndexedPrimitiveCollection) new IndexedUserPrimitives <FezVertexPositionColor>(vertices, Enumerable.ToArray <int>(Enumerable.Range(0, vertices.Length)), PrimitiveType.TriangleStrip);
            }
            float viewScale = SettingsManager.GetViewScale(this.GraphicsDevice);
            int   width     = this.GraphicsDevice.Viewport.Width;
            int   height    = this.GraphicsDevice.Viewport.Height;

            this.LogoMesh.Position = new Vector3(-0.1975f, -0.25f, 0.0f);
            this.LogoMesh.Scale    = new Vector3(new Vector2(500f) * viewScale / new Vector2((float)width, (float)height), 1f);
            bool flag = (double)viewScale >= 1.5;

            this.sPolytron    = this.CMProvider.Get(CM.Intro).Load <SoundEffect>("Sounds/Intro/PolytronJingle");
            this.PolytronText = this.CMProvider.Get(CM.Intro).Load <Texture2D>("Other Textures/splash/polytron" + (flag ? "_1440" : ""));
            this.spriteBatch  = new SpriteBatch(this.GraphicsDevice);
        }
Пример #10
0
        public override void Initialize()
        {
            base.Initialize();
            NowLoadingHexahedron.Phase = NowLoadingHexahedron.Phases.VectorOutline;
            TimeSpan timeSpan;

            NowLoadingHexahedron.SinceTurning      = timeSpan = TimeSpan.Zero;
            NowLoadingHexahedron.SinceWavesStarted = timeSpan;
            NowLoadingHexahedron.SincePhaseStarted = timeSpan;
            this.PlayerManager.CanControl          = false;
            this.WarpSound        = this.CMProvider.GetForLevel(this.GameState.IsTrialMode ? "trial/ELDERS" : "ELDERS").Load <SoundEffect>("Sounds/Zu/HexaWarpIn");
            this.Dot.Hidden       = false;
            this.Dot.Behaviour    = DotHost.BehaviourType.ClampToTarget;
            this.Dot.Target       = this.Center;
            this.Dot.ScalePulsing = 0.0f;
            this.Dot.Opacity      = 0.0f;
            Waiters.Wait((Func <bool>)(() => this.PlayerManager.Grounded), (Action)(() =>
            {
                this.WalkTo.Destination = (Func <Vector3>)(() => this.PlayerManager.Position * Vector3.UnitY + this.Center * FezMath.XZMask);
                this.WalkTo.NextAction = ActionType.Idle;
                this.PlayerManager.Action = ActionType.WalkingTo;
            }));
            this.TimeManager.TimeFactor = this.TimeManager.DefaultTimeFactor;
            NowLoadingHexahedron loadingHexahedron1 = this;
            Mesh mesh1 = new Mesh();
            Mesh mesh2 = mesh1;

            DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored();
            vertexColored1.Fullbright      = true;
            vertexColored1.AlphaIsEmissive = false;
            DefaultEffect.VertexColored vertexColored2 = vertexColored1;
            mesh2.Effect      = (BaseEffect)vertexColored2;
            mesh1.DepthWrites = false;
            mesh1.AlwaysOnTop = true;
            Mesh mesh3 = mesh1;

            loadingHexahedron1.Outline = mesh3;
            this.Outline.AddWireframePolygon(Color.White, new Vector3(0.0f, 0.8660254f, 0.0f), new Vector3(0.7071068f, 0.2886752f, 0.0f), new Vector3(0.7071068f, -0.2886752f, 0.0f), new Vector3(0.0f, -0.8660254f, 0.0f), new Vector3(-0.7071068f, -0.2886752f, 0.0f), new Vector3(-0.7071068f, 0.2886752f, 0.0f), new Vector3(0.0f, 0.8660254f, 0.0f));
            this.Outline.Scale = new Vector3(4f);
            this.Outline.BakeTransform <FezVertexPositionColor>();
            Group firstGroup = this.Outline.FirstGroup;

            firstGroup.Material = new Material();
            firstGroup.Enabled  = false;
            for (int index = 0; index < 1024; ++index)
            {
                this.Outline.CloneGroup(firstGroup);
            }
            firstGroup.Enabled = true;
            NowLoadingHexahedron loadingHexahedron2 = this;
            Mesh mesh4 = new Mesh();
            Mesh mesh5 = mesh4;

            DefaultEffect.VertexColored vertexColored3 = new DefaultEffect.VertexColored();
            vertexColored3.Fullbright      = true;
            vertexColored3.AlphaIsEmissive = false;
            DefaultEffect.VertexColored vertexColored4 = vertexColored3;
            mesh5.Effect           = (BaseEffect)vertexColored4;
            mesh4.DepthWrites      = false;
            mesh4.AlwaysOnTop      = true;
            mesh4.Material.Opacity = 0.0f;
            Mesh mesh6 = mesh4;

            loadingHexahedron2.WireCube = mesh6;
            this.WireCube.AddWireframeBox(Vector3.One * 4f, Vector3.Zero, Color.White, true);
            this.WireCube.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Right, (float)Math.Asin(Math.Sqrt(2.0) / Math.Sqrt(3.0))) * Quaternion.CreateFromAxisAngle(Vector3.Up, 0.7853982f);
            this.WireCube.BakeTransform <FezVertexPositionColor>();
            NowLoadingHexahedron loadingHexahedron3 = this;
            Mesh mesh7 = new Mesh();
            Mesh mesh8 = mesh7;

            DefaultEffect.LitVertexColored litVertexColored1 = new DefaultEffect.LitVertexColored();
            litVertexColored1.Fullbright      = false;
            litVertexColored1.AlphaIsEmissive = false;
            DefaultEffect.LitVertexColored litVertexColored2 = litVertexColored1;
            mesh8.Effect           = (BaseEffect)litVertexColored2;
            mesh7.AlwaysOnTop      = true;
            mesh7.Material.Opacity = 0.0f;
            Mesh mesh9 = mesh7;

            loadingHexahedron3.SolidCube = mesh9;
            this.SolidCube.AddFlatShadedBox(Vector3.One * 4f, Vector3.Zero, Color.White, true);
            this.SolidCube.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Right, (float)Math.Asin(Math.Sqrt(2.0) / Math.Sqrt(3.0))) * Quaternion.CreateFromAxisAngle(Vector3.Up, 0.7853982f);
            this.SolidCube.BakeTransform <VertexPositionNormalColor>();
            NowLoadingHexahedron loadingHexahedron4 = this;
            Mesh mesh10 = new Mesh();
            Mesh mesh11 = mesh10;

            DefaultEffect.Textured textured1 = new DefaultEffect.Textured();
            textured1.Fullbright      = true;
            textured1.AlphaIsEmissive = false;
            DefaultEffect.Textured textured2 = textured1;
            mesh11.Effect           = (BaseEffect)textured2;
            mesh10.DepthWrites      = false;
            mesh10.Material.Opacity = 0.0f;
            mesh10.Blending         = new BlendingMode?(BlendingMode.Alphablending);
            mesh10.SamplerState     = SamplerState.LinearClamp;
            Mesh mesh12 = mesh10;

            loadingHexahedron4.Flare = mesh12;
            this.Flare.AddFace(Vector3.One * 4f, Vector3.Zero, FaceOrientation.Front, true);
            this.Flare.Texture = (Dirtyable <Texture>)((Texture)this.CMProvider.Global.Load <Texture2D>("Other Textures/flare_alpha"));
            this.Rays          = new Mesh()
            {
                Effect       = (BaseEffect) new DefaultEffect.Textured(),
                Texture      = (Dirtyable <Texture>)((Texture)this.CMProvider.Global.Load <Texture2D>("Other Textures/smooth_ray")),
                Blending     = new BlendingMode?(BlendingMode.Additive),
                SamplerState = SamplerState.AnisotropicClamp,
                DepthWrites  = false,
                AlwaysOnTop  = true
            };
            for (int index = 0; index < 128; ++index)
            {
                float x     = 0.75f;
                float num   = 0.0075f;
                Group group = this.Rays.AddGroup();
                group.Geometry = (IIndexedPrimitiveCollection) new IndexedUserPrimitives <FezVertexPositionTexture>(new FezVertexPositionTexture[6]
                {
                    new FezVertexPositionTexture(new Vector3(0.0f, (float)((double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(0.0f, 0.0f)),
                    new FezVertexPositionTexture(new Vector3(x, num / 2f, 0.0f), new Vector2(1f, 0.0f)),
                    new FezVertexPositionTexture(new Vector3(x, (float)((double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(1f, 0.45f)),
                    new FezVertexPositionTexture(new Vector3(x, (float)(-(double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(1f, 0.55f)),
                    new FezVertexPositionTexture(new Vector3(x, (float)(-(double)num / 2.0), 0.0f), new Vector2(1f, 1f)),
                    new FezVertexPositionTexture(new Vector3(0.0f, (float)(-(double)num / 2.0 * 0.100000001490116), 0.0f), new Vector2(0.0f, 1f))
                }, new int[12]
                {
                    0,
                    1,
                    2,
                    0,
                    2,
                    5,
                    5,
                    2,
                    3,
                    5,
                    3,
                    4
                }, PrimitiveType.TriangleList);
                group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Forward, RandomHelper.Between(0.0, 6.28318548202515));
                group.Material = new Material()
                {
                    Diffuse = new Vector3(0.0f)
                };
            }
            ServiceHelper.AddComponent((IGameComponent)(this.TheDarkening = new NowLoadingHexahedron.Darkener(this.Game)));
            this.LevelManager.LevelChanged += new Action(this.Kill);
            SoundEffectExtensions.Emit(this.WarpSound).Persistent = true;
        }