public void Apply(bool applyGumps) { if (this.m_Applying) { return; } this.m_Applying = true; try { Display display = Engine.m_Display; Engine.GameX = this.m_GameBounds.X; Engine.GameY = this.m_GameBounds.Y; Engine.GameWidth = this.m_GameBounds.Width; Engine.GameHeight = this.m_GameBounds.Height; if (this.m_Fullscreen) { display.FormBorderStyle = FormBorderStyle.None; display.WindowState = FormWindowState.Maximized; } else if (this.m_Maximized) { display.FormBorderStyle = FormBorderStyle.Sizable; display.WindowState = FormWindowState.Maximized; } else { Size frameBorderSize = SystemInformation.FrameBorderSize; int captionHeight = SystemInformation.CaptionHeight; display.FormBorderStyle = FormBorderStyle.Sizable; display.WindowState = FormWindowState.Normal; display.Location = (System.Drawing.Point) new PlayUO.Point(this.m_ScreenBounds.X - frameBorderSize.Width, this.m_ScreenBounds.Y - frameBorderSize.Height - captionHeight); display.ClientSize = this.m_ScreenBounds.Size; } int num1 = this.m_GameBounds.Width * this.m_GameBounds.Height; int num2 = num1 < 1920000 ? (num1 < 1310720 ? (num1 < 480000 ? (num1 < 307200 ? 3 : 5) : 7) : 9) : 11; Renderer.blockWidth = num2; Renderer.blockHeight = num2; Renderer.cellWidth = num2 << 3; Renderer.cellHeight = num2 << 3; if (!applyGumps) { return; } foreach (GumpLayout mGump in this.m_Gumps) { Gump gump = mGump.CreateGump(); mGump.Setup(gump); gump.SetLayout(mGump); PlayUO.Gumps.Desktop.Children.Add(gump); } } finally { this.m_Applying = false; } }