static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); foreach (KeyValuePair <LibraryFile, string> pair in Libraries.LibraryList) { if (!File.Exists(@".\" + pair.Value)) { continue; } CEnvir.LibraryList[pair.Key] = new MirLibrary(@".\" + pair.Value); } ConfigReader.Load(); CEnvir.LoadDatabase(); CEnvir.Target = new TargetForm(); DXManager.Create(); DXSoundManager.Create(); DXControl.ActiveScene = new LoginScene(Config.IntroSceneSize); MessagePump.Run(CEnvir.Target, CEnvir.GameLoop); ConfigReader.Save(); CEnvir.Session?.Save(true); CEnvir.Unload(); DXManager.Unload(); DXSoundManager.Unload(); }
public Main() { InitializeComponent(); This = this; Application.Idle += Application_Idle; FormClosing += Main_FormClosing; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Selectable, true); FormBorderStyle = Settings.FullScreen ? FormBorderStyle.None : FormBorderStyle.FixedDialog; ClientSize = Settings.ScreenSize; MouseClick += Main_MouseClick; MouseDown += Main_MouseDown; MouseUp += Main_MouseUp; MouseMove += Main_MouseMove; MouseDoubleClick += Main_MouseDoubleClick; KeyPress += Main_KeyPress; KeyDown += Main_KeyDown; KeyUp += Main_KeyUp; Deactivate += Main_Deactivate; DXManager.Create(); }
private void CMain_Load(object sender, EventArgs e) { try { ClientSize = new Size(Settings.ScreenWidth, Settings.ScreenHeight); DXManager.Create(); SoundManager.Create(); } catch (Exception ex) { SaveError(ex.ToString()); } }
public static void SetResolution(int width, int height) { if (Settings.ScreenWidth == width && Settings.ScreenHeight == height) { return; } DXManager.Device.Clear(ClearFlags.Target, Color.Black, 0, 0); DXManager.Device.Present(); DXManager.Device.Dispose(); Settings.ScreenWidth = width; Settings.ScreenHeight = height; Program.Form.ClientSize = new Size(width, height); DXManager.Create(); }
private void CMain_Load(object sender, EventArgs e) { this.Text = GameLanguage.GameName; try { ClientSize = new Size(Settings.ScreenWidth, Settings.ScreenHeight); LoadMouseCursors(); SetMouseCursor(MouseCursor.Default); DXManager.Create(); SoundManager.Create(); CenterToScreen(); } catch (Exception ex) { SaveError(ex.ToString()); } }