protected override void WinRender() { if (loading) { return; } GlobalConstantVars.Time++; camera.Update(); GlobalConstantVars.Time += 1; Display.context.ClearDepthStencilView(Display.depthStencil, DepthStencilClearFlags.Depth, 1.0f, 0); Display.context.ClearRenderTargetView(Display.renderTarget, new Color(ForegroundGame.Map.waterColor)); SceneManager.Camera.Update(); // Game World ------------------------------------- // Draw tool if (currentTool != Tool.NOTHING) { DrawGroundCircle(destination, CurrentBrushSize * 0.5f, CurrentBrushColor); DrawGroundCircle(destination, GameUtils.Max(CurrentBrushSize * 0.5f * (1 - (CurrentBrushSoftness * 0.01f)), 0.5f), new Color4(CurrentBrushColor.Red, CurrentBrushColor.Green, CurrentBrushColor.Blue, 0.5f)); } int width = (int)Math.Ceiling((float)ForegroundGame.Map.width / 2); int height = (int)Math.Ceiling((float)ForegroundGame.Map.height / 2); if (currentTool == Tool.PATHFINDING) { for (int x = 0; x <= (width - 1); x++) { for (int y = 0; y <= (height - 1); y++) { int id = x + (y * width); if (ForegroundGame.Map.accessibilityArray[id] == 0) { ForegroundGame.TerrainDebug.Add(new Vector2(x * 2, y * 2), new Color4(1, 0, 0, 0.3f)); } } } } if (showCompass != 0) { showCompass--; SceneManager.LineManager.AddSunCompass(camera.target + new Vector3(0, 0.5f, 0), GlobalConstantVars.SunDirection, 10); } SceneManager.Render(); ScreenshotManager.Render(); }
protected override void Render() { Display.context.ClearDepthStencilView(Display.depthStencil, DepthStencilClearFlags.Depth, 1.0f, 0); Display.context.ClearRenderTargetView(Display.renderTarget, Color.Black); DebugPerfMonitor.BeginMark(0, "Render", Color.Blue); ScreenManager.Draw(); DebugPerfMonitor.EndMark(0, "Render"); GameConsole.Draw(); DebugPerfMonitor.Draw(new Vector2(50, Display.Height - 100), Display.Width - 100); ScreenshotManager.Render(); }