/** * 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); } }
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; }
/** * 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); } }
public override void Render(IGraphicDevice device, float x, float y) { IFontHandle savedFont = device.SetFont(font); device.DrawString(x, y, content); device.RestoreFont(savedFont); }
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; }
/** * 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); }
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); }; }
/** * 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; } }
/** * 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; } }
/** * 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; }
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); }
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); }
/** * 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; } }
/** * 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); }
/** * 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); }
/** * TODO, figure out why we do nothing here */ public override void Render(IGraphicDevice device, float x, float y) {}
/** * 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); }
/** * 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); }
public override void Render(IGraphicDevice device, float x, float y) { IFontHandle savedFont = device.SetFont(font); device.DrawString(x, y, content); device.RestoreFont(savedFont); }
/** * 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); }
/** * render this area. */ public virtual void Render(IGraphicDevice device, float x, float y) { }
/** * 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); }
/** * 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); }
/** * 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; } }
public void SetupOutput(IGraphicDevice videoDevice, IAudioDevice audioDevice) { Ppu.OutputDevice = videoDevice; Apu = new Apu(this, audioDevice); }
/** * TODO, figure out why we do nothing here */ public override void Render(IGraphicDevice device, float x, float y) { }
public void SetupOutput(IGraphicDevice videoDevice, IAudioDevice audioDevice) { Ppu.OutputDevice = videoDevice; Apu = new Apu(this, audioDevice); }