OpenBve.Game.Reset C# (CSharp) Method

Reset() static private method

static private Reset ( ) : void
return void
		internal static void Reset() {
			Renderer.Reset();
			ObjectManager.Objects = new ObjectManager.StaticObject[16];
			ObjectManager.ObjectsUsed = 0;
			ObjectManager.ObjectsSortedByStart = new int[] { };
			ObjectManager.ObjectsSortedByEnd = new int[] { };
			ObjectManager.ObjectsSortedByStartPointer = 0;
			ObjectManager.ObjectsSortedByEndPointer = 0;
			ObjectManager.LastUpdatedTrackPosition = 0.0;
			ObjectManager.AnimatedWorldObjects = new ObjectManager.AnimatedWorldObject[4];
			ObjectManager.AnimatedWorldObjectsUsed = 0;
		}
	}

Same methods

Game::Reset ( bool ResetLogs ) : void

Usage Example

示例#1
0
        private static void routeWorkerThread_doWork(object sender, DoWorkEventArgs e)
        {
            if (string.IsNullOrEmpty(currentFile))
            {
                return;
            }
            RouteEncoding = TextEncoding.GetSystemEncodingFromFile(currentFile);
            Program.CurrentHost.RegisterTexture(Path.CombineFile(Program.FileSystem.DataFolder, "Menu\\loading.png"), new TextureParameters(null, null), out routePictureBox.Texture);
            routeDescriptionBox.Text = Translations.GetInterfaceString("start_route_processing");
            Game.Reset(false);
            bool loaded = false;

            for (int i = 0; i < Program.CurrentHost.Plugins.Length; i++)
            {
                if (Program.CurrentHost.Plugins[i].Route != null && Program.CurrentHost.Plugins[i].Route.CanLoadRoute(currentFile))
                {
                    object Route         = (object)Program.CurrentRoute;             //must cast to allow us to use the ref keyword.
                    string RailwayFolder = Loading.GetRailwayFolder(currentFile);
                    string ObjectFolder  = OpenBveApi.Path.CombineDirectory(RailwayFolder, "Object");
                    string SoundFolder   = OpenBveApi.Path.CombineDirectory(RailwayFolder, "Sound");
                    if (Program.CurrentHost.Plugins[i].Route.LoadRoute(currentFile, RouteEncoding, null, ObjectFolder, SoundFolder, true, ref Route))
                    {
                        Program.CurrentRoute = (CurrentRoute)Route;
                    }
                    else
                    {
                        if (Program.CurrentHost.Plugins[i].Route.LastException != null)
                        {
                            throw Program.CurrentHost.Plugins[i].Route.LastException;                             //Re-throw last exception generated by the route parser plugin so that the UI thread captures it
                        }
                        routeDescriptionBox.Text = "An unknown error was enountered whilst attempting to parse the routefile " + currentFile;
                        RoutefileState           = RouteState.Error;
                    }
                    loaded = true;
                    break;
                }
            }

            if (!loaded)
            {
                throw new Exception("No plugins capable of loading routefile " + currentFile + " were found.");
            }
        }
All Usage Examples Of OpenBve.Game::Reset