Ejemplo n.º 1
0
 public override void AddViewPort(IViewPort viewport)
 {
     viewport.SetMaxSize(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);
     XnaCameraMan man = new XnaCameraMan(new Camera(_worldBounds),0f,(float)(Math.PI) + (((float)Math.PI) / 20f) + (((float)Math.PI) / 20f),10f);
     man.SelectedBoat = 0;
     man.DrawSatelliteImagery = _lakeTextureAvailible;
     viewport.CameraMan = man;
     //List<string> boatNames = new List<string>();
     //List<string> boatNumbers = new List<string>();
     //List<System.Drawing.Color> boatColors = new List<System.Drawing.Color>();
     //foreach (AmphibianSoftware.VisualSail.Library.Boat b in boats)
     //{
     //    boatNames.Add(b.Name);
     //    boatNumbers.Add(b.Number);
     //    boatColors.Add(b.Color);
     //}
     /*Dictionary<ReplayBoat, int> offsets = */
     viewport.SetBoatList(this.Replay.Boats);
     viewport.Shutdown = new ShutdownViewPort(this.RemoveViewPort);
     lock (_viewports)
     {
         _viewports.Add(viewport, man);
     }
     //lock (_viewportOffsets)
     //{
     //    _viewportOffsets.Add(viewport, offsets);
     //}
 }
Ejemplo n.º 2
0
 public override void AddViewPort(IViewPort viewport)
 {
     GdiCameraMan man = new GdiCameraMan();
     man.SelectedBoat = 0;
     man.DrawSatelliteImagery = _lakeTextureAvailible;
     viewport.CameraMan = man;
     
     
     viewport.SetBoatList(this.Replay.Boats);
     viewport.Shutdown = new ShutdownViewPort(this.RemoveViewPort);
     lock (_viewports)
     {
         _viewports.Add(viewport, man);
     }
     lock (_buffers)
     {
         int bufferWidth = viewport.RenderTarget.Width;
         int bufferHeight = viewport.RenderTarget.Height;
         _buffers.Add(viewport, new Bitmap(bufferWidth, bufferHeight));
     }
     lock (_graphics)
     {
         _graphics.Add(viewport,Graphics.FromImage(_buffers[viewport]));
     }
     lock (_targetGraphics)
     {
         if (viewport.RenderTarget.IsHandleCreated)
         {
             _targetGraphics.Add(viewport, Graphics.FromHwnd(viewport.RenderTarget.Handle));
         }
     }
 }