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 DesignationRenderer(MyGame game) : base(game) { m_game = game; //m_game.EnvironmentChanged += OnEnvChanged; LoadContent(); }
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; }
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); }
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); }
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; }
public DebugAxesRenderer(MyGame game) : base(game) { LoadContent(); }
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 SelectionService(MyGame game, SharpDXHost control, Camera camera) { m_game = game; m_control = control; }
public TestCubeRenderer(MyGame game) : base(game) { LoadContent(); }
public ViewGridAdjusterService(MyGame game, MapControl3D control) { m_game = game; m_control = control; }
public CursorService(MyGame game, SharpDXHost control) { m_game = game; m_control = control; }
public ViewGridProvider(MyGame game) { m_game = game; game.EnvironmentChanged += Data_MapChanged; }
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 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)); }