Exemplo n.º 1
0
 public DebugManager(Game game, Camera camera, ChunkCache chunkCache, SpriteFont debugFont)
     : base(game)
 {
     m_graphs = new GraphManager(game);
     m_debugger = new InGameDebugger(game, camera);
     var statistics = new Statistics(game, chunkCache);
     m_components = new GameComponentCollection
     {
         m_debugger,
         new DebugBar(game, statistics, chunkCache),
         statistics,
         m_graphs,
         new GameConsole(game,  new SpriteBatch(game.GraphicsDevice), new GameConsoleOptions
         {
             Font = debugFont,
             FontColor = Color.LawnGreen,
             Prompt = ">",
             PromptColor = Color.Crimson,
             CursorColor = Color.OrangeRed,
             BackgroundColor = Color.Black*0.8f,
             PastCommandOutputColor = Color.Aqua,
             BufferColor = Color.Gold
         }, m_debugger.ToggleInGameDebugger)
     };
 }
Exemplo n.º 2
0
 public void DrawInGameDebugVisual(GraphicsDevice graphicsDevice, Camera camera, SpriteBatch spriteBatch, SpriteFont spriteFont)
 {
     BoundingBoxRenderer.Render(RenderingBoundingBox, graphicsDevice, camera.View, camera.Projection, Color.DarkRed);
 }
Exemplo n.º 3
0
 public virtual void Initialize(GraphicsDevice graphicsDevice, Camera camera, GetTimeOfDay getTimeOfDay, GetFogVector getFogVector)
 {
     m_getTimeOfDay = getTimeOfDay;
     m_getFogVector = getFogVector;
     m_graphicsDevice = graphicsDevice;
     m_camera = camera;
     Initialized = true;
 }
Exemplo n.º 4
0
 public override void Initialize(GraphicsDevice graphicsDevice, Camera camera, GetTimeOfDay getTimeOfDay, GetFogVector getFogVector)
 {
     base.Initialize(graphicsDevice, camera, getTimeOfDay, getFogVector);
     m_vertexBuilder = new VertexBuilder<CloudBlock>(m_clouds, CloudIndexByWorldPosition, m_graphicsDevice, Scale);
     //TODO: create general task pool (with priority) and put this in it.
     Task.Run(() =>
     {
         while (true)
         {
             StepClouds();
             foreach (var cloudVertexTarget in m_cloudVertexTargets)
             {
                 m_vertexBuilder.Build(cloudVertexTarget);
             }
             Thread.Sleep(100);
         }
     // ReSharper disable once FunctionNeverReturns
     });
 }
Exemplo n.º 5
0
 public void DrawInGameDebugVisual(GraphicsDevice graphicsDevice, Camera camera, SpriteBatch spriteBatch, SpriteFont spriteFont)
 {
     var color = Color.Blue;
     if (ChunkState == ChunkState.Ready)
     {
         color = Color.DarkRed;
     }
     BoundingBoxRenderer.Render(BoundingBox, graphicsDevice, camera.View, camera.Projection, color);
 }
Exemplo n.º 6
0
 public InGameDebugger(Game game, Camera camera)
     : base(game)
 {
     m_debugList = new List<WeakReference<IInGameDebuggable>>();
     m_camera = camera;
 }
Exemplo n.º 7
0
 public override void Initialize(GraphicsDevice graphicsDevice, Camera camera, GetTimeOfDay getTimeOfDay, GetFogVector getFogVector)
 {
     base.Initialize(graphicsDevice, camera, getTimeOfDay, getFogVector);
     MainEngine.GetEngineInstance().CentralDispatch.Register(EventConstants.PlayerPositionUpdated, GetHandlerForEvent(EventConstants.PlayerPositionUpdated));
 }