protected override void OnLoad(EventArgs e) { KeyDown += Program.keyDownEvent; KeyUp += Program.keyUpEvent; MouseDown += Program.MouseEvent; MouseUp += Program.MouseEvent; FileDrop += Program.FileDrop; Program.ResetCamera(); Program.CurrentRoute.CurrentBackground.BackgroundImageDistance = 600.0; Program.Renderer.Camera.ForwardViewingDistance = 600.0; Program.Renderer.Camera.BackwardViewingDistance = 0.0; Program.Renderer.Camera.ExtraViewingDistance = 50.0; Program.Renderer.Initialize(Program.CurrentHost, Interface.CurrentOptions); Program.Renderer.Lighting.Initialize(); Program.Sounds.Initialize(Program.CurrentHost, SoundRange.Low); Program.Renderer.UpdateViewport(); if (Program.processCommandLineArgs) { Program.processCommandLineArgs = false; for (int i = 0; i < Program.commandLineArguments.Length; i++) { if (!Program.SkipArgs[i] && System.IO.File.Exists(Program.commandLineArguments[i])) { currentlyLoading = true; Program.CurrentRouteFile = Program.commandLineArguments[i]; Program.LoadRoute(); Program.UpdateCaption(); break; } } } }
protected override void OnLoad(EventArgs e) { KeyDown += Program.keyDownEvent; KeyUp += Program.keyUpEvent; Program.ResetCamera(); World.BackgroundImageDistance = 600.0; World.ForwardViewingDistance = 600.0; World.BackwardViewingDistance = 0.0; World.ExtraViewingDistance = 50.0; Renderer.Initialize(); Renderer.InitializeLighting(); SoundManager.Initialize(); Fonts.Initialize(); Program.UpdateViewport(); if (Program.processCommandLineArgs) { Program.processCommandLineArgs = false; for (int i = 0; i < Program.commandLineArguments.Length; i++) { if (!Program.SkipArgs[i] && System.IO.File.Exists(Program.commandLineArguments[i])) { currentlyLoading = true; Program.CurrentRoute = Program.commandLineArguments[i]; Program.LoadRoute(); Program.UpdateCaption(); break; } } } }
protected override void OnLoad(EventArgs e) { KeyDown += Program.KeyDown; KeyUp += Program.KeyUp; MouseDown += Program.MouseEvent; MouseUp += Program.MouseEvent; MouseWheel += Program.MouseWheelEvent; FileDrop += Program.DragFile; Program.ResetCamera(); Renderer.Initialize(); Renderer.InitializeLighting(); //SwapBuffers(); Fonts.Initialize(); Program.UpdateViewport(); // command line arguments // if (commandLineArgs != null) // { // for (int i = 0; i < commandLineArgs.Length; i++) // { // if (!Program.SkipArgs[i] && System.IO.File.Exists(commandLineArgs[i])) // { // try // { // ObjectManager.UnifiedObject o = ObjectManager.LoadObject(commandLineArgs[i], // System.Text.Encoding.UTF8, ObjectManager.ObjectLoadMode.Normal, false, false, false,0,0,0); // ObjectManager.CreateObject(o, new Vector3(0.0, 0.0, 0.0), // new World.Transformation(0.0, 0.0, 0.0), new World.Transformation(0.0, 0.0, 0.0), true, // 0.0, 0.0, 25.0, 0.0); // } // catch (Exception ex) // { // Interface.AddMessage(Interface.MessageType.Critical, false, "Unhandled error (" + ex.Message + ") encountered while processing the file " + commandLineArgs[i] + "."); // } // Array.Resize<string>(ref Program.Files, Program.Files.Length + 1); // Program.Files[Program.Files.Length - 1] = commandLineArgs[i]; // } // } // } ObjectManager.InitializeVisibility(); ObjectManager.FinishCreatingObjects(); ObjectManager.UpdateVisibility(0.0, true); ObjectManager.UpdateAnimatedWorldObjects(0.01, true); Program.UpdateCaption(); }