예제 #1
0
        // load route
        internal static bool LoadRoute(Bitmap bitmap = null)
        {
            if (string.IsNullOrEmpty(CurrentRouteFile))
            {
                return(false);
            }
            CurrentStation = -1;
            Renderer.UpdateViewport();
            bool result;

            try
            {
                Encoding encoding = TextEncoding.GetSystemEncodingFromFile(CurrentRouteFile);
                Loading.Load(CurrentRouteFile, encoding, bitmap);
                result = true;
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Game.Reset();
                result           = false;
                CurrentRouteFile = null;
            }

            if (Loading.Cancel)
            {
                result           = false;
                CurrentRouteFile = null;
            }
            Renderer.Lighting.Initialize();
            Renderer.InitializeVisibility();
            return(result);
        }
예제 #2
0
파일: ProgramR.cs 프로젝트: xfleet/OpenBVE
        // load route
        internal static bool LoadRoute()
        {
            CurrentStation = -1;
            Game.Reset();
            Renderer.UpdateViewport();
            bool result;

            try {
                Loading.Load(CurrentRouteFile, System.Text.Encoding.UTF8);
                result = true;
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Game.Reset();
                CurrentRoute = null;
                result       = false;
            }
            Renderer.Lighting.Initialize();
            Renderer.InitializeVisibility();
            Renderer.TextureManager.UnloadAllTextures();
            return(result);
        }