LoadRoute() static private méthode

static private LoadRoute ( ) : bool
Résultat bool
Exemple #1
0
        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;
                    }
                }
            }
        }
Exemple #2
0
        protected override void OnLoad(EventArgs e)
        {
            KeyDown   += Program.keyDownEvent;
            KeyUp     += Program.keyUpEvent;
            MouseDown += Program.MouseEvent;
            MouseUp   += Program.MouseEvent;
            FileDrop  += Program.FileDrop;
            Program.Renderer.Camera.Reset(new Vector3(0.0, 2.5, -5.0));
            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;
                    }
                }
            }
        }
Exemple #3
0
 internal static void UpdateGraphicsSettings()
 {
     if (CurrentRouteFile != null)
     {
         Program.CurrentlyLoading = true;
         Renderer.RenderScene(0.0);
         Program.currentGameWindow.SwapBuffers();
         CameraAlignment a = Renderer.Camera.Alignment;
         if (Program.LoadRoute())
         {
             Renderer.Camera.Alignment = a;
             Program.Renderer.CameraTrackFollower.UpdateAbsolute(-1.0, true, false);
             Program.Renderer.CameraTrackFollower.UpdateAbsolute(a.TrackPosition, true, false);
             Renderer.Camera.AlignmentDirection = new CameraAlignment();
             Renderer.Camera.AlignmentSpeed     = new CameraAlignment();
             Renderer.UpdateVisibility(a.TrackPosition, true);
             ObjectManager.UpdateAnimatedWorldObjects(0.0, true);
         }
         Program.CurrentlyLoading = false;
     }
 }
Exemple #4
0
 internal static void UpdateGraphicsSettings()
 {
     if (Program.CurrentRoute != null)
     {
         Program.CurrentlyLoading = true;
         Renderer.RenderScene(0.0);
         Program.currentGameWindow.SwapBuffers();
         World.CameraAlignment a = World.CameraCurrentAlignment;
         Textures.UnloadAllTextures();
         if (Program.LoadRoute())
         {
             World.CameraCurrentAlignment = a;
             TrackManager.UpdateTrackFollower(ref World.CameraTrackFollower, -1.0, true, false);
             TrackManager.UpdateTrackFollower(ref World.CameraTrackFollower, a.TrackPosition, true, false);
             World.CameraAlignmentDirection = new World.CameraAlignment();
             World.CameraAlignmentSpeed     = new World.CameraAlignment();
             ObjectManager.UpdateVisibility(a.TrackPosition, true);
             ObjectManager.UpdateAnimatedWorldObjects(0.0, true);
         }
         Program.CurrentlyLoading = false;
     }
 }
Exemple #5
0
        protected override void OnLoad(EventArgs e)
        {
            KeyDown   += Program.keyDownEvent;
            KeyUp     += Program.keyUpEvent;
            MouseDown += Program.MouseEvent;
            MouseUp   += Program.MouseEvent;
            FileDrop  += Program.FileDrop;
            Program.Renderer.Camera.Reset(new Vector3(0.0, 2.5, -5.0));
            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;
                Program.LoadRoute();
                Program.UpdateCaption();
            }
        }
Exemple #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            TextureManager.InterpolationMode previousInterpolationMode = Interface.CurrentOptions.Interpolation;
            int previousAntialasingLevel = Interface.CurrentOptions.AntialiasingLevel;
            int previousAnsiotropicLevel = Interface.CurrentOptions.AnisotropicFilteringLevel;

            //Interpolation mode
            switch (InterpolationMode.SelectedIndex)
            {
            case 0:
                Interface.CurrentOptions.Interpolation = TextureManager.InterpolationMode.NearestNeighbor;
                break;

            case 1:
                Interface.CurrentOptions.Interpolation = TextureManager.InterpolationMode.Bilinear;
                break;

            case 2:
                Interface.CurrentOptions.Interpolation = TextureManager.InterpolationMode.NearestNeighborMipmapped;
                break;

            case 3:
                Interface.CurrentOptions.Interpolation = TextureManager.InterpolationMode.BilinearMipmapped;
                break;

            case 4:
                Interface.CurrentOptions.Interpolation = TextureManager.InterpolationMode.TrilinearMipmapped;
                break;

            case 5:
                Interface.CurrentOptions.Interpolation = TextureManager.InterpolationMode.AnisotropicFiltering;
                break;
            }
            //Ansiotropic filtering level
            Interface.CurrentOptions.AnisotropicFilteringLevel = (int)AnsiotropicLevel.Value;
            //Antialiasing level
            Interface.CurrentOptions.AntialiasingLevel = (int)AntialiasingLevel.Value;
            if (Interface.CurrentOptions.AntialiasingLevel != previousAntialasingLevel)
            {
                Program.currentGraphicsMode = new GraphicsMode(new ColorFormat(8, 8, 8, 8), 24, 8, Interface.CurrentOptions.AntialiasingLevel);
            }
            //Transparency quality
            switch (TransparencyQuality.SelectedIndex)
            {
            case 0:
                Interface.CurrentOptions.TransparencyMode = Renderer.TransparencyMode.Sharp;
                break;

            default:
                Interface.CurrentOptions.TransparencyMode = Renderer.TransparencyMode.Smooth;
                break;
            }
            //Set width and height
            if (Renderer.ScreenWidth != width.Value || Renderer.ScreenHeight != height.Value)
            {
                Renderer.ScreenWidth             = (int)width.Value;
                Renderer.ScreenHeight            = (int)height.Value;
                Program.currentGameWindow.Width  = (int)width.Value;
                Program.currentGameWindow.Height = (int)height.Value;
                Program.UpdateViewport();
            }
            //Check if interpolation mode or ansiotropic filtering level has changed, and trigger a reload
            if (previousInterpolationMode != Interface.CurrentOptions.Interpolation || previousAnsiotropicLevel != Interface.CurrentOptions.AnisotropicFilteringLevel)
            {
                if (Program.CurrentRoute != null)
                {
                    Program.CurrentlyLoading = true;
                    Renderer.RenderScene(0.0);
                    Program.currentGameWindow.SwapBuffers();
                    World.CameraAlignment a = World.CameraCurrentAlignment;
                    if (Program.LoadRoute())
                    {
                        World.CameraCurrentAlignment = a;
                        TrackManager.UpdateTrackFollower(ref World.CameraTrackFollower, -1.0, true, false);
                        TrackManager.UpdateTrackFollower(ref World.CameraTrackFollower, a.TrackPosition, true, false);
                        World.CameraAlignmentDirection = new World.CameraAlignment();
                        World.CameraAlignmentSpeed     = new World.CameraAlignment();
                        ObjectManager.UpdateVisibility(a.TrackPosition, true);
                        ObjectManager.UpdateAnimatedWorldObjects(0.0, true);
                    }
                    Program.CurrentlyLoading = false;
                }
            }
            Renderer.TransparentColorDepthSorting = Interface.CurrentOptions.TransparencyMode == Renderer.TransparencyMode.Smooth & Interface.CurrentOptions.Interpolation != TextureManager.InterpolationMode.NearestNeighbor & Interface.CurrentOptions.Interpolation != TextureManager.InterpolationMode.Bilinear;
            Options.SaveOptions();
            this.Dispose();
        }