OpenBve.Renderer.Reset C# (CSharp) Méthode

Reset() static private méthode

static private Reset ( ) : void
Résultat void
        internal static void Reset()
        {
            LoadTexturesImmediately = LoadTextureImmediatelyMode.NotYet;
            ObjectList = new Object[256];
            ObjectListCount = 0;
            OpaqueList = new ObjectFace[256];
            OpaqueListCount = 0;
            TransparentColorList = new ObjectFace[256];
            TransparentColorListDistance = new double[256];
            TransparentColorListCount = 0;
            AlphaList = new ObjectFace[256];
            AlphaListDistance = new double[256];
            AlphaListCount = 0;
            OverlayList = new ObjectFace[256];
            OverlayListDistance = new double[256];
            OverlayListCount = 0;
            OptionLighting = true;
            OptionAmbientColor = new World.ColorRGB(160, 160, 160);
            OptionDiffuseColor = new World.ColorRGB(160, 160, 160);
            OptionLightPosition = new World.Vector3Df(0.215920077052065f, 0.875724044222352f, -0.431840154104129f);
            OptionLightingResultingAmount = 1.0f;
            GL.Disable(EnableCap.Fog); FogEnabled = false;
        }

Usage Example

Exemple #1
0
        // ================================

        /// <summary>Call this function to reset the game</summary>
        /// <param name="ResetLogs">Whether the logs should be reset</param>
        internal static void Reset(bool ResetLogs)
        {
            // track manager
            for (int i = 0; i < TrackManager.Tracks.Length; i++)
            {
                TrackManager.Tracks[i] = new TrackManager.Track();
            }
            // train manager
            TrainManager.Trains = new TrainManager.Train[] { };
            // game
            Interface.ClearMessages();
            CurrentInterface = InterfaceType.Normal;
            RouteComment     = "";
            RouteImage       = "";
            RouteAccelerationDueToGravity = 9.80665;
            RouteRailGauge              = 1.435;
            RouteInitialAirPressure     = 101325.0;
            RouteInitialAirTemperature  = 293.15;
            RouteInitialElevation       = 0.0;
            RouteSeaLevelAirPressure    = 101325.0;
            RouteSeaLevelAirTemperature = 293.15;
            Stations = new RouteStation[] { };
            CurrentRoute.Sections = new Section[] { };
            BufferTrackPositions  = new double[] { };
            //Messages = new Message[] { };
            MarkerTextures           = new Texture[] { };
            PointsOfInterest         = new PointOfInterest[] { };
            PrecedingTrainTimeDeltas = new double[] { };
            PrecedingTrainSpeedLimit = double.PositiveInfinity;
            CurrentRoute.BogusPretrainInstructions = new BogusPretrainInstruction[] { };
            TrainName  = "";
            TrainStart = TrainStartMode.EmergencyBrakesNoAts;
            CurrentRoute.NoFogStart   = (float)Math.Max(1.33333333333333 * Interface.CurrentOptions.ViewingDistance, 800.0);
            CurrentRoute.NoFogEnd     = (float)Math.Max(2.66666666666667 * Interface.CurrentOptions.ViewingDistance, 1600.0);
            CurrentRoute.PreviousFog  = new Fog(CurrentRoute.NoFogStart, CurrentRoute.NoFogEnd, Color24.Grey, 0.0);
            CurrentRoute.CurrentFog   = new Fog(CurrentRoute.NoFogStart, CurrentRoute.NoFogEnd, Color24.Grey, 0.5);
            CurrentRoute.NextFog      = new Fog(CurrentRoute.NoFogStart, CurrentRoute.NoFogEnd, Color24.Grey, 1.0);
            InfoTotalTriangles        = 0;
            InfoTotalTriangleStrip    = 0;
            InfoTotalQuads            = 0;
            InfoTotalQuadStrip        = 0;
            InfoTotalPolygon          = 0;
            InfoStaticOpaqueFaceCount = 0;
            if (ResetLogs)
            {
                LogRouteName       = "";
                LogTrainName       = "";
                LogDateTime        = DateTime.Now;
                CurrentScore       = new Score();
                ScoreMessages      = new ScoreMessage[] { };
                ScoreLogs          = new ScoreLog[64];
                ScoreLogCount      = 0;
                BlackBoxEntries    = new BlackBoxEntry[256];
                BlackBoxEntryCount = 0;
                BlackBoxNextUpdate = 0.0;
            }
            // renderer
            Renderer.Reset();
        }
All Usage Examples Of OpenBve.Renderer::Reset