Inheritance: GameCore
Exemple #1
0
        public ChunkOutlineRenderer(MyGame game, ChunkManager chunkManager)
            : base(game)
        {
            m_chunkManager = chunkManager;

            LoadContent();
        }
        public TerrainRenderer(MyGame game, Camera camera, ViewGridProvider viewGridProvider)
            : base(game)
        {
            m_chunkManager = ToDispose(new ChunkManager(this, camera, viewGridProvider));

            LoadContent();
        }
        public ChunkOutlineRenderer(MyGame game, ChunkManager chunkManager)
            : base(game)
        {
            m_chunkManager = chunkManager;

            LoadContent();
        }
Exemple #4
0
        public TerrainRenderer(MyGame game, Camera camera, ViewGridProvider viewGridProvider)
            : base(game)
        {
            m_chunkManager = ToDispose(new ChunkManager(this, camera, viewGridProvider));

            LoadContent();
        }
        public DesignationRenderer(MyGame game)
            : base(game)
        {
            m_game = game;
            //m_game.EnvironmentChanged += OnEnvChanged;

            LoadContent();
        }
Exemple #6
0
        public DesignationRenderer(MyGame game)
            : base(game)
        {
            m_game = game;
            //m_game.EnvironmentChanged += OnEnvChanged;

            LoadContent();
        }
Exemple #7
0
        public MousePositionService(MyGame game, SharpDXHost control, GameSurfaceView surfaceView)
        {
            m_game        = game;
            m_control     = control;
            m_surfaceView = surfaceView;

            //m_control.MouseMove += OnMouseMove;
            //m_control.MouseLeave += OnMouseLeave;
        }
Exemple #8
0
        public SelectionRenderer(MyGame game)
            : base(game)
        {
            m_game = game;

            LoadContent();

            this.IsEnabled = false;
        }
        public MousePositionService(MyGame game, SharpDXHost control, GameSurfaceView surfaceView)
        {
            m_game = game;
            m_control = control;
            m_surfaceView = surfaceView;

            //m_control.MouseMove += OnMouseMove;
            //m_control.MouseLeave += OnMouseLeave;
        }
        public SelectionRenderer(MyGame game)
            : base(game)
        {
            m_game = game;

            LoadContent();

            this.IsEnabled = false;
        }
Exemple #11
0
        public CameraKeyHandler(MyGame game, MapControl3D control)
        {
            m_game = game;
            m_control = control;

            control.TextInput += OnTextInput;
            control.KeyDown += OnKeyDown;
            control.KeyUp += OnKeyUp;
            control.LostKeyboardFocus += OnLostKeyboardFocus;
        }
Exemple #12
0
        public CameraKeyHandler(MyGame game, MapControl3D control)
        {
            m_game    = game;
            m_control = control;

            control.TextInput         += OnTextInput;
            control.KeyDown           += OnKeyDown;
            control.KeyUp             += OnKeyUp;
            control.LostKeyboardFocus += OnLostKeyboardFocus;
        }
        protected override void Dispose(bool disposing)
        {
            if (m_debugWindow != null)
            {
                m_debugWindow.Close();
            }

            m_game.Stop();
            m_game.Dispose();
            m_game = null;

            base.Dispose(disposing);
        }
Exemple #14
0
        public SymbolRenderer(MyGame game, ViewGridProvider viewGridProvider)
            : base(game)
        {
            m_viewGridProvider = viewGridProvider;

            m_invalid = true;

            viewGridProvider.ViewGridCornerChanged +=
                (oldValue, newValue) => m_invalid = true;

            game.EnvironmentChanged += OnEnvChanged;

            LoadContent();
        }
        public SymbolRenderer(MyGame game, ViewGridProvider viewGridProvider)
            : base(game)
        {
            m_viewGridProvider = viewGridProvider;

            m_invalid = true;

            viewGridProvider.ViewGridCornerChanged +=
                (oldValue, newValue) => m_invalid   = true;

            game.EnvironmentChanged += OnEnvChanged;

            LoadContent();
        }
        public MapControl3D()
        {
            this.Config = new MapControlConfig();

            this.HoverTileView         = new TileAreaView();
            this.SelectionTileAreaView = new TileAreaView();

            m_game = new MyGame(this);

            m_game.CursorService.LocationChanged     += OnCursorMoved;
            m_game.SelectionService.SelectionChanged += OnSelectionChanged;
            m_game.SelectionService.GotSelection     += OnGotSelection;

            m_game.Start();

            m_toolTipService = new ToolTipService(this);
        }
Exemple #17
0
        public MapControl3D()
        {
            this.Config = new MapControlConfig();

            this.HoverTileView = new TileAreaView();
            this.SelectionTileAreaView = new TileAreaView();

            m_game = new MyGame(this);

            m_game.CursorService.LocationChanged += OnCursorMoved;
            m_game.SelectionService.SelectionChanged += OnSelectionChanged;
            m_game.SelectionService.GotSelection += OnGotSelection;

            m_game.Start();

            m_toolTipService = new ToolTipService(this);
        }
Exemple #18
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; };
        }
Exemple #19
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; };
        }
        public ChunkManager(TerrainRenderer scene, Camera camera, ViewGridProvider viewGridProvider)
        {
            m_scene            = scene;
            m_camera           = camera;
            m_viewGridProvider = viewGridProvider;

            // XXX
            m_game = (MyGame)scene.Game;
            m_game.EnvironmentChanged += Data_MapChanged;

            viewGridProvider.ViewGridCornerChanged += OnViewGridCornerChanged;

            m_cameraPos      = m_camera.Position;
            m_cameraLook     = m_camera.Look;
            m_cameraChunkPos = (m_cameraPos / Chunk.CHUNK_SIZE).ToFloorIntVector3();

            m_forceNearListUpdate = true;
            m_forceDrawListUpdate = true;
        }
Exemple #21
0
        public ChunkManager(TerrainRenderer scene, Camera camera, ViewGridProvider viewGridProvider)
        {
            m_scene = scene;
            m_camera = camera;
            m_viewGridProvider = viewGridProvider;

            // XXX
            m_game = (MyGame)scene.Game;
            m_game.EnvironmentChanged += Data_MapChanged;

            viewGridProvider.ViewGridCornerChanged += OnViewGridCornerChanged;

            m_cameraPos = m_camera.Position;
            m_cameraLook = m_camera.Look;
            m_cameraChunkPos = (m_cameraPos / Chunk.CHUNK_SIZE).ToFloorIntVector3();

            m_forceNearListUpdate = true;
            m_forceDrawListUpdate = true;
        }
 public DebugAxesRenderer(MyGame game)
     : base(game)
 {
     LoadContent();
 }
Exemple #23
0
        protected override void Dispose(bool disposing)
        {
            if (m_debugWindow != null)
                m_debugWindow.Close();

            m_game.Stop();
            m_game.Dispose();
            m_game = null;

            base.Dispose(disposing);
        }
 public DebugAxesRenderer(MyGame game)
     : base(game)
 {
     LoadContent();
 }
Exemple #25
0
 public SelectionService(MyGame game, SharpDXHost control, Camera camera)
 {
     m_game = game;
     m_control = control;
 }
Exemple #26
0
 public TestCubeRenderer(MyGame game)
     : base(game)
 {
     LoadContent();
 }
 public ViewGridAdjusterService(MyGame game, MapControl3D control)
 {
     m_game    = game;
     m_control = control;
 }
Exemple #28
0
 public CursorService(MyGame game, SharpDXHost control)
 {
     m_game = game;
     m_control = control;
 }
Exemple #29
0
        public ViewGridProvider(MyGame game)
        {
            m_game = game;

            game.EnvironmentChanged += Data_MapChanged;
        }
 public ViewGridAdjusterService(MyGame game, MapControl3D control)
 {
     m_game = game;
     m_control = control;
 }
Exemple #31
0
 public CursorService(MyGame game, SharpDXHost control)
 {
     m_game    = game;
     m_control = control;
 }
Exemple #32
0
 public TestCubeRenderer(MyGame game)
     : base(game)
 {
     LoadContent();
 }
Exemple #33
0
        public DebugWindowData(MyGame game)
        {
            m_game = game;

            m_game.ViewGridProvider.ViewGridCornerChanged += (o, n) => Notify("");
        }
Exemple #34
0
        public ViewGridProvider(MyGame game)
        {
            m_game = game;

            game.EnvironmentChanged += Data_MapChanged;
        }
Exemple #35
0
        public DebugWindowData(MyGame game)
        {
            m_game = game;

            m_game.ViewGridProvider.ViewGridCornerChanged += (o, n) => Notify("");
        }
 public static bool PickVoxel(MyGame game, IntVector2 screenPos, MapControlPickMode pickMode, out IntVector3 pos, out Direction face)
 {
     return MousePositionService.PickVoxel(game.Environment, game.Surfaces[0].Views[0], screenPos,
         game.ViewGridProvider.ViewGrid, pickMode, out pos, out face);
 }
 public SelectionService(MyGame game, SharpDXHost control, Camera camera)
 {
     m_game    = game;
     m_control = control;
 }
Exemple #38
0
 public static bool PickVoxel(MyGame game, IntVector2 screenPos, MapControlPickMode pickMode, out IntVector3 pos, out Direction face)
 {
     return(MousePositionService.PickVoxel(game.Environment, game.Surfaces[0].Views[0], screenPos,
                                           game.ViewGridProvider.ViewGrid, pickMode, out pos, out face));
 }