Ejemplo n.º 1
0
		/**
		 * render each child area with an un-updated rendering 
		 * context. Most containers need to update the rendering
		 * context to reflect a different positions for each 
		 * child area
		 */
		public override void Render(IGraphicDevice device, float x, float y)
		{
			for(int i = 0; i < content.Length; i++)
			{
				content[i].Render(device, x, y);
			}
		}
Ejemplo n.º 2
0
        public override void Render(IGraphicDevice device, float x, float y)
        {
            // base renders all areas at the same origin, shift origin to upper
            // left corner
            base.Render(device, x, y - box.Height);

            LineStyle oldStyle = device.LineStyle;

            device.LineStyle = LineStyle.Solid;
            for (int i = 0; i < solidLines.Length;)
            {
                PointF from = solidLines[i++];
                PointF to   = solidLines[i++];
                from.Y = y - box.Height + from.Y;
                from.X = x + from.X;
                to.Y   = y - box.Height + to.Y;
                to.X   = x + to.X;
                device.DrawLine(from, to);
            }

            device.LineStyle = LineStyle.Dashed;
            for (int i = 0; i < dashedLines.Length;)
            {
                PointF from = dashedLines[i++];
                PointF to   = dashedLines[i++];
                from.Y = y - box.Height + from.Y;
                from.X = x + from.X;
                to.Y   = y - box.Height + to.Y;
                to.X   = x + to.X;
                device.DrawLine(from, to);
            }

            device.LineStyle = oldStyle;
        }
Ejemplo n.º 3
0
 /**
  * render each child area with an un-updated rendering
  * context. Most containers need to update the rendering
  * context to reflect a different positions for each
  * child area
  */
 public override void Render(IGraphicDevice device, float x, float y)
 {
     for (int i = 0; i < content.Length; i++)
     {
         content[i].Render(device, x, y);
     }
 }
Ejemplo n.º 4
0
        public override void Render(IGraphicDevice device, float x, float y)
        {
            IFontHandle savedFont = device.SetFont(font);

            device.DrawString(x, y, content);
            device.RestoreFont(savedFont);
        }
Ejemplo n.º 5
0
		public override void Render(IGraphicDevice device, float x, float y)
		{
			// base renders all areas at the same origin, shift origin to upper
			// left corner
			base.Render (device, x, y - box.Height);

			LineStyle oldStyle = device.LineStyle;

            device.LineStyle = LineStyle.Solid;
			for(int i = 0; i < solidLines.Length;)
			{
				PointF from = solidLines[i++];
				PointF to = solidLines[i++];
				from.Y = y - box.Height + from.Y; 
				from.X = x + from.X;
				to.Y = y - box.Height + to.Y;
				to.X = x + to.X;
				device.DrawLine(from, to);
			}

			device.LineStyle = LineStyle.Dashed;
			for(int i = 0; i < dashedLines.Length;)
			{
				PointF from = dashedLines[i++];
				PointF to = dashedLines[i++];
				from.Y = y - box.Height + from.Y; 
				from.X = x + from.X;
				to.Y = y - box.Height + to.Y;
				to.X = x + to.X;
				device.DrawLine(from, to);
			}

			device.LineStyle = oldStyle;			
		}
Ejemplo n.º 6
0
        /**
         * render this area.
         */
        public override void Render(IGraphicDevice device, float x, float y)
        {
            IFontHandle oldFont = device.SetFont(font);

            device.DrawGlyph(index, x, y);
            device.RestoreFont(oldFont);
        }
Ejemplo n.º 7
0
        public bool LoadState(string FilePath, NES nes)
        {
            try
            {
                if (File.Exists(FilePath))
                {
                    nes.PAUSE = true;
                    while (!nes.paused)
                    {
                    }

                    //Backups
                    byte[][]       prg   = nes.Memory.Cartridge.PRG;
                    byte[][]       chr   = nes.Memory.Cartridge.CHR;
                    IGraphicDevice video = nes.PPU.VIDEO;

                    /*Control _Control = nes.APU._Control;
                     * DirectSound _SoundDevice = nes.APU._SoundDevice;
                     * SecondarySoundBuffer buffer = nes.APU.buffer;*/
                    byte[]       DATA         = nes.APU.DATA;
                    InputManager InputManager = nes.Memory.InputManager;
                    Joypad       Joypad1      = nes.Memory.Joypad1;
                    Joypad       Joypad2      = nes.Memory.Joypad2;
                    string       RomPath      = nes.Memory.Cartridge.RomPath;
                    //Do it

                    /*FileStream fs = new FileStream(FilePath, FileMode.Open);
                     * BinaryFormatter formatter = new BinaryFormatter();
                     * NES _Nes = (NES)formatter.Deserialize(fs);
                     * fs.Close();*/

                    /*nes.APU = _Nes.APU;
                     * nes.APU._Control = _Control;
                     * nes.APU._SoundDevice = _SoundDevice;
                     * nes.APU.DATA = DATA;
                     * nes.APU.buffer = buffer;
                     * nes.CPU = _Nes.CPU;
                     * nes.Memory = _Nes.Memory;
                     * nes.Memory.Cartridge.PRG = prg;*/
                    //If not vram, simply load back CHRs
                    if (!nes.Memory.Cartridge.IsVRAM)
                    {
                        nes.Memory.Cartridge.CHR = chr;
                    }
                    nes.Memory.Cartridge.RomPath = RomPath;
                    nes.Memory.InputManager      = InputManager;
                    nes.Memory.Joypad1           = Joypad1;
                    nes.Memory.Joypad2           = Joypad2;
                    //nes.PPU = _Nes.PPU;
                    nes.PPU.Timer = new TIMER();
                    nes.PPU.VIDEO = video;
                    nes.PAUSE     = false;
                    return(true);
                }
                nes.PAUSE = false;
                return(false);
            }
            catch { nes.PAUSE = false; return(false); };
        }
Ejemplo n.º 8
0
		/**
		 * render each child area with an updated rendering context
		 * to give each child a correct left side
		 */
		public override void Render(IGraphicDevice device, float x, float y)
		{
			foreach(Area a in content)
			{
				a.Render(device, x, y);
				x += a.BoundingBox.HorizontalExtent;
			}
		}
Ejemplo n.º 9
0
 /**
  * render each child area with an updated rendering context
  * to give each child a correct left side
  */
 public override void Render(IGraphicDevice device, float x, float y)
 {
     foreach (Area a in content)
     {
         a.Render(device, x, y);
         x += a.BoundingBox.HorizontalExtent;
     }
 }
Ejemplo n.º 10
0
        /**
         * change the color of the rendering context, and call the child's
         * render method recursivly
         */
        public override void Render(IGraphicDevice device, float x, float y)
        {
            Color oldColor = device.Color;

            device.Color = color;
            child.Render(device, x, y);
            device.Color = oldColor;
        }
Ejemplo n.º 11
0
		public override void Render(IGraphicDevice device, float x, float y)
		{
			BoundingBox box = child.BoundingBox;
			Color oldColor = device.Color;
			device.Color = color;
			device.DrawFilledRectangle(y - box.Height, x, x + box.Width, y + box.Depth);
			device.Color = oldColor;
			child.Render(device, x, y);
		}	
Ejemplo n.º 12
0
        public override void Render(IGraphicDevice device, float x, float y)
        {
            BoundingBox box      = child.BoundingBox;
            Color       oldColor = device.Color;

            device.Color = color;
            device.DrawFilledRectangle(y - box.Height, x, x + box.Width, y + box.Depth);
            device.Color = oldColor;
            child.Render(device, x, y);
        }
Ejemplo n.º 13
0
 /**
  * render all of the child areas.
  */
 public override void Render(IGraphicDevice device, float x, float y)
 {
     y = y + BoundingBox.Depth;
     foreach (Area a in content)
     {
         BoundingBox box = a.BoundingBox;
         y -= box.Depth;
         a.Render(device, x, y);
         y -= box.Height;
     }
 }
Ejemplo n.º 14
0
 /**
  * Render the Area. Most modifier area simply defer rendering
  * to the child area.
  */
 public override void Render(IGraphicDevice device, float x, float y)
 {
     child.Render(device, x, y);
 }
Ejemplo n.º 15
0
		/**
		 * render a filled rectangle with the current color that fills
		 * the area of the child node. Note, the context is given with
		 * coordinates at the origin of the bounding box, so we need to 
		 * calculate the extent of that rectangle here.
		 */
		public override void Render(IGraphicDevice device, float x, float y)
		{
			BoundingBox box = child.BoundingBox;
			device.DrawFilledRectangle(y - box.Height, x, x + box.Width, y + box.Depth);
		}
Ejemplo n.º 16
0
		/**
		 * TODO, figure out why we do nothing here
		 */
		public override void Render(IGraphicDevice device, float x, float y) {}
Ejemplo n.º 17
0
		/**
		 * Render the Area. Most modifier area simply defer rendering
		 * to the child area.
		 */
		public override void Render(IGraphicDevice device, float x, float y)
		{
			child.Render(device, x, y);
		}
Ejemplo n.º 18
0
        /**
		 * x and y are the upper left corner of the parent table
		 */
		public override void Render(IGraphicDevice device, float x, float y)
		{
			child.Render(device, x + areaShift.X, y + areaShift.Y);
		}
Ejemplo n.º 19
0
		public override void Render(IGraphicDevice device, float x, float y)
		{
			IFontHandle savedFont = device.SetFont(font);
			device.DrawString(x, y, content);
			device.RestoreFont(savedFont);
		}
Ejemplo n.º 20
0
		/**
		 * render this area. 
		 */
		public override void Render(IGraphicDevice device, float x, float y) 
		{
			IFontHandle oldFont = device.SetFont(font);
      device.DrawGlyph(index, x, y);		
			device.RestoreFont(oldFont);
		}
Ejemplo n.º 21
0
 /**
  * render this area.
  */
 public virtual void Render(IGraphicDevice device, float x, float y)
 {
 }
Ejemplo n.º 22
0
 /**
  * x and y are the upper left corner of the parent table
  */
 public override void Render(IGraphicDevice device, float x, float y)
 {
     child.Render(device, x + areaShift.X, y + areaShift.Y);
 }
Ejemplo n.º 23
0
        /**
         * render a filled rectangle with the current color that fills
         * the area of the child node. Note, the context is given with
         * coordinates at the origin of the bounding box, so we need to
         * calculate the extent of that rectangle here.
         */
        public override void Render(IGraphicDevice device, float x, float y)
        {
            BoundingBox box = child.BoundingBox;

            device.DrawFilledRectangle(y - box.Height, x, x + box.Width, y + box.Depth);
        }
Ejemplo n.º 24
0
		/**
		 * render all of the child areas.
		 */
		public override void Render(IGraphicDevice device, float x, float y)
		{
			y = y + BoundingBox.Depth;
			foreach(Area a in content)
			{
				BoundingBox box = a.BoundingBox;
				y -= box.Depth;
				a.Render(device, x, y);
				y -= box.Height;
			}			
		}
Ejemplo n.º 25
0
 public void SetupOutput(IGraphicDevice videoDevice, IAudioDevice audioDevice)
 {
     Ppu.OutputDevice = videoDevice;
     Apu = new Apu(this, audioDevice);
 }
Ejemplo n.º 26
0
 /**
  * TODO, figure out why we do nothing here
  */
 public override void Render(IGraphicDevice device, float x, float y)
 {
 }
Ejemplo n.º 27
0
 public void SetupOutput(IGraphicDevice videoDevice, IAudioDevice audioDevice)
 {
     Ppu.OutputDevice = videoDevice;
     Apu = new Apu(this, audioDevice);
 }