Inheritance: INotifyPropertyChanged
示例#1
0
        internal void SetGame(MyGame game)
        {
            m_game = game;

            m_data           = new DebugWindowData(game);
            this.DataContext = m_data;

            m_timer           = new DispatcherTimer();
            m_timer.Tick     += m_data.Update;
            m_timer.Interval  = TimeSpan.FromSeconds(0.25);
            m_timer.IsEnabled = true;

            var m_scene = m_game.TerrainRenderer;

            cbBorders.Checked   += (s, e) => m_scene.Effect.DisableBorders = true;
            cbBorders.Unchecked += (s, e) => m_scene.Effect.DisableBorders = false;

            cbLight.Checked   += (s, e) => m_scene.Effect.DisableLight = true;
            cbLight.Unchecked += (s, e) => m_scene.Effect.DisableLight = false;

            cbOcclusion.Checked   += (s, e) => m_scene.Effect.DisableOcclusion = true;
            cbOcclusion.Unchecked += (s, e) => m_scene.Effect.DisableOcclusion = false;

            cbTexture.Checked   += (s, e) => m_scene.Effect.DisableTexture = true;
            cbTexture.Unchecked += (s, e) => m_scene.Effect.DisableTexture = false;

            cbOcclusionDebug.Checked   += (s, e) => m_scene.Effect.EnableOcclusionDebug = true;
            cbOcclusionDebug.Unchecked += (s, e) => m_scene.Effect.EnableOcclusionDebug = false;

            cbBigUnknownChunk.Checked   += (s, e) => { Chunk.UseBigUnknownChunk = true; m_scene.ChunkManager.InvalidateChunks(); };
            cbBigUnknownChunk.Unchecked += (s, e) => { Chunk.UseBigUnknownChunk = false; m_scene.ChunkManager.InvalidateChunks(); };

            buttonInvalidate.Click += (s, e) => m_scene.ChunkManager.InvalidateChunks();

            cbWireframe.Checked   += OnRenderStateCheckBoxChanged;
            cbWireframe.Unchecked += OnRenderStateCheckBoxChanged;
            cbCulling.Checked     += OnRenderStateCheckBoxChanged;
            cbCulling.Unchecked   += OnRenderStateCheckBoxChanged;

            tunable1.Value         = m_scene.Effect.Tunable1;
            tunable1.ValueChanged += (s, e) => { m_scene.Effect.Tunable1 = (float)tunable1.Value; };

            tunable2.Value         = m_scene.Effect.Tunable2;
            tunable2.ValueChanged += (s, e) => { m_scene.Effect.Tunable2 = (float)tunable2.Value; };
        }
示例#2
0
        internal void SetGame(MyGame game)
        {
            m_game = game;

            m_data = new DebugWindowData(game);
            this.DataContext = m_data;

            m_timer = new DispatcherTimer();
            m_timer.Tick += m_data.Update;
            m_timer.Interval = TimeSpan.FromSeconds(0.25);
            m_timer.IsEnabled = true;

            var m_scene = m_game.TerrainRenderer;

            cbBorders.Checked += (s, e) => m_scene.Effect.DisableBorders = true;
            cbBorders.Unchecked += (s, e) => m_scene.Effect.DisableBorders = false;

            cbLight.Checked += (s, e) => m_scene.Effect.DisableLight = true;
            cbLight.Unchecked += (s, e) => m_scene.Effect.DisableLight = false;

            cbOcclusion.Checked += (s, e) => m_scene.Effect.DisableOcclusion = true;
            cbOcclusion.Unchecked += (s, e) => m_scene.Effect.DisableOcclusion = false;

            cbTexture.Checked += (s, e) => m_scene.Effect.DisableTexture = true;
            cbTexture.Unchecked += (s, e) => m_scene.Effect.DisableTexture = false;

            cbOcclusionDebug.Checked += (s, e) => m_scene.Effect.EnableOcclusionDebug = true;
            cbOcclusionDebug.Unchecked += (s, e) => m_scene.Effect.EnableOcclusionDebug = false;

            cbBigUnknownChunk.Checked += (s, e) => { Chunk.UseBigUnknownChunk = true; m_scene.ChunkManager.InvalidateChunks(); };
            cbBigUnknownChunk.Unchecked += (s, e) => { Chunk.UseBigUnknownChunk = false; m_scene.ChunkManager.InvalidateChunks(); };

            buttonInvalidate.Click += (s, e) => m_scene.ChunkManager.InvalidateChunks();

            cbWireframe.Checked += OnRenderStateCheckBoxChanged;
            cbWireframe.Unchecked += OnRenderStateCheckBoxChanged;
            cbCulling.Checked += OnRenderStateCheckBoxChanged;
            cbCulling.Unchecked += OnRenderStateCheckBoxChanged;

            tunable1.Value = m_scene.Effect.Tunable1;
            tunable1.ValueChanged += (s, e) => { m_scene.Effect.Tunable1 = (float)tunable1.Value; };

            tunable2.Value = m_scene.Effect.Tunable2;
            tunable2.ValueChanged += (s, e) => { m_scene.Effect.Tunable2 = (float)tunable2.Value; };
        }